org.jboss.cache.interceptors
Class ReplicationInterceptor
java.lang.Object
org.jboss.cache.interceptors.Interceptor
org.jboss.cache.interceptors.BaseRpcInterceptor
org.jboss.cache.interceptors.ReplicationInterceptor
- All Implemented Interfaces:
- InterceptorMBean
public class ReplicationInterceptor
- extends BaseRpcInterceptor
Takes care of replicating modifications to other nodes in a cluster. Also
listens for prepare(), commit() and rollback() messages which are received
'side-ways' (see docs/design/Refactoring.txt).
- Version:
- $Id: ReplicationInterceptor.java 4503 2007-09-25 13:41:09Z manik.surtani@jboss.com $
- Author:
- Bela Ban
Methods inherited from class org.jboss.cache.interceptors.Interceptor |
dumpStatistics, getLast, getNext, getStatisticsEnabled, isActive, isOnePhaseCommitPrepareMehod, isPreparing, isValid, resetStatistics, setLast, setNext, setStatisticsEnabled, toString |
ReplicationInterceptor
public ReplicationInterceptor()
invoke
public Object invoke(InvocationContext ctx)
throws Throwable
- Overrides:
invoke
in class Interceptor
- Throws:
Throwable
runPreparePhase
protected void runPreparePhase(MethodCall prepareMethod,
GlobalTransaction gtx,
InvocationContext ctx)
throws Throwable
- Calls prepare(GlobalTransaction,List,org.jgroups.Address,boolean)) in all members except self.
Waits for all responses. If one of the members failed to prepare, its return value
will be an exception. If there is one exception we rethrow it. This will mark the
current transaction as rolled back, which will cause the
afterCompletion(int) callback to have a status
of MARKED_ROLLBACK. When we get that call, we simply roll back the
transaction.
If everything runs okay, the afterCompletion(int)
callback will trigger the @link #runCommitPhase(GlobalTransaction)).
- Throws:
Exception
Throwable
Copyright © 2007 JBoss, a division of Red Hat. All Rights Reserved.