
public class TransactionSynchronizer
extends java.lang.Object
implements javax.transaction.Synchronization
This class exists to make sure all Tx synchronizations are invoked before the cached connection manager closes any closed connections.
| Modifier and Type | Method and Description |
|---|---|
void |
addEnlisted(javax.transaction.Synchronization synch)
The synchronization is now enlisted
|
void |
addUnenlisted(javax.transaction.Synchronization synch)
Add a new Tx synchronization that has not been enlisted
|
void |
afterCompletion(int status) |
void |
beforeCompletion() |
void |
enlisted()
This thread has finished enlisting.
|
static javax.transaction.Synchronization |
getCCMSynchronization(javax.transaction.Transaction tx,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
Check whether we have a CCM synchronization
|
static TransactionSynchronizer |
getRegisteredSynchronizer(javax.transaction.Transaction tx,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
Get a registered transaction synchronizer.
|
java.util.List<javax.transaction.Synchronization> |
getUnenlisted()
Get the unenlisted synchronizations
and say we are enlisting if some are returned.
|
protected void |
invokeAfter(javax.transaction.Synchronization synch,
int status)
Invoke an afterCompletion
|
protected void |
invokeBefore(javax.transaction.Synchronization synch)
Invoke a beforeCompletion
|
static void |
lock(javax.transaction.Transaction tx,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
Lock for the given transaction
|
static void |
registerCCMSynchronization(javax.transaction.Transaction tx,
javax.transaction.Synchronization synch,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
Register a new CCM synchronization
|
boolean |
removeEnlisted(javax.transaction.Synchronization synch)
Remove an enlisted synchronization
|
static void |
unlock(javax.transaction.Transaction tx,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
Unlock for the given transaction
|
public void addUnenlisted(javax.transaction.Synchronization synch)
synch - the synchronizationpublic java.util.List<javax.transaction.Synchronization> getUnenlisted()
public void addEnlisted(javax.transaction.Synchronization synch)
synch - the synchronizationpublic boolean removeEnlisted(javax.transaction.Synchronization synch)
synch - the synchronizationpublic void enlisted()
public static TransactionSynchronizer getRegisteredSynchronizer(javax.transaction.Transaction tx, org.jboss.jca.core.spi.transaction.TransactionIntegration ti) throws javax.transaction.SystemException, javax.transaction.RollbackException
tx - the transactionti - the transaction integrationjavax.transaction.SystemException - sys. exceptionjavax.transaction.RollbackException - rollback exceptionpublic static javax.transaction.Synchronization getCCMSynchronization(javax.transaction.Transaction tx,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
tx - the transactionti - the transaction integrationpublic static void registerCCMSynchronization(javax.transaction.Transaction tx,
javax.transaction.Synchronization synch,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
throws java.lang.Exception
tx - the transactionsynch - the synchronizationti - the transaction integrationjava.lang.Exception - epublic static void lock(javax.transaction.Transaction tx,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
throws javax.transaction.SystemException,
javax.transaction.RollbackException
tx - the transactionti - the transaction integrationjavax.transaction.SystemException - sys. exceptionjavax.transaction.RollbackException - rollback exceptionpublic static void unlock(javax.transaction.Transaction tx,
org.jboss.jca.core.spi.transaction.TransactionIntegration ti)
tx - the transactionti - the transaction integrationpublic void beforeCompletion()
beforeCompletion in interface javax.transaction.Synchronizationpublic void afterCompletion(int status)
afterCompletion in interface javax.transaction.Synchronizationprotected void invokeBefore(javax.transaction.Synchronization synch)
synch - the synchronizationprotected void invokeAfter(javax.transaction.Synchronization synch,
int status)
synch - the synchronizationstatus - the status of the transactionCopyright © 2014 IronJacamar (http://www.ironjacamar.org)