| org.jboss.resource.connectionmanager.BaseConnectionManager2 org.jboss.resource.connectionmanager.TxConnectionManager
TxConnectionManager | public class TxConnectionManager extends BaseConnectionManager2 implements TxConnectionManagerMBean(Code) | | The TxConnectionManager is a JBoss ConnectionManager
implementation for jca adapters implementing LocalTransaction and XAResource support.
It implements a ConnectionEventListener that implements XAResource to
manage transactions through the Transaction Manager. To assure that all
work in a local transaction occurs over the same ManagedConnection, it
includes a xid to ManagedConnection map. When a Connection is requested
or a transaction started with a connection handle in use, it checks to
see if a ManagedConnection already exists enrolled in the global
transaction and uses it if found. Otherwise a free ManagedConnection
has its LocalTransaction started and is used. From the
BaseConnectionManager2, it includes functionality to obtain managed
connections from
a ManagedConnectionPool mbean, find the Subject from a SubjectSecurityDomain,
and interact with the CachedConnectionManager for connections held over
transaction and method boundaries. Important mbean references are to a
ManagedConnectionPool supplier (typically a JBossManagedConnectionPool), and a
RARDeployment representing the ManagedConnectionFactory.
This connection manager has to perform the following operations:
1. When an application component requests a new ConnectionHandle,
it must find a ManagedConnection, and make sure a
ConnectionEventListener is registered. It must inform the
CachedConnectionManager that a connection handle has been given
out. It needs to count the number of handles for each
ManagedConnection. If there is a current transaction, it must
enlist the ManagedConnection's LocalTransaction in the transaction
using the ConnectionEventListeners XAResource XAResource implementation.
Entry point: ConnectionManager.allocateConnection.
written.
2. When a ConnectionClosed event is received from the
ConnectionEventListener, it must reduce the handle count. If
the handle count is zero, the XAResource should be delisted from
the Transaction, if any. The CachedConnectionManager must be
notified that the connection is closed.
Entry point: ConnectionEventListener.ConnectionClosed.
written
3. When a transaction begun notification is received from the
UserTransaction (via the CachedConnectionManager, all
managedConnections associated with the current object must be
enlisted in the transaction.
Entry point: (from
CachedConnectionManager)
ConnectionCacheListener.transactionStarted(Transaction,
Collection). The collection is of ConnectionRecord objects.
written.
5. When an "entering object" notification is received from the
CachedConnectionInterceptor, all the connections for the current
object must be associated with a ManagedConnection. if there is a
Transaction, the XAResource must be enlisted with it.
Entry point: ConnectionCacheListener.reconnect(Collection conns) The Collection
is of ConnectionRecord objects.
written.
6. When a "leaving object" notification is received from the
CachedConnectionInterceptor, all the managedConnections for the
current object must have their XAResources delisted from the
current Transaction, if any, and cleanup called on each
ManagedConnection.
Entry point: ConnectionCacheListener.disconnect(Collection conns).
written.
author: David Jencks author: Adrian Brock version: $Revision: 59870 $ |
TxConnectionManager | public TxConnectionManager()(Code) | | Default managed TxConnectionManager constructor for mbean instances.
|
TxConnectionManager | public TxConnectionManager(CachedConnectionManager ccm, ManagedConnectionPool poolingStrategy, TransactionManager tm)(Code) | | Creates a new TxConnectionManager instance.
for TESTING ONLY!!! not a managed constructor!!
Parameters: ccm - a CachedConnectionManager value Parameters: poolingStrategy - a ManagedConnectionPool value Parameters: tm - a TransactionManager value |
getIsSameRMOverrideValue | public Boolean getIsSameRMOverrideValue()(Code) | | |
getTimeLeftBeforeTransactionTimeout | public long getTimeLeftBeforeTransactionTimeout(boolean errorRollback) throws RollbackException(Code) | | |
getTransactionManager | public String getTransactionManager()(Code) | | |
getTransactionManagerInstance | public TransactionManager getTransactionManagerInstance()(Code) | | |
getTransactionManagerService | public ObjectName getTransactionManagerService()(Code) | | |
getXAResourceTransactionTimeout | public int getXAResourceTransactionTimeout()(Code) | | |
isLocalTransactions | public boolean isLocalTransactions()(Code) | | |
isTrackConnectionByTx | public boolean isTrackConnectionByTx()(Code) | | |
isTransactional | public boolean isTransactional()(Code) | | |
managedConnectionDisconnected | protected void managedConnectionDisconnected(ConnectionListener cl) throws ResourceException(Code) | | |
managedConnectionReconnected | protected void managedConnectionReconnected(ConnectionListener cl) throws ResourceException(Code) | | |
rethrowAsSystemException | protected static void rethrowAsSystemException(String context, Transaction tx, Throwable t) throws SystemException(Code) | | |
setIsSameRMOverrideValue | public void setIsSameRMOverrideValue(Boolean isSameRMOverride)(Code) | | |
setLocalTransactions | public void setLocalTransactions(boolean localTransactions)(Code) | | |
setTrackConnectionByTx | public void setTrackConnectionByTx(boolean trackConnectionByTx)(Code) | | |
setTransactionManager | public void setTransactionManager(String tmName)(Code) | | |
setTransactionManagerInstance | public void setTransactionManagerInstance(TransactionManager tm)(Code) | | |
setTransactionManagerService | public void setTransactionManagerService(ObjectName transactionManagerService)(Code) | | |
setXAResourceTransactionTimeout | public void setXAResourceTransactionTimeout(int timeout)(Code) | | |
transactionStarted | public void transactionStarted(Collection crs) throws SystemException(Code) | | |
|
|