org.jboss.cache.interceptors
Class OptimisticReplicationInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.BaseRpcInterceptor
          extended by org.jboss.cache.interceptors.OptimisticReplicationInterceptor
All Implemented Interfaces:
InterceptorMBean

public class OptimisticReplicationInterceptor
extends BaseRpcInterceptor

Replication interceptor for the optimistically locked interceptor chain. Responsible for replicating state to remote nodes. Unlike it's cousin, the ReplicationInterceptor, this interceptor only deals with transactional calls. Just like all things to do with Optimistic Locking, it is a requirement that everything is done in a transaction and the transaction context is available via InvocationContext.getTransaction() and InvocationContext.getGlobalTransaction().

Author:
Manik Surtani (manik@jboss.org), Steve Woodcock (stevew@jofti.com)

Field Summary
 
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next
 
Constructor Summary
OptimisticReplicationInterceptor()
           
 
Method Summary
protected  void broadcastCommit(GlobalTransaction gtx)
           
protected  void broadcastPrepare(MethodCall methodCall, GlobalTransaction gtx)
           
protected  void broadcastRollback(GlobalTransaction gtx)
           
protected  TransactionWorkspace getTransactionWorkspace(GlobalTransaction gtx)
           
 java.lang.Object invoke(InvocationContext ctx)
           
 
Methods inherited from class org.jboss.cache.interceptors.BaseRpcInterceptor
checkResponses, containsModifications, putCallOnAsyncReplicationQueue, replicateCall, replicateCall, setCache
 
Methods inherited from class org.jboss.cache.interceptors.Interceptor
dumpStatistics, getLast, getNext, getStatisticsEnabled, isActive, isOnePhaseCommitPrepareMehod, isPreparing, isValid, resetStatistics, setLast, setNext, setStatisticsEnabled, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptimisticReplicationInterceptor

public OptimisticReplicationInterceptor()
Method Detail

invoke

public java.lang.Object invoke(InvocationContext ctx)
                        throws java.lang.Throwable
Overrides:
invoke in class Interceptor
Throws:
java.lang.Throwable

broadcastPrepare

protected void broadcastPrepare(MethodCall methodCall,
                                GlobalTransaction gtx)
                         throws java.lang.Throwable
Throws:
java.lang.Throwable

broadcastCommit

protected void broadcastCommit(GlobalTransaction gtx)
                        throws java.lang.Throwable
Throws:
java.lang.Throwable

broadcastRollback

protected void broadcastRollback(GlobalTransaction gtx)
                          throws java.lang.Throwable
Throws:
java.lang.Throwable

getTransactionWorkspace

protected TransactionWorkspace getTransactionWorkspace(GlobalTransaction gtx)
                                                throws CacheException
Throws:
CacheException