org.jboss.cache.interceptors
Class OptimisticReplicationInterceptor
java.lang.Object
org.jboss.cache.commands.AbstractVisitor
org.jboss.cache.interceptors.base.CommandInterceptor
org.jboss.cache.interceptors.BaseRpcInterceptor
org.jboss.cache.interceptors.OptimisticReplicationInterceptor
- All Implemented Interfaces:
- Visitor, 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)
| Methods inherited from class org.jboss.cache.commands.AbstractVisitor |
visitCollection, visitCreateNodeCommand, visitEvictFqnCommand, visitExistsNodeCommand, visitGetChildrenNamesCommand, visitGetDataMapCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand, visitPrepareCommand, visitPutDataMapCommand, visitRemoveDataCommand, visitRemoveKeyCommand, visitRemoveNodeCommand |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
OptimisticReplicationInterceptor
public OptimisticReplicationInterceptor()
initialize
public void initialize(CommandsFactory commandsFactory)
visitOptimisticPrepareCommand
public Object visitOptimisticPrepareCommand(InvocationContext ctx,
OptimisticPrepareCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a OptimisticPrepareCommand.
- Specified by:
visitOptimisticPrepareCommand in interface Visitor- Overrides:
visitOptimisticPrepareCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitCommitCommand
public Object visitCommitCommand(InvocationContext ctx,
CommitCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a CommitCommand.
- Specified by:
visitCommitCommand in interface Visitor- Overrides:
visitCommitCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitRollbackCommand
public Object visitRollbackCommand(InvocationContext ctx,
RollbackCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a RollbackCommand.
- Specified by:
visitRollbackCommand in interface Visitor- Overrides:
visitRollbackCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a PutKeyValueCommand.
- Specified by:
visitPutKeyValueCommand in interface Visitor- Overrides:
visitPutKeyValueCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
broadcastPrepare
protected void broadcastPrepare(OptimisticPrepareCommand command,
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 © 2008 JBoss, a division of Red Hat. All Rights Reserved.