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.BaseRpcInterceptor
defaultSynchronous
 
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next
 
Constructor Summary
OptimisticReplicationInterceptor()
           
 
Method Summary
protected  void broadcastCommit(GlobalTransaction gtx, InvocationContext ctx)
           
protected  void broadcastPrepare(MethodCall methodCall, GlobalTransaction gtx, InvocationContext ctx)
           
protected  void broadcastRollback(GlobalTransaction gtx, InvocationContext ctx)
           
protected  TransactionWorkspace getTransactionWorkspace(GlobalTransaction gtx)
           
 Object invoke(InvocationContext ctx)
           
 
Methods inherited from class org.jboss.cache.interceptors.BaseRpcInterceptor
containsModifications, checkResponses, isSynchronous, 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 Object invoke(InvocationContext ctx)
              throws Throwable
Overrides:
invoke in class Interceptor
Throws:
Throwable

broadcastPrepare

protected void broadcastPrepare(MethodCall methodCall,
                                GlobalTransaction gtx,
                                InvocationContext ctx)
                         throws Throwable
Throws:
Throwable

broadcastCommit

protected void broadcastCommit(GlobalTransaction gtx,
                               InvocationContext ctx)
                        throws Throwable
Throws:
Throwable

broadcastRollback

protected void broadcastRollback(GlobalTransaction gtx,
                                 InvocationContext ctx)
                          throws Throwable
Throws:
Throwable

getTransactionWorkspace

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


Copyright © 2007 JBoss, a division of Red Hat. All Rights Reserved.