org.jboss.cache.interceptors
Class OrderedSynchronizationHandler
java.lang.Object
org.jboss.cache.interceptors.OrderedSynchronizationHandler
- All Implemented Interfaces:
- javax.transaction.Synchronization
public class OrderedSynchronizationHandler
- extends java.lang.Object
- implements javax.transaction.Synchronization
Maintains a list of Synchronization handlers. Reason is that we have to
invoke certain handlers before others. See the description in
SyncTxUnitTestCase.testConcurrentPuts(). For example, for synchronous
replication, we have to execute the ReplicationInterceptor's
afterCompletion() before the TransactionInterceptor's.
- Version:
- $Id: OrderedSynchronizationHandler.java,v 1.6 2007/06/29 04:27:33 bstansberry Exp $
- Author:
- Bela Ban
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
getInstance
public static OrderedSynchronizationHandler getInstance(javax.transaction.Transaction tx)
throws javax.transaction.SystemException,
javax.transaction.RollbackException
- Creates a new instance of OrderedSynchronizationHandler, or fetches an existing instance. Key is the local
transaction (tx). This instance registers with the TransactionManager automatically
- Parameters:
tx
-
- Throws:
javax.transaction.SystemException
javax.transaction.RollbackException
registerAtHead
public void registerAtHead(javax.transaction.Synchronization handler)
registerAtTail
public void registerAtTail(javax.transaction.Synchronization handler)
beforeCompletion
public void beforeCompletion()
- Specified by:
beforeCompletion
in interface javax.transaction.Synchronization
afterCompletion
public void afterCompletion(int status)
- Specified by:
afterCompletion
in interface javax.transaction.Synchronization
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object