|
|||||||||
| Home >> All >> org >> [ activemq overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.activemq
Class ActiveMQConnection

java.lang.Objectorg.activemq.ActiveMQConnection
- All Implemented Interfaces:
- org.activemq.capacity.CapacityMonitorEventListener, Closeable, javax.jms.Connection, javax.jms.ExceptionListener, org.activemq.message.PacketListener, javax.jms.QueueConnection, org.activemq.management.StatsCapable, javax.jms.TopicConnection, org.activemq.transport.TransportStatusEventListener
- Direct Known Subclasses:
- ActiveMQXAConnection
- public class ActiveMQConnection
- extends java.lang.Object
- implements javax.jms.Connection, org.activemq.message.PacketListener, javax.jms.ExceptionListener, javax.jms.TopicConnection, javax.jms.QueueConnection, org.activemq.management.StatsCapable, org.activemq.capacity.CapacityMonitorEventListener, org.activemq.transport.TransportStatusEventListener, Closeable
- extends java.lang.Object
A Connection object is a client's active connection to its JMS
provider. It typically allocates provider resources outside the Java virtual
machine (JVM).
Connections support concurrent use.
A connection serves several purposes:
- It encapsulates an open connection with a JMS provider. It typically represents an open TCP/IP socket between a client and the service provider software.
- Its creation is where client authentication takes place.
- It can specify a unique client identifier.
- It provides a
ConnectionMetaDataobject. - It supports an optional
ExceptionListenerobject.
Because the creation of a connection involves setting up authentication and communication, a connection is a relatively heavyweight object. Most clients will do all their messaging with a single connection. Other more advanced applications may use several connections. The JMS API does not architect a reason for using multiple connections; however, there may be operational reasons for doing so.
A JMS client typically creates a connection, one or more sessions, and a number of message producers and consumers. When a connection is created, it is in stopped mode. That means that no messages are being delivered.
It is typical to leave the connection in stopped mode until setup is complete
(that is, until all message consumers have been created). At that point, the
client calls the connection's start method, and messages begin
arriving at the connection's consumers. This setup convention minimizes any
client confusion that may result from asynchronous message delivery while the
client is still in the process of setting itself up.
A connection can be started immediately, and the setup can be done afterwards. Clients that do this must be prepared to handle asynchronous message delivery while they are still in the process of setting up.
A message producer can send messages while a connection is stopped.
This class is also aTopicConnection . A TopicConnection
object is an active connection to a publish/subscribe JMS provider. A client
uses a TopicConnection object to create one or more TopicSession
objects for producing and consuming messages.
A TopicConnection can be used to create a TopicSession,
from which specialized topic-related objects can be created. A more general,
and recommended approach is to use the Connection object.
This class is also a
QueueConnection. A A QueueConnection
object is an active connection to a point-to-point JMS provider. A client
uses a QueueConnection object to create one or more QueueSession
objects for producing and consuming messages.
A QueueConnection can be used to create a QueueSession,
from which specialized queue-related objects can be created. A more general,
and recommended, approach is to use the Connection object.
A QueueConnection cannot be used to create objects specific to
the publish/subscribe domain. The createDurableConnectionConsumer
method inherits from Connection, but must throw an IllegalStateException
if used from QueueConnection. // *
- Version:
- $Revision: 1.1.1.1 $
| Constructor Summary | |
protected |
ActiveMQConnection(ActiveMQConnectionFactory factory,
java.lang.String theUserName,
java.lang.String thePassword)
|
|
ActiveMQConnection(ActiveMQConnectionFactory factory,
java.lang.String theUserName,
java.lang.String thePassword,
org.activemq.transport.TransportChannel transportChannel)
Constructs a connection from an existing TransportChannel and user/password. |
| Method Summary | |
protected void |
addConnectionConsumer(ActiveMQConnectionConsumer connectionConsumer)
Add a ConnectionConsumer |
protected void |
addMessageDispatcher(ActiveMQMessageDispatcher messageDispatch)
Add a Message dispatcher to receive messages from the Broker |
protected void |
addSession(ActiveMQSession session)
Used internally for adding Sessions to the Connection |
protected void |
addToTransientConsumedRedeliverCache(org.activemq.message.ActiveMQMessage message)
|
private org.activemq.message.ActiveMQMessage |
assembleMessage(org.activemq.message.ActiveMQMessage message)
|
void |
asyncSendPacket(org.activemq.message.Packet packet)
send a Packet through the Connection - for internal use only |
void |
asyncSendPacket(org.activemq.message.Packet packet,
boolean doSendWhileReconnecting)
send a Packet through the Connection - for internal use only |
void |
capacityChanged(org.activemq.capacity.CapacityMonitorEvent event)
CapacityMonitorEventListener implementation called when the capacity of a CapacityService changes |
void |
changeUserInfo(java.lang.String theUserName,
java.lang.String thePassword)
Changes the associated username/password that is associated with this connection. |
void |
checkClientIDWasManuallySpecified()
Ensures that the clientID was manually specified and not auto-generated. |
protected void |
checkClosed()
simply throws an exception if the Connection is already closed |
void |
cleanup()
Cleans up this connection so that it's state is as if the connection was just created. |
protected void |
clearMessagesInProgress()
|
void |
close()
Closes the connection. |
protected void |
closeTemporaryDestinations()
|
void |
consume(org.activemq.message.Packet packet)
Implementation of the PacketListener interface - consume a packet |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a connection consumer for this connection (optional operation). |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages,
boolean noLocal)
Creates a connection consumer for this connection (optional operation). |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Queue queue,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a connection consumer for this connection (optional operation). |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Topic topic,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a connection consumer for this connection (optional operation). |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String subscriptionName,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Create a durable connection consumer for this connection (optional operation). |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String subscriptionName,
java.lang.String messageSelector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages,
boolean noLocal)
Create a durable connection consumer for this connection (optional operation). |
javax.jms.QueueSession |
createQueueSession(boolean transacted,
int acknowledgeMode)
Creates a QueueSession object. |
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode)
Creates a Session object. |
javax.jms.Session |
createSession(boolean transacted,
int acknowledgeMode,
boolean optimizedDispatch)
Creates a Session object. |
private org.activemq.message.SessionInfo |
createSessionInfo(ActiveMQSession session)
|
javax.jms.TopicSession |
createTopicSession(boolean transacted,
int acknowledgeMode)
Creates a TopicSession object. |
void |
destroyDestination(org.activemq.message.ActiveMQDestination destination)
Tells the broker to destroy a destination. |
private java.lang.String |
determineResourceManagerId()
Get's the resource manager id. |
protected void |
doReconnect()
|
private void |
ensureClientIDInitialised()
|
protected short |
generateSessionId()
|
ConcurrentHashMap |
getAssemblies()
|
java.lang.String |
getClientID()
Gets the client identifier for this connection. |
int |
getConnectionMemoryLimit()
Get the current value for the maximum amount of memory this Connection should use for buffered inbound messages |
org.activemq.management.JMSConnectionStatsImpl |
getConnectionStats()
|
javax.jms.ExceptionListener |
getExceptionListener()
Gets the ExceptionListener object for this connection. |
private org.activemq.filter.FilterFactory |
getFilterFactory()
|
org.activemq.io.util.ByteArrayFragmentation |
getFragmentation()
|
java.lang.String |
getInitializedClientID()
Returns the clientID of the connection, forcing one to be generated if one has not yet been configured |
protected org.activemq.io.util.MemoryBoundedQueue |
getMemoryBoundedQueue(java.lang.String name)
|
int |
getMessageCompressionLevel()
|
int |
getMessageCompressionLimit()
|
int |
getMessageCompressionStrategy()
|
int |
getMessageFragmentationLimit()
|
javax.jms.ConnectionMetaData |
getMetaData()
Gets the metadata for this connection. |
protected int |
getNextConsumerNumber()
|
ActiveMQPrefetchPolicy |
getPrefetchPolicy()
|
java.lang.String |
getResourceManagerId()
|
int |
getSendCloseTimeout()
|
int |
getSendConnectionInfoTimeout()
|
org.activemq.management.StatsImpl |
getStats()
|
org.activemq.transport.TransportChannel |
getTransportChannel()
|
protected void |
handleAsyncException(javax.jms.JMSException jmsEx)
Used for handling async exceptions |
boolean |
isCachingEnabled()
|
boolean |
isCopyMessageOnSend()
|
boolean |
isDisableTimeStampsByDefault()
|
boolean |
isDoMessageCompression()
|
boolean |
isDoMessageFragmentation()
|
boolean |
isInternalConnection()
|
boolean |
isJ2EEcompliant()
|
boolean |
isOptimizedMessageDispatch()
|
boolean |
isPrepareMessageBodyOnSend()
Causes pre-serialization of messages before send By default this is on |
boolean |
isQuickClose()
|
protected boolean |
isStarted()
|
boolean |
isUseAsyncSend()
|
static ActiveMQConnection |
makeConnection()
A static helper method to create a new connection |
static ActiveMQConnection |
makeConnection(java.lang.String uri)
A static helper method to create a new connection |
static ActiveMQConnection |
makeConnection(java.lang.String user,
java.lang.String password,
java.lang.String uri)
A static helper method to create a new connection |
void |
onException(javax.jms.JMSException jmsEx)
|
protected void |
removeConnectionConsumer(ActiveMQConnectionConsumer connectionConsumer)
Remove a ConnectionConsumer |
protected void |
removeMessageDispatcher(ActiveMQMessageDispatcher messageDispatcher)
Remove a Message dispatcher |
protected void |
removeSession(ActiveMQSession session)
Used interanlly for removing Sessions from a Connection |
protected void |
replayTransientConsumedRedeliveredMessages(ActiveMQSession session,
ActiveMQMessageConsumer consumer)
|
protected void |
sendConnectionInfoToBroker()
|
protected void |
sendConnectionInfoToBroker(int timeout,
boolean forceResend,
boolean closing)
Send the ConnectionInfo to the Broker |
void |
setCachingEnabled(boolean cachingEnabled)
|
void |
setClientID(java.lang.String newClientID)
Sets the client identifier for this connection. |
void |
setConnectionMemoryLimit(int newMemoryLimit)
Set the maximum amount of memory this Connection should use for buffered inbound messages |
void |
setCopyMessageOnSend(boolean copyMessageOnSend)
|
void |
setDisableTimeStampsByDefault(boolean disableTimeStampsByDefault)
|
void |
setDoMessageCompression(boolean doMessageCompression)
|
void |
setDoMessageFragmentation(boolean doMessageFragmentation)
|
void |
setExceptionListener(javax.jms.ExceptionListener listener)
Sets an exception listener for this connection. |
void |
setInternalConnection(boolean internalConnection)
|
void |
setJ2EEcompliant(boolean ecompliant)
|
void |
setMessageCompressionLevel(int messageCompressionLevel)
|
void |
setMessageCompressionLimit(int messageCompressionLimit)
|
void |
setMessageCompressionStrategy(int messageCompressionStrategy)
|
void |
setMessageFragmentationLimit(int messageFragmentationLimit)
|
void |
setOptimizedMessageDispatch(boolean optimizedMessageDispatch)
|
void |
setPrefetchPolicy(ActiveMQPrefetchPolicy prefetchPolicy)
|
void |
setPrepareMessageBodyOnSend(boolean prePrepareMessageOnSend)
Causes pre-serialization of messages before send By default this is on |
void |
setQuickClose(boolean quickClose)
|
void |
setSendCloseTimeout(int sendCloseTimeout)
|
void |
setSendConnectionInfoTimeout(int sendConnectionInfoTimeout)
|
void |
setUseAsyncSend(boolean useAsyncSend)
|
void |
start()
Starts (or restarts) a connection's delivery of incoming messages. |
protected void |
startAdvisoryForTempDestination(javax.jms.Destination d)
|
protected void |
startTemporaryDestination(org.activemq.message.ActiveMQDestination dest)
|
void |
statusChanged(org.activemq.transport.TransportStatusEvent event)
handle disconnect/reconnect events |
void |
stop()
Temporarily stops a connection's delivery of incoming messages. |
protected void |
stopAdvisoryForTempDestination(org.activemq.message.ActiveMQDestination d)
|
protected void |
stopTemporaryDestination(org.activemq.message.ActiveMQDestination dest)
|
void |
syncSendPacket(org.activemq.message.Packet packet)
send a Packet through a Connection - for internal use only |
void |
syncSendPacket(org.activemq.message.Packet packet,
int timeout)
Send a packet through a Connection - for internal use only |
org.activemq.message.Receipt |
syncSendRequest(org.activemq.message.Packet packet)
|
void |
terminateBrokerVM()
Tells the broker to terminate its VM. |
protected void |
validateDestination(org.activemq.message.ActiveMQDestination dest)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
DEFAULT_USER
public static final java.lang.String DEFAULT_USER
- Default UserName for the Connection
- See Also:
- Constant Field Values
DEFAULT_BROKER_URL
public static final java.lang.String DEFAULT_BROKER_URL
- Default URL for the ActiveMQ Broker
- See Also:
- Constant Field Values
DEFAULT_URL
public static final java.lang.String DEFAULT_URL
- Default client URL. If using a message broker in a hub(s)/spoke
architecture - use the DEFAULT_BROKER_URL
- See Also:
DEFAULT_BROKER_URL55 , Constant Field Values
DEFAULT_PASSWORD
public static final java.lang.String DEFAULT_PASSWORD
- Default Password for the Connection
- See Also:
- Constant Field Values
log
private static final org.apache.commons.logging.Log log
DEFAULT_CONNECTION_MEMORY_LIMIT
private static final int DEFAULT_CONNECTION_MEMORY_LIMIT
- See Also:
- Constant Field Values
factory
private ActiveMQConnectionFactory factory
userName
private java.lang.String userName
password
private java.lang.String password
clientID
protected java.lang.String clientID
sendCloseTimeout
private int sendCloseTimeout
transportChannel
private org.activemq.transport.TransportChannel transportChannel
exceptionListener
private javax.jms.ExceptionListener exceptionListener
prefetchPolicy
private ActiveMQPrefetchPolicy prefetchPolicy
factoryStats
private org.activemq.management.JMSStatsImpl factoryStats
memoryManager
private org.activemq.io.util.MemoryBoundedObjectManager memoryManager
boundedQueueManager
private org.activemq.io.util.MemoryBoundedQueueManager boundedQueueManager
handleIdGenerator
protected org.activemq.util.IdGenerator handleIdGenerator
clientIdGenerator
private org.activemq.util.IdGenerator clientIdGenerator
packetIdGenerator
protected org.activemq.util.IdGenerator packetIdGenerator
sessionIdGenerator
private org.activemq.util.IdGenerator sessionIdGenerator
stats
private org.activemq.management.JMSConnectionStatsImpl stats
sessions
private CopyOnWriteArrayList sessions
messageDispatchers
private CopyOnWriteArrayList messageDispatchers
connectionConsumers
private CopyOnWriteArrayList connectionConsumers
consumerNumberGenerator
private EDU.oswego.cs.dl.util.concurrent.SynchronizedInt consumerNumberGenerator
connectionMetaData
private ActiveMQConnectionMetaData connectionMetaData
closed
private boolean closed
started
private SynchronizedBoolean started
clientIDSet
private boolean clientIDSet
isConnectionInfoSentToBroker
private boolean isConnectionInfoSentToBroker
isTransportOK
private boolean isTransportOK
startedTransport
private boolean startedTransport
startTime
private long startTime
flowControlSleepTime
private long flowControlSleepTime
quickClose
private boolean quickClose
internalConnection
private boolean internalConnection
userSpecifiedClientID
private boolean userSpecifiedClientID
useAsyncSend
protected boolean useAsyncSend
- Should we use an async send for persistent non transacted messages ?
sendConnectionInfoTimeout
private int sendConnectionInfoTimeout
disableTimeStampsByDefault
private boolean disableTimeStampsByDefault
J2EEcompliant
private boolean J2EEcompliant
prepareMessageBodyOnSend
private boolean prepareMessageBodyOnSend
copyMessageOnSend
private boolean copyMessageOnSend
doMessageCompression
private boolean doMessageCompression
messageCompressionLimit
private int messageCompressionLimit
messageCompressionLevel
private int messageCompressionLevel
messageCompressionStrategy
private int messageCompressionStrategy
doMessageFragmentation
private boolean doMessageFragmentation
messageFragmentationLimit
private int messageFragmentationLimit
cachingEnabled
private boolean cachingEnabled
optimizedMessageDispatch
private boolean optimizedMessageDispatch
transientConsumedRedeliverCache
private CopyOnWriteArrayList transientConsumedRedeliverCache
filterFactory
private org.activemq.filter.FilterFactory filterFactory
tempDestinationMap
private java.util.Map tempDestinationMap
validDestinationsMap
private java.util.Map validDestinationsMap
resourceManagerId
private java.lang.String resourceManagerId
assemblies
private final ConcurrentHashMap assemblies
fragmentation
private final org.activemq.io.util.ByteArrayFragmentation fragmentation
| Constructor Detail |
ActiveMQConnection
public ActiveMQConnection(ActiveMQConnectionFactory factory, java.lang.String theUserName, java.lang.String thePassword, org.activemq.transport.TransportChannel transportChannel) throws javax.jms.JMSException
- Constructs a connection from an existing TransportChannel and
user/password.
ActiveMQConnection
protected ActiveMQConnection(ActiveMQConnectionFactory factory, java.lang.String theUserName, java.lang.String thePassword)
| Method Detail |
makeConnection
public static ActiveMQConnection makeConnection() throws javax.jms.JMSException
- A static helper method to create a new connection
makeConnection
public static ActiveMQConnection makeConnection(java.lang.String uri) throws javax.jms.JMSException
- A static helper method to create a new connection
makeConnection
public static ActiveMQConnection makeConnection(java.lang.String user, java.lang.String password, java.lang.String uri) throws javax.jms.JMSException
- A static helper method to create a new connection
getStats
public org.activemq.management.StatsImpl getStats()
- Specified by:
getStatsin interfaceorg.activemq.management.StatsCapable
getConnectionStats
public org.activemq.management.JMSConnectionStatsImpl getConnectionStats()
createSession
public javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
- Creates a
Sessionobject.- Specified by:
createSessionin interfacejavax.jms.Connection
- Since:
- 1.1
createSession
public javax.jms.Session createSession(boolean transacted, int acknowledgeMode, boolean optimizedDispatch) throws javax.jms.JMSException
- Creates a
Sessionobject.- Since:
- 1.1
getClientID
public java.lang.String getClientID() throws javax.jms.JMSException
- Gets the client identifier for this connection.
This value is specific to the JMS provider. It is either preconfigured by an administrator in a
ConnectionFactoryobject or assigned dynamically by the application by calling thesetClientIDmethod.- Specified by:
getClientIDin interfacejavax.jms.Connection
setClientID
public void setClientID(java.lang.String newClientID) throws javax.jms.JMSException
- Sets the client identifier for this connection.
The preferred way to assign a JMS client's client identifier is for it to be configured in a client-specific
ConnectionFactoryobject and transparently assigned to theConnectionobject it creates.Alternatively, a client can set a connection's client identifier using a provider-specific value. The facility to set a connection's client identifier explicitly is not a mechanism for overriding the identifier that has been administratively configured. It is provided for the case where no administratively specified identifier exists. If one does exist, an attempt to change it by setting it must throw an
IllegalStateException. If a client sets the client identifier explicitly, it must do so immediately after it creates the connection and before any other action on the connection is taken. After this point, setting the client identifier is a programming error that should throw anIllegalStateException.The purpose of the client identifier is to associate a connection and its objects with a state maintained on behalf of the client by a provider. The only such state identified by the JMS API is that required to support durable subscriptions.
If another connection with the same
clientIDis already running when this method is called, the JMS provider should detect the duplicate ID and throw anInvalidClientIDException.- Specified by:
setClientIDin interfacejavax.jms.Connection
getMetaData
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
- Gets the metadata for this connection.
- Specified by:
getMetaDatain interfacejavax.jms.Connection
getExceptionListener
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
- Gets the
ExceptionListenerobject for this connection. Not everyConnectionhas anExceptionListenerassociated with it.- Specified by:
getExceptionListenerin interfacejavax.jms.Connection
setExceptionListener
public void setExceptionListener(javax.jms.ExceptionListener listener) throws javax.jms.JMSException
- Sets an exception listener for this connection.
If a JMS provider detects a serious problem with a connection, it informs the connection's
ExceptionListener, if one has been registered. It does this by calling the listener'sonExceptionmethod, passing it aJMSExceptionobject describing the problem.An exception listener allows a client to be notified of a problem asynchronously. Some connections only consume messages, so they would have no other way to learn their connection has failed.
A connection serializes execution of its
ExceptionListener.A JMS provider should attempt to resolve connection problems itself before it notifies the client of them.
- Specified by:
setExceptionListenerin interfacejavax.jms.Connection
start
public void start()
throws javax.jms.JMSException
- Starts (or restarts) a connection's delivery of incoming messages. A call
to
starton a connection that has already been started is ignored.- Specified by:
startin interfacejavax.jms.Connection
isStarted
protected boolean isStarted()
stop
public void stop()
throws javax.jms.JMSException
- Temporarily stops a connection's delivery of incoming messages. Delivery
can be restarted using the connection's
startmethod. When the connection is stopped, delivery to all the connection's message consumers is inhibited: synchronous receives block, and messages are not delivered to message listeners.This call blocks until receives and/or message listeners in progress have completed.
Stopping a connection has no effect on its ability to send messages. A call to
stopon a connection that has already been stopped is ignored.A call to
stopmust not return until delivery of messages has paused. This means that a client can rely on the fact that none of its message listeners will be called and that all threads of control waiting forreceivecalls to return will not return with a message until the connection is restarted. The receive timers for a stopped connection continue to advance, so receives may time out while the connection is stopped.If message listeners are running when
stopis invoked, thestopcall must wait until all of them have returned before it may return. While these message listeners are completing, they must have the full services of the connection available to them.- Specified by:
stopin interfacejavax.jms.Connection
close
public void close()
throws javax.jms.JMSException
- Closes the connection.
Since a provider typically allocates significant resources outside the JVM on behalf of a connection, clients should close these resources when they are not needed. Relying on garbage collection to eventually reclaim these resources may not be timely enough.
There is no need to close the sessions, producers, and consumers of a closed connection.
Closing a connection causes all temporary destinations to be deleted.
When this method is invoked, it should not return until message processing has been shut down in an orderly fashion. This means that all message listeners that may have been running have returned, and that all pending receives have returned. A close terminates all pending message receives on the connection's sessions' consumers. The receives may return with a message or with null, depending on whether there was a message available at the time of the close. If one or more of the connection's sessions' message listeners is processing a message at the time when connection
closeis invoked, all the facilities of the connection and its sessions must remain available to those listeners until they return control to the JMS provider.Closing a connection causes any of its sessions' transactions in progress to be rolled back. In the case where a session's work is coordinated by an external transaction manager, a session's
commitandrollbackmethods are not used and the result of a closed session's work is determined later by the transaction manager. Closing a connection does NOT force an acknowledgment of client-acknowledged sessions.Invoking the
acknowledgemethod of a received message from a closed connection's session must throw anIllegalStateException. Closing a closed connection must NOT throw an exception.- Specified by:
closein interfacejavax.jms.Connection
terminateBrokerVM
public void terminateBrokerVM()
throws javax.jms.JMSException
- Tells the broker to terminate its VM. This can be used to cleanly terminate a broker running in
a standalone java process. Server must have property enable.vm.shutdown=true defined
to allow this to work.
checkClosed
protected void checkClosed()
throws javax.jms.JMSException
- simply throws an exception if the Connection is already closed
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
- Creates a connection consumer for this connection (optional operation).
This is an expert facility not used by regular JMS clients.
- Specified by:
createConnectionConsumerin interfacejavax.jms.Connection
- Since:
- 1.1
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws javax.jms.JMSException
- Creates a connection consumer for this connection (optional operation).
This is an expert facility not used by regular JMS clients.
- Since:
- 1.1
createDurableConnectionConsumer
public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
- Create a durable connection consumer for this connection (optional
operation). This is an expert facility not used by regular JMS clients.
- Specified by:
createDurableConnectionConsumerin interfacejavax.jms.Connection
- Since:
- 1.1
createDurableConnectionConsumer
public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String subscriptionName, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages, boolean noLocal) throws javax.jms.JMSException
- Create a durable connection consumer for this connection (optional
operation). This is an expert facility not used by regular JMS clients.
- Since:
- 1.1
consume
public void consume(org.activemq.message.Packet packet)
- Implementation of the PacketListener interface - consume a packet
- Specified by:
consumein interfaceorg.activemq.message.PacketListener
assembleMessage
private final org.activemq.message.ActiveMQMessage assembleMessage(org.activemq.message.ActiveMQMessage message)
onException
public void onException(javax.jms.JMSException jmsEx)
- Specified by:
onExceptionin interfacejavax.jms.ExceptionListener
createTopicSession
public javax.jms.TopicSession createTopicSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
- Creates a
TopicSessionobject.- Specified by:
createTopicSessionin interfacejavax.jms.TopicConnection
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
- Creates a connection consumer for this connection (optional operation).
This is an expert facility not used by regular JMS clients.
- Specified by:
createConnectionConsumerin interfacejavax.jms.TopicConnection
createQueueSession
public javax.jms.QueueSession createQueueSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException
- Creates a
QueueSessionobject.- Specified by:
createQueueSessionin interfacejavax.jms.QueueConnection
createConnectionConsumer
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue, java.lang.String messageSelector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
JAVADOC
org.activemq.ActiveMQConnection