|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.cache.interceptors.Interceptor org.jboss.cache.interceptors.ReplicationInterceptor
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).
Constructor Summary | |
ReplicationInterceptor()
Map |
Method Summary | |
Object |
invoke(org.jgroups.blocks.MethodCall m)
|
void |
replicate(List method_calls)
Receives and applies a number of method calls |
Object |
replicate(org.jgroups.blocks.MethodCall method_call)
Received as result of replication sent from another node to this node |
protected void |
runCommitPhase(GlobalTransaction gtx)
Asynchronously calls #commit(GlobalTransaction) in all members |
protected void |
runPreparePhase(GlobalTransaction tx,
org.jgroups.blocks.MethodCall prepare_method,
org.jgroups.Address coordinator,
List modifications,
boolean async)
Calls #prepare(GlobalTransaction,List,org.jgroups.Address,boolean)) in all members except self. |
protected void |
runRollbackPhase(GlobalTransaction gtx)
Asynchronously calls #rollback(GlobalTransaction) in all members |
void |
setCache(TreeCache cache)
|
Methods inherited from class org.jboss.cache.interceptors.Interceptor |
getNext, setNext |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ReplicationInterceptor()
Method Detail |
public void setCache(TreeCache cache)
setCache
in class Interceptor
public Object invoke(org.jgroups.blocks.MethodCall m) throws Throwable
invoke
in class Interceptor
Throwable
public Object replicate(org.jgroups.blocks.MethodCall method_call) throws Throwable
replicate
in interface Replicatable
method_call
-
Throwable
public void replicate(List method_calls) throws Throwable
Replicatable
replicate
in interface Replicatable
method_calls
- ListThrowable
protected void runPreparePhase(GlobalTransaction tx, org.jgroups.blocks.MethodCall prepare_method, org.jgroups.Address coordinator, List modifications, boolean async) throws Exception
#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.#afterCompletion(int)
callback will trigger the #runCommitPhase(GlobalTransaction))
.
tx
- coordinator
- prepare_method
- The MethodCall representing the prepare() methodasync
- Run this asynchronously
Exception
protected void runCommitPhase(GlobalTransaction gtx)
#commit(GlobalTransaction)
in all members
protected void runRollbackPhase(GlobalTransaction gtx)
#rollback(GlobalTransaction)
in all members
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |