public class JmsPoolConnection extends Object implements javax.jms.TopicConnection, javax.jms.QueueConnection, JmsPoolSessionEventListener, AutoCloseable
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.| Modifier and Type | Field and Description |
|---|---|
protected PooledConnection |
connection |
| Constructor and Description |
|---|
JmsPoolConnection(PooledConnection pool)
Creates a new PooledConnection instance that uses the given ConnectionPool to create
and manage its resources.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkClosed() |
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() |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
String selector,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Queue queue,
String selector,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Topic topic,
String s,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createDurableConnectionConsumer(javax.jms.Topic topic,
String selector,
String s1,
javax.jms.ServerSessionPool serverSessionPool,
int i) |
javax.jms.QueueSession |
createQueueSession(boolean transacted,
int ackMode) |
javax.jms.Session |
createSession() |
javax.jms.Session |
createSession(boolean transacted,
int ackMode) |
javax.jms.Session |
createSession(int sessionMode) |
javax.jms.ConnectionConsumer |
createSharedConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String selector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
javax.jms.ConnectionConsumer |
createSharedDurableConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String selector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages) |
javax.jms.TopicSession |
createTopicSession(boolean transacted,
int ackMode) |
String |
getClientID() |
javax.jms.Connection |
getConnection() |
javax.jms.ExceptionListener |
getExceptionListener() |
javax.jms.ConnectionMetaData |
getMetaData() |
int |
getNumActiveSessions() |
int |
getNumSessions() |
int |
getNumtIdleSessions() |
void |
onSessionClosed(JmsPoolSession session)
Called when the PooledSession is closed.
|
void |
onTemporaryQueueCreate(javax.jms.TemporaryQueue tempQueue)
Called on successful creation of a new TemporaryQueue.
|
void |
onTemporaryTopicCreate(javax.jms.TemporaryTopic tempTopic)
Called on successful creation of a new TemporaryTopic.
|
void |
setClientID(String clientID) |
void |
setExceptionListener(javax.jms.ExceptionListener exceptionListener) |
void |
start() |
void |
stop() |
String |
toString() |
protected PooledConnection connection
public JmsPoolConnection(PooledConnection pool)
pool - The connection and pool manager backing this proxy connection object.public void close()
throws javax.jms.JMSException
close in interface AutoCloseableclose in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic void start()
throws javax.jms.JMSException
start in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic void stop()
throws javax.jms.JMSException
stop in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionMetaData getMetaData()
throws javax.jms.JMSException
getMetaData in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ExceptionListener getExceptionListener()
throws javax.jms.JMSException
getExceptionListener in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic void setExceptionListener(javax.jms.ExceptionListener exceptionListener)
throws javax.jms.JMSException
setExceptionListener in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic String getClientID() throws javax.jms.JMSException
getClientID in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic void setClientID(String clientID) throws javax.jms.JMSException
setClientID in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination,
String selector,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages)
throws javax.jms.JMSException
createConnectionConsumer in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Topic topic,
String s,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages)
throws javax.jms.JMSException
createConnectionConsumer in interface javax.jms.TopicConnectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createDurableConnectionConsumer(javax.jms.Topic topic,
String selector,
String s1,
javax.jms.ServerSessionPool serverSessionPool,
int i)
throws javax.jms.JMSException
createDurableConnectionConsumer in interface javax.jms.ConnectioncreateDurableConnectionConsumer in interface javax.jms.TopicConnectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createSharedDurableConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String selector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createSharedDurableConnectionConsumer in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createSharedConnectionConsumer(javax.jms.Topic topic,
String subscriptionName,
String selector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
throws javax.jms.JMSException
createSharedConnectionConsumer in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Queue queue,
String selector,
javax.jms.ServerSessionPool serverSessionPool,
int maxMessages)
throws javax.jms.JMSException
createConnectionConsumer in interface javax.jms.QueueConnectionjavax.jms.JMSExceptionpublic javax.jms.QueueSession createQueueSession(boolean transacted,
int ackMode)
throws javax.jms.JMSException
createQueueSession in interface javax.jms.QueueConnectionjavax.jms.JMSExceptionpublic javax.jms.TopicSession createTopicSession(boolean transacted,
int ackMode)
throws javax.jms.JMSException
createTopicSession in interface javax.jms.TopicConnectionjavax.jms.JMSExceptionpublic javax.jms.Session createSession()
throws javax.jms.JMSException
createSession in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.Session createSession(int sessionMode)
throws javax.jms.JMSException
createSession in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic javax.jms.Session createSession(boolean transacted,
int ackMode)
throws javax.jms.JMSException
createSession in interface javax.jms.Connectionjavax.jms.JMSExceptionpublic void onTemporaryQueueCreate(javax.jms.TemporaryQueue tempQueue)
JmsPoolSessionEventListeneronTemporaryQueueCreate in interface JmsPoolSessionEventListenertempQueue - The TemporaryQueue just created.public void onTemporaryTopicCreate(javax.jms.TemporaryTopic tempTopic)
JmsPoolSessionEventListeneronTemporaryTopicCreate in interface JmsPoolSessionEventListenertempTopic - The TemporaryTopic just created.public void onSessionClosed(JmsPoolSession session)
JmsPoolSessionEventListeneronSessionClosed in interface JmsPoolSessionEventListenersession - The PooledSession that has been closed.public javax.jms.Connection getConnection()
throws javax.jms.JMSException
javax.jms.JMSExceptionprotected void cleanupConnectionTemporaryDestinations()
protected void cleanupAllLoanedSessions()
public int getNumSessions()
throws javax.jms.JMSException
javax.jms.JMSException - if the connection has been closed.public int getNumActiveSessions()
throws javax.jms.JMSException
javax.jms.JMSException - if the connection has been closed.public int getNumtIdleSessions()
throws javax.jms.JMSException
javax.jms.JMSException - if the connection has been closed.protected void checkClosed()
throws javax.jms.IllegalStateException
javax.jms.IllegalStateExceptionCopyright © 2017–2019. All rights reserved.