org.jboss.cache.interceptors
Class OrderedSynchronizationHandler

java.lang.Object
  extended byorg.jboss.cache.interceptors.OrderedSynchronizationHandler
All Implemented Interfaces:
Synchronization (src)

public class OrderedSynchronizationHandler
extends java.lang.Object
implements Synchronization (src)

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.


Method Summary
 void afterCompletion(int status)
          This method is invoked after the transaction has committed or rolled back.
 void beforeCompletion()
          This method is invoked before the start of the commit process.
static OrderedSynchronizationHandler (src) getInstance(Transaction (src)  tx)
          Creates a new instance of OrderedSynchronizationHandler, or fetches an existing instance.
 void registerAtHead(Synchronization (src)  handler)
           
 void registerAtTail(Synchronization (src)  handler)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static OrderedSynchronizationHandler (src)  getInstance(Transaction (src)  tx)
                                                 throws SystemException (src) ,
                                                        RollbackException (src) 
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 -
Returns:
Throws:
SystemException (src)
RollbackException (src)

registerAtHead

public void registerAtHead(Synchronization (src)  handler)

registerAtTail

public void registerAtTail(Synchronization (src)  handler)

beforeCompletion

public void beforeCompletion()
Description copied from interface: Synchronization (src)
This method is invoked before the start of the commit process. The method invocation is done in the context of the transaction that is about to be committed.

Specified by:
beforeCompletion in interface Synchronization (src)

afterCompletion

public void afterCompletion(int status)
Description copied from interface: Synchronization (src)
This method is invoked after the transaction has committed or rolled back.

Specified by:
afterCompletion in interface Synchronization (src)
Parameters:
status - The status of the completed transaction.

toString

public java.lang.String toString()