org.apache.activemq.pool
public class PooledConnection extends java.lang.Object implements javax.jms.TopicConnection, javax.jms.QueueConnection, EnhancedConnection
Connection
which is-a TopicConnection
and
QueueConnection
which is pooled and on close()
will return
itself to the sessionPool.
NOTE this implementation is only intended for use when sending
messages. It does not deal with pooling of consumers; for that look at a
library like Jencks such as in this exampleConstructor and Description |
---|
PooledConnection(ConnectionPool pool) |
Modifier and Type | Method and Description |
---|---|
protected void |
assertNotClosed() |
protected void |
cleanupConnectionTemporaryDestinations()
Remove all of the temporary destinations created for this connection.
|
void |
close()
Closes a JMS object.
|
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
java.lang.String selector,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Queue queue,
java.lang.String selector,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Topic topic,
java.lang.String s,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
java.lang.String selector,
java.lang.String s1,
javax.jms.ServerSessionPool serverSessionPool,
int i) |
javax.jms.QueueSession |
createQueueSession(boolean transacted,
int ackMode) |
javax.jms.Session |
createSession(boolean transacted,
int ackMode) |
protected ActiveMQSession |
createSession(SessionKey key) |
javax.jms.TopicSession |
createTopicSession(boolean transacted,
int ackMode) |
java.lang.String |
getClientID() |
ActiveMQConnection |
getConnection() |
DestinationSource |
getDestinationSource()
Returns the
DestinationSource object which can be used to listen to destinations
being created or destroyed or to enquire about the current destinations available on the broker |
javax.jms.ExceptionListener |
getExceptionListener() |
javax.jms.ConnectionMetaData |
getMetaData() |
PooledConnection |
newInstance()
Factory method to create a new instance.
|
void |
setClientID(java.lang.String clientID) |
void |
setExceptionListener(javax.jms.ExceptionListener exceptionListener) |
void |
start() |
void |
stop() |
java.lang.String |
toString() |
public PooledConnection(ConnectionPool pool)
public PooledConnection newInstance()
public void close() throws javax.jms.JMSException
Closeable
Many JMS objects are closeable such as Connections, Sessions, Consumers and Producers.
public void start() throws javax.jms.JMSException
start
in interface javax.jms.Connection
javax.jms.JMSException
public void stop() throws javax.jms.JMSException
stop
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String selector, javax.jms.ServerSessionPool serverSessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic, java.lang.String s, javax.jms.ServerSessionPool serverSessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.TopicConnection
javax.jms.JMSException
public javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic, java.lang.String selector, java.lang.String s1, javax.jms.ServerSessionPool serverSessionPool, int i) throws javax.jms.JMSException
createDurableConnectionConsumer
in interface javax.jms.Connection
createDurableConnectionConsumer
in interface javax.jms.TopicConnection
javax.jms.JMSException
public java.lang.String getClientID() throws javax.jms.JMSException
getClientID
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ExceptionListener getExceptionListener() throws javax.jms.JMSException
getExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionMetaData getMetaData() throws javax.jms.JMSException
getMetaData
in interface javax.jms.Connection
javax.jms.JMSException
public void setExceptionListener(javax.jms.ExceptionListener exceptionListener) throws javax.jms.JMSException
setExceptionListener
in interface javax.jms.Connection
javax.jms.JMSException
public void setClientID(java.lang.String clientID) throws javax.jms.JMSException
setClientID
in interface javax.jms.Connection
javax.jms.JMSException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue, java.lang.String selector, javax.jms.ServerSessionPool serverSessionPool, int maxMessages) throws javax.jms.JMSException
createConnectionConsumer
in interface javax.jms.QueueConnection
javax.jms.JMSException
public javax.jms.QueueSession createQueueSession(boolean transacted, int ackMode) throws javax.jms.JMSException
createQueueSession
in interface javax.jms.QueueConnection
javax.jms.JMSException
public javax.jms.TopicSession createTopicSession(boolean transacted, int ackMode) throws javax.jms.JMSException
createTopicSession
in interface javax.jms.TopicConnection
javax.jms.JMSException
public javax.jms.Session createSession(boolean transacted, int ackMode) throws javax.jms.JMSException
createSession
in interface javax.jms.Connection
javax.jms.JMSException
public DestinationSource getDestinationSource() throws javax.jms.JMSException
EnhancedConnection
DestinationSource
object which can be used to listen to destinations
being created or destroyed or to enquire about the current destinations available on the brokergetDestinationSource
in interface EnhancedConnection
javax.jms.JMSException
public ActiveMQConnection getConnection() throws javax.jms.JMSException
javax.jms.JMSException
protected void assertNotClosed() throws AlreadyClosedException
AlreadyClosedException
protected ActiveMQSession createSession(SessionKey key) throws javax.jms.JMSException
javax.jms.JMSException
public java.lang.String toString()
toString
in class java.lang.Object
protected void cleanupConnectionTemporaryDestinations()
Copyright © 2005-2014. All Rights Reserved.