
public class TransactionSynchronizer extends Object implements 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(Synchronization synch)
The synchronization is now enlisted
|
void |
addUnenlisted(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 Synchronization |
getCCMSynchronization(Transaction tx)
Check whether we have a CCM synchronization
|
static TransactionSynchronizer |
getRegisteredSynchronizer(Transaction tx,
TransactionSynchronizationRegistry tsr)
Get a registered transaction synchronizer.
|
List<Synchronization> |
getUnenlisted()
Get the unenlisted synchronizations
and say we are enlisting if some are returned.
|
protected void |
invokeAfter(Synchronization synch,
int status)
Invoke an afterCompletion
|
protected void |
invokeBefore(Synchronization synch)
Invoke a beforeCompletion
|
static void |
lock(Transaction tx,
TransactionSynchronizationRegistry tsr)
Lock for the given transaction
|
static void |
registerCCMSynchronization(Transaction tx,
Synchronization synch,
TransactionSynchronizationRegistry tsr)
Register a new CCM synchronization
|
boolean |
removeEnlisted(Synchronization synch)
Remove an enlisted synchronization
|
static void |
unlock(Transaction tx)
Unlock for the given transaction
|
public void addUnenlisted(Synchronization synch)
synch - the synchronizationpublic List<Synchronization> getUnenlisted()
public void addEnlisted(Synchronization synch)
synch - the synchronizationpublic boolean removeEnlisted(Synchronization synch)
synch - the synchronizationpublic void enlisted()
public static TransactionSynchronizer getRegisteredSynchronizer(Transaction tx, TransactionSynchronizationRegistry tsr) throws SystemException, RollbackException
tx - the transactiontsr - the transaction synchronization registrySystemException - sys. exceptionRollbackException - rollback exceptionpublic static Synchronization getCCMSynchronization(Transaction tx)
tx - the transactionpublic static void registerCCMSynchronization(Transaction tx, Synchronization synch, TransactionSynchronizationRegistry tsr) throws Exception
tx - the transactionsynch - the synchronizationtsr - the transaction synchronization registryException - epublic static void lock(Transaction tx, TransactionSynchronizationRegistry tsr) throws SystemException, RollbackException
tx - the transactiontsr - the transaction synchronization registrySystemException - sys. exceptionRollbackException - rollback exceptionpublic static void unlock(Transaction tx)
tx - the transactionpublic void beforeCompletion()
beforeCompletion in interface Synchronizationpublic void afterCompletion(int status)
afterCompletion in interface Synchronizationprotected void invokeBefore(Synchronization synch)
synch - the synchronizationprotected void invokeAfter(Synchronization synch, int status)
synch - the synchronizationstatus - the status of the transactionCopyright © 2013 IronJacamar (http://www.ironjacamar.org)