Package bitronix.tm.resource.jms
Class JmsPooledConnection
java.lang.Object
bitronix.tm.resource.common.AbstractXAStatefulHolder
bitronix.tm.resource.jms.JmsPooledConnection
- All Implemented Interfaces:
XAStatefulHolder,JmsPooledConnectionMBean
public class JmsPooledConnection
extends AbstractXAStatefulHolder
implements JmsPooledConnectionMBean
Implementation of a JMS pooled connection wrapping vendor's
XAConnection implementation.- Author:
- lorban TODO: how can the JMS connection be accurately tested?
-
Field Summary
Fields inherited from interface bitronix.tm.resource.common.XAStatefulHolder
STATE_ACCESSIBLE, STATE_CLOSED, STATE_IN_POOL, STATE_NOT_ACCESSIBLE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJmsPooledConnection(PoolingConnectionFactory poolingConnectionFactory, javax.jms.XAConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the physical connection that thisXAStatefulHolderrepresents.protected javax.jms.SessioncreateSession(boolean transacted, int acknowledgeMode) Create a disposable handler used to drive a pooled instance ofXAStatefulHolder.Get the date at which this object was last released to the pool.javax.jms.XAConnectionGet the list ofXAResourceHolders created by thisXAStatefulHolderthat are still open.protected voidrelease()toString()Methods inherited from class bitronix.tm.resource.common.AbstractXAStatefulHolder
addStateChangeEventListener, getState, removeStateChangeEventListener, setState
-
Constructor Details
-
JmsPooledConnection
protected JmsPooledConnection(PoolingConnectionFactory poolingConnectionFactory, javax.jms.XAConnection connection)
-
-
Method Details
-
getXAConnection
public javax.jms.XAConnection getXAConnection() -
getPoolingConnectionFactory
-
createRecoveryXAResourceHolder
- Throws:
javax.jms.JMSException
-
close
public void close() throws javax.jms.JMSExceptionDescription copied from interface:XAStatefulHolderClose the physical connection that thisXAStatefulHolderrepresents.- Specified by:
closein interfaceXAStatefulHolder- Throws:
javax.jms.JMSException
-
getXAResourceHolders
Description copied from interface:XAStatefulHolderGet the list ofXAResourceHolders created by thisXAStatefulHolderthat are still open.This method is thread-safe.
- Specified by:
getXAResourceHoldersin interfaceXAStatefulHolder- Returns:
- the list of
XAResourceHolders created by thisXAStatefulHolderthat are still open.
-
getConnectionHandle
Description copied from interface:XAStatefulHolderCreate a disposable handler used to drive a pooled instance ofXAStatefulHolder.This method is thread-safe.
- Specified by:
getConnectionHandlein interfaceXAStatefulHolder- Returns:
- a resource-specific disaposable connection object.
- Throws:
Exception- a resource-specific exception thrown when the disaposable connection cannot be created.
-
release
protected void release() throws javax.jms.JMSException- Throws:
javax.jms.JMSException
-
createSession
protected javax.jms.Session createSession(boolean transacted, int acknowledgeMode) throws javax.jms.JMSException - Throws:
javax.jms.JMSException
-
getLastReleaseDate
Description copied from interface:XAStatefulHolderGet the date at which this object was last released to the pool. This is required to check if it is eligible for discard when the containing pool needs to shrink.- Specified by:
getLastReleaseDatein interfaceXAStatefulHolder- Returns:
- the date at which this object was last released to the pool or null if it never left the pool.
-
toString
-
getStateDescription
- Specified by:
getStateDescriptionin interfaceJmsPooledConnectionMBean
-
getAcquisitionDate
- Specified by:
getAcquisitionDatein interfaceJmsPooledConnectionMBean
-
getTransactionGtridsCurrentlyHoldingThis
- Specified by:
getTransactionGtridsCurrentlyHoldingThisin interfaceJmsPooledConnectionMBean
-