Package bitronix.tm.resource.messaging
Class MessagingPooledConnection
java.lang.Object
bitronix.tm.resource.common.AbstractXAStatefulHolder
bitronix.tm.resource.messaging.MessagingPooledConnection
- All Implemented Interfaces:
XAStatefulHolder,MessagingPooledConnectionMBean
public class MessagingPooledConnection
extends AbstractXAStatefulHolder
implements MessagingPooledConnectionMBean
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
ConstructorsModifierConstructorDescriptionprotectedMessagingPooledConnection(PoolingConnectionFactory poolingConnectionFactory, jakarta.jms.XAConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the physical connection that thisXAStatefulHolderrepresents.protected jakarta.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.jakarta.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
-
MessagingPooledConnection
protected MessagingPooledConnection(PoolingConnectionFactory poolingConnectionFactory, jakarta.jms.XAConnection connection)
-
-
Method Details
-
getXAConnection
public jakarta.jms.XAConnection getXAConnection() -
getPoolingConnectionFactory
-
createRecoveryXAResourceHolder
- Throws:
jakarta.jms.JMSException
-
close
public void close() throws jakarta.jms.JMSExceptionDescription copied from interface:XAStatefulHolderClose the physical connection that thisXAStatefulHolderrepresents.- Specified by:
closein interfaceXAStatefulHolder- Throws:
jakarta.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 jakarta.jms.JMSException- Throws:
jakarta.jms.JMSException
-
createSession
protected jakarta.jms.Session createSession(boolean transacted, int acknowledgeMode) throws jakarta.jms.JMSException - Throws:
jakarta.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 interfaceMessagingPooledConnectionMBean
-
getAcquisitionDate
- Specified by:
getAcquisitionDatein interfaceMessagingPooledConnectionMBean
-
getTransactionGtridsCurrentlyHoldingThis
- Specified by:
getTransactionGtridsCurrentlyHoldingThisin interfaceMessagingPooledConnectionMBean
-