org.infinispan.interceptors
Class ReplicationInterceptor
java.lang.Object
org.infinispan.commands.AbstractVisitor
org.infinispan.interceptors.base.CommandInterceptor
org.infinispan.interceptors.base.BaseRpcInterceptor
org.infinispan.interceptors.ClusteringInterceptor
org.infinispan.interceptors.ReplicationInterceptor
- All Implemented Interfaces:
- Visitor
- Direct Known Subclasses:
- VersionedReplicationInterceptor
public class ReplicationInterceptor
- extends ClusteringInterceptor
Takes care of replicating modifications to other caches in a cluster.
- Since:
- 4.0
- Author:
- Bela Ban
Method Summary |
protected void |
broadcastPrepare(TxInvocationContext context,
PrepareCommand command)
|
protected Log |
getLog()
|
protected Address |
getPrimaryOwner()
|
protected InternalCacheEntry |
retrieveFromRemoteSource(Object key,
InvocationContext ctx,
boolean acquireRemoteLock,
FlagAffectedCommand command)
Retrieves a cache entry from a remote source. |
void |
start()
|
Object |
visitClearCommand(InvocationContext ctx,
ClearCommand command)
|
Object |
visitCommitCommand(TxInvocationContext ctx,
CommitCommand command)
|
Object |
visitGetKeyValueCommand(InvocationContext ctx,
GetKeyValueCommand command)
|
Object |
visitLockControlCommand(TxInvocationContext ctx,
LockControlCommand command)
|
Object |
visitPrepareCommand(TxInvocationContext ctx,
PrepareCommand command)
|
Object |
visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
|
Object |
visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
|
Object |
visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
|
Object |
visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
|
Object |
visitRollbackCommand(TxInvocationContext ctx,
RollbackCommand command)
|
Methods inherited from class org.infinispan.commands.AbstractVisitor |
visitApplyDeltaCommand, visitCollection, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReplicationInterceptor
public ReplicationInterceptor()
getLog
protected Log getLog()
- Overrides:
getLog
in class CommandInterceptor
start
public void start()
visitCommitCommand
public Object visitCommitCommand(TxInvocationContext ctx,
CommitCommand command)
throws Throwable
- Specified by:
visitCommitCommand
in interface Visitor
- Overrides:
visitCommitCommand
in class AbstractVisitor
- Throws:
Throwable
visitPrepareCommand
public Object visitPrepareCommand(TxInvocationContext ctx,
PrepareCommand command)
throws Throwable
- Specified by:
visitPrepareCommand
in interface Visitor
- Overrides:
visitPrepareCommand
in class AbstractVisitor
- Throws:
Throwable
broadcastPrepare
protected void broadcastPrepare(TxInvocationContext context,
PrepareCommand command)
visitRollbackCommand
public Object visitRollbackCommand(TxInvocationContext ctx,
RollbackCommand command)
throws Throwable
- Specified by:
visitRollbackCommand
in interface Visitor
- Overrides:
visitRollbackCommand
in class AbstractVisitor
- Throws:
Throwable
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx,
GetKeyValueCommand command)
throws Throwable
- Specified by:
visitGetKeyValueCommand
in interface Visitor
- Overrides:
visitGetKeyValueCommand
in class AbstractVisitor
- Throws:
Throwable
visitLockControlCommand
public Object visitLockControlCommand(TxInvocationContext ctx,
LockControlCommand command)
throws Throwable
- Specified by:
visitLockControlCommand
in interface Visitor
- Overrides:
visitLockControlCommand
in class AbstractVisitor
- Throws:
Throwable
getPrimaryOwner
protected Address getPrimaryOwner()
retrieveFromRemoteSource
protected InternalCacheEntry retrieveFromRemoteSource(Object key,
InvocationContext ctx,
boolean acquireRemoteLock,
FlagAffectedCommand command)
- Description copied from class:
ClusteringInterceptor
- Retrieves a cache entry from a remote source. Would typically involve an RPC call using a
ClusteredGetCommand
and some form of quorum of responses if the responses returned are inconsistent - often the case if there is a
rehash in progress, involving nodes that the key maps to.
- Specified by:
retrieveFromRemoteSource
in class ClusteringInterceptor
- Parameters:
key
- key to look up
- Returns:
- an internal cache entry, or null if it cannot be located
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
throws Throwable
- Specified by:
visitPutKeyValueCommand
in interface Visitor
- Overrides:
visitPutKeyValueCommand
in class AbstractVisitor
- Throws:
Throwable
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx,
PutMapCommand command)
throws Throwable
- Specified by:
visitPutMapCommand
in interface Visitor
- Overrides:
visitPutMapCommand
in class AbstractVisitor
- Throws:
Throwable
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx,
RemoveCommand command)
throws Throwable
- Specified by:
visitRemoveCommand
in interface Visitor
- Overrides:
visitRemoveCommand
in class AbstractVisitor
- Throws:
Throwable
visitClearCommand
public Object visitClearCommand(InvocationContext ctx,
ClearCommand command)
throws Throwable
- Specified by:
visitClearCommand
in interface Visitor
- Overrides:
visitClearCommand
in class AbstractVisitor
- Throws:
Throwable
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx,
ReplaceCommand command)
throws Throwable
- Specified by:
visitReplaceCommand
in interface Visitor
- Overrides:
visitReplaceCommand
in class AbstractVisitor
- Throws:
Throwable
Copyright © 2013 JBoss, a division of Red Hat. All Rights Reserved.