org.jboss.cache.interceptors
Class OrderedSynchronizationHandler

java.lang.Object
  extended by 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.3 2006/04/10 05:31:04 genman Exp $
Author:
Bela Ban

Method Summary
 void afterCompletion(int status)
           
 void beforeCompletion()
           
static OrderedSynchronizationHandler getInstance(javax.transaction.Transaction tx)
          Creates a new instance of OrderedSynchronizationHandler, or fetches an existing instance.
 void registerAtHead(javax.transaction.Synchronization handler)
           
 void registerAtTail(javax.transaction.Synchronization 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 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 -
Returns:
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


Copyright 1998-2005 JBoss Inc . All Rights Reserved.