|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.pool.PooledConnection
public class PooledConnection
Represents a proxy 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 example
Constructor Summary | |
---|---|
PooledConnection(ConnectionPool pool)
|
Method Summary | |
---|---|
protected void |
assertNotClosed()
|
void |
close()
Closes a JMS object. |
ConnectionConsumer |
createConnectionConsumer(Destination destination,
String selector,
ServerSessionPool serverSessionPool,
int maxMessages)
|
ConnectionConsumer |
createConnectionConsumer(Queue queue,
String selector,
ServerSessionPool serverSessionPool,
int maxMessages)
|
ConnectionConsumer |
createConnectionConsumer(Topic topic,
String s,
ServerSessionPool serverSessionPool,
int maxMessages)
|
ConnectionConsumer |
createDurableConnectionConsumer(Topic topic,
String selector,
String s1,
ServerSessionPool serverSessionPool,
int i)
|
QueueSession |
createQueueSession(boolean transacted,
int ackMode)
|
Session |
createSession(boolean transacted,
int ackMode)
|
protected ActiveMQSession |
createSession(SessionKey key)
|
TopicSession |
createTopicSession(boolean transacted,
int ackMode)
|
String |
getClientID()
|
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 |
ExceptionListener |
getExceptionListener()
|
ConnectionMetaData |
getMetaData()
|
PooledConnection |
newInstance()
Factory method to create a new instance. |
void |
setClientID(String clientID)
|
void |
setExceptionListener(ExceptionListener exceptionListener)
|
void |
start()
|
void |
stop()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PooledConnection(ConnectionPool pool)
Method Detail |
---|
public PooledConnection newInstance()
public void close() throws JMSException
Closeable
Many JMS objects are closeable such as Connections, Sessions, Consumers and Producers.
close
in interface Connection
close
in interface Closeable
JMSException
- if the JMS provider fails to close the object due to
some internal error.public void start() throws JMSException
start
in interface Connection
JMSException
public void stop() throws JMSException
stop
in interface Connection
JMSException
public ConnectionConsumer createConnectionConsumer(Destination destination, String selector, ServerSessionPool serverSessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface Connection
JMSException
public ConnectionConsumer createConnectionConsumer(Topic topic, String s, ServerSessionPool serverSessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface TopicConnection
JMSException
public ConnectionConsumer createDurableConnectionConsumer(Topic topic, String selector, String s1, ServerSessionPool serverSessionPool, int i) throws JMSException
createDurableConnectionConsumer
in interface Connection
createDurableConnectionConsumer
in interface TopicConnection
JMSException
public String getClientID() throws JMSException
getClientID
in interface Connection
JMSException
public ExceptionListener getExceptionListener() throws JMSException
getExceptionListener
in interface Connection
JMSException
public ConnectionMetaData getMetaData() throws JMSException
getMetaData
in interface Connection
JMSException
public void setExceptionListener(ExceptionListener exceptionListener) throws JMSException
setExceptionListener
in interface Connection
JMSException
public void setClientID(String clientID) throws JMSException
setClientID
in interface Connection
JMSException
public ConnectionConsumer createConnectionConsumer(Queue queue, String selector, ServerSessionPool serverSessionPool, int maxMessages) throws JMSException
createConnectionConsumer
in interface QueueConnection
JMSException
public QueueSession createQueueSession(boolean transacted, int ackMode) throws JMSException
createQueueSession
in interface QueueConnection
JMSException
public TopicSession createTopicSession(boolean transacted, int ackMode) throws JMSException
createTopicSession
in interface TopicConnection
JMSException
public Session createSession(boolean transacted, int ackMode) throws JMSException
createSession
in interface Connection
JMSException
public DestinationSource getDestinationSource() throws 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 broker
getDestinationSource
in interface EnhancedConnection
JMSException
protected void assertNotClosed() throws AlreadyClosedException
AlreadyClosedException
protected ActiveMQSession createSession(SessionKey key) throws JMSException
JMSException
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |