public class PooledConnection extends Object implements javax.jms.ExceptionListener
Instances of this class are shared amongst one or more PooledConnection object and must track the session objects that are loaned out for cleanup on close as well as ensuring that the temporary destinations of the managed Connection are purged when all references to this ConnectionPool are released.
| Modifier and Type | Field and Description |
|---|---|
protected javax.jms.Connection |
connection |
| Constructor and Description |
|---|
PooledConnection(javax.jms.Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkClientJMSVersionSupport(int requiredMajor,
int requiredMinor) |
void |
checkClientJMSVersionSupport(int requiredMajor,
int requiredMinor,
boolean runtimeEx) |
void |
close() |
javax.jms.Session |
createSession(boolean transacted,
int ackMode) |
void |
decrementReferenceCount() |
boolean |
expiredCheck()
Determines if this Connection has expired.
|
long |
getBlockIfSessionPoolIsFullTimeout()
Returns the timeout to use for blocking creating new sessions
|
javax.jms.Connection |
getConnection() |
int |
getExplicitProducerCacheSize() |
int |
getIdleTimeout() |
int |
getMaxSessionsPerConnection() |
int |
getNumActiveSessions() |
int |
getNumIdleSessions() |
int |
getNumSessions() |
javax.jms.ExceptionListener |
getParentExceptionListener() |
void |
incrementReferenceCount() |
boolean |
isBlockIfSessionPoolIsFull() |
boolean |
isJMSVersionSupported(int requiredMajor,
int requiredMinor)
Checks for JMS version support in the underlying JMS Connection this pooled connection
wrapper encapsulates.
|
boolean |
isUseAnonymousProducers() |
protected javax.jms.Session |
makeSession(PooledSessionKey key) |
void |
onException(javax.jms.JMSException exception) |
void |
setBlockIfSessionPoolIsFull(boolean block)
Configure whether the createSession method should block when there are no more idle sessions and the
pool already contains the maximum number of active sessions.
|
void |
setBlockIfSessionPoolIsFullTimeout(long blockIfSessionPoolIsFullTimeout)
Controls the behavior of the internal session pool.
|
void |
setExplicitProducerCacheSize(int cacheSize) |
void |
setHasExpired(boolean val) |
void |
setIdleTimeout(int idleTimeout) |
void |
setMaxSessionsPerConnection(int maActiveSessionsPerConnection) |
void |
setParentExceptionListener(javax.jms.ExceptionListener parentExceptionListener) |
void |
setUseAnonymousProducers(boolean value) |
void |
start() |
String |
toString() |
protected void |
unWrap(javax.jms.Connection connection) |
protected javax.jms.Connection |
wrap(javax.jms.Connection connection) |
public void setHasExpired(boolean val)
protected javax.jms.Session makeSession(PooledSessionKey key) throws javax.jms.JMSException
javax.jms.JMSExceptionprotected javax.jms.Connection wrap(javax.jms.Connection connection)
protected void unWrap(javax.jms.Connection connection)
public void start()
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic javax.jms.Connection getConnection()
public javax.jms.Session createSession(boolean transacted,
int ackMode)
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void close()
public void incrementReferenceCount()
public void decrementReferenceCount()
public boolean expiredCheck()
A ConnectionPool is considered expired when all references to it are released AND either the configured idleTimeout has elapsed OR the configured expiryTimeout has elapsed. Once a ConnectionPool is determined to have expired its underlying Connection is closed.
public int getIdleTimeout()
public void setIdleTimeout(int idleTimeout)
public int getMaxSessionsPerConnection()
public void setMaxSessionsPerConnection(int maActiveSessionsPerConnection)
public boolean isUseAnonymousProducers()
public void setUseAnonymousProducers(boolean value)
public int getExplicitProducerCacheSize()
public void setExplicitProducerCacheSize(int cacheSize)
public int getNumSessions()
public int getNumIdleSessions()
public int getNumActiveSessions()
public void setBlockIfSessionPoolIsFull(boolean block)
block - Indicates whether blocking should be used to wait for more space to create a session.public boolean isBlockIfSessionPoolIsFull()
public long getBlockIfSessionPoolIsFullTimeout()
setBlockIfSessionPoolIsFull(boolean)public void setBlockIfSessionPoolIsFullTimeout(long blockIfSessionPoolIsFullTimeout)
blockIfSessionPoolIsFullTimeout - - if blockIfSessionPoolIsFullTimeout is true,
then use this setting to configure how long to block before retrypublic boolean isJMSVersionSupported(int requiredMajor,
int requiredMinor)
requiredMajor - The JMS Major version required for a feature to be supported.requiredMinor - The JMS Minor version required for a feature to be supported.public javax.jms.ExceptionListener getParentExceptionListener()
public void setParentExceptionListener(javax.jms.ExceptionListener parentExceptionListener)
public void onException(javax.jms.JMSException exception)
onException in interface javax.jms.ExceptionListenerpublic void checkClientJMSVersionSupport(int requiredMajor,
int requiredMinor)
throws javax.jms.JMSException
javax.jms.JMSExceptionpublic void checkClientJMSVersionSupport(int requiredMajor,
int requiredMinor,
boolean runtimeEx)
throws javax.jms.JMSException
javax.jms.JMSExceptionCopyright © 2017–2018. All rights reserved.