|
||||||||||
| 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
its reference to the ConnectionPool backing it.
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)
Creates a new PooledConnection instance that uses the given ConnectionPool to create and manage its resources. |
|
| Method Summary | |
|---|---|
protected void |
assertNotClosed()
|
protected void |
cleanupAllLoanedSessions()
The PooledSession tracks all Sessions that it created and now we close them. |
protected void |
cleanupConnectionTemporaryDestinations()
Remove all of the temporary destinations created for this connection. |
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()
|
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 |
ExceptionListener |
getExceptionListener()
|
ConnectionMetaData |
getMetaData()
|
int |
getNumActiveSessions()
|
int |
getNumSessions()
|
int |
getNumtIdleSessions()
|
PooledConnection |
newInstance()
Factory method to create a new instance. |
void |
onSessionClosed(PooledSession session)
Called when the PooledSession is closed. |
void |
onTemporaryQueueCreate(TemporaryQueue tempQueue)
Called on successful creation of a new TemporaryQueue. |
void |
onTemporaryTopicCreate(TemporaryTopic tempTopic)
Called on successful creation of a new TemporaryTopic. |
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)
pool - The connection and pool manager backing this proxy connection object.| Method Detail |
|---|
public PooledConnection newInstance()
public void close()
throws JMSException
CloseableMany JMS objects are closeable such as Connections, Sessions, Consumers and Producers.
close in interface Connectionclose in interface CloseableJMSException - if the JMS provider fails to close the object due to
some internal error.
public void start()
throws JMSException
start in interface ConnectionJMSException
public void stop()
throws JMSException
stop in interface ConnectionJMSException
public ConnectionConsumer createConnectionConsumer(Destination destination,
String selector,
ServerSessionPool serverSessionPool,
int maxMessages)
throws JMSException
createConnectionConsumer in interface ConnectionJMSException
public ConnectionConsumer createConnectionConsumer(Topic topic,
String s,
ServerSessionPool serverSessionPool,
int maxMessages)
throws JMSException
createConnectionConsumer in interface TopicConnectionJMSException
public ConnectionConsumer createDurableConnectionConsumer(Topic topic,
String selector,
String s1,
ServerSessionPool serverSessionPool,
int i)
throws JMSException
createDurableConnectionConsumer in interface ConnectioncreateDurableConnectionConsumer in interface TopicConnectionJMSException
public String getClientID()
throws JMSException
getClientID in interface ConnectionJMSException
public ExceptionListener getExceptionListener()
throws JMSException
getExceptionListener in interface ConnectionJMSException
public ConnectionMetaData getMetaData()
throws JMSException
getMetaData in interface ConnectionJMSException
public void setExceptionListener(ExceptionListener exceptionListener)
throws JMSException
setExceptionListener in interface ConnectionJMSException
public void setClientID(String clientID)
throws JMSException
setClientID in interface ConnectionJMSException
public ConnectionConsumer createConnectionConsumer(Queue queue,
String selector,
ServerSessionPool serverSessionPool,
int maxMessages)
throws JMSException
createConnectionConsumer in interface QueueConnectionJMSException
public QueueSession createQueueSession(boolean transacted,
int ackMode)
throws JMSException
createQueueSession in interface QueueConnectionJMSException
public TopicSession createTopicSession(boolean transacted,
int ackMode)
throws JMSException
createTopicSession in interface TopicConnectionJMSException
public Session createSession(boolean transacted,
int ackMode)
throws JMSException
createSession in interface ConnectionJMSException
public DestinationSource getDestinationSource()
throws JMSException
EnhancedConnectionDestinationSource 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 EnhancedConnectionJMSExceptionpublic void onTemporaryQueueCreate(TemporaryQueue tempQueue)
tempQueue - The TemporaryQueue just created.public void onTemporaryTopicCreate(TemporaryTopic tempTopic)
tempTopic - The TemporaryTopic just created.public void onSessionClosed(PooledSession session)
session - The PooledSession that has been closed.
public ActiveMQConnection getConnection()
throws JMSException
JMSException
protected void assertNotClosed()
throws AlreadyClosedException
AlreadyClosedException
protected ActiveMQSession createSession(SessionKey key)
throws JMSException
JMSExceptionpublic String toString()
toString in class Objectprotected void cleanupConnectionTemporaryDestinations()
protected void cleanupAllLoanedSessions()
public int getNumSessions()
public int getNumActiveSessions()
public int getNumtIdleSessions()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||