org.jboss.cache.interceptors
Class InvalidationInterceptor
java.lang.Object
org.jboss.cache.commands.AbstractVisitor
org.jboss.cache.interceptors.base.CommandInterceptor
org.jboss.cache.interceptors.BaseRpcInterceptor
org.jboss.cache.interceptors.InvalidationInterceptor
- All Implemented Interfaces:
- Visitor
public class InvalidationInterceptor
- extends BaseRpcInterceptor
This interceptor acts as a replacement to the replication interceptor when
the CacheImpl is configured with ClusteredSyncMode as INVALIDATE.
The idea is that rather than replicating changes to all caches in a cluster
when CRUD (Create, Remove, Update, Delete) methods are called, simply call
evict(Fqn) on the remote caches for each changed node. This allows the
remote node to look up the value in a shared cache loader which would have
been updated with the changes.
- Author:
- Manik Surtani (manik AT jboss DOT org)
|
Method Summary |
Map<String,Object> |
dumpStatistics()
|
long |
getInvalidations()
|
protected DataVersion |
getNodeVersion(TransactionWorkspace w,
Fqn f)
|
boolean |
getStatisticsEnabled()
|
protected TransactionWorkspace |
getWorkspace(InvocationContext ctx)
|
void |
injectDependencies(CommandsFactory commandsFactory)
|
protected void |
invalidateAcrossCluster(Fqn fqn,
TransactionWorkspace workspace,
boolean synchronous,
InvocationContext ctx)
|
void |
resetStatistics()
|
void |
setStatisticsEnabled(boolean enabled)
|
Object |
visitClearDataCommand(InvocationContext ctx,
ClearDataCommand command)
Visits a RemoveDataCommand. |
Object |
visitCommitCommand(InvocationContext ctx,
CommitCommand command)
Visits a CommitCommand. |
Object |
visitMoveCommand(InvocationContext ctx,
MoveCommand command)
Visits a MoveCommand. |
Object |
visitOptimisticPrepareCommand(InvocationContext ctx,
OptimisticPrepareCommand command)
Visits a OptimisticPrepareCommand. |
Object |
visitPrepareCommand(InvocationContext ctx,
PrepareCommand command)
Visits a PrepareCommand. |
Object |
visitPutDataMapCommand(InvocationContext ctx,
PutDataMapCommand command)
Visits a PutDataMapCommand. |
Object |
visitPutForExternalReadCommand(InvocationContext ctx,
PutForExternalReadCommand command)
Visits a PutForExternalReadCommand. |
Object |
visitPutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
Visits a PutKeyValueCommand. |
Object |
visitRemoveKeyCommand(InvocationContext ctx,
RemoveKeyCommand command)
Visits a RemoveKeyCommand. |
Object |
visitRemoveNodeCommand(InvocationContext ctx,
RemoveNodeCommand command)
Visits a RemoveNodeCommand. |
Object |
visitRollbackCommand(InvocationContext ctx,
RollbackCommand command)
Visits a RollbackCommand. |
| Methods inherited from class org.jboss.cache.commands.AbstractVisitor |
visitCollection, visitCreateNodeCommand, visitEvictFqnCommand, visitExistsNodeCommand, visitGetChildrenNamesCommand, visitGetDataMapCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
txMods
protected Map<GlobalTransaction,List<WriteCommand>> txMods
optimistic
protected boolean optimistic
InvalidationInterceptor
public InvalidationInterceptor()
injectDependencies
public void injectDependencies(CommandsFactory commandsFactory)
visitPutDataMapCommand
public Object visitPutDataMapCommand(InvocationContext ctx,
PutDataMapCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a PutDataMapCommand.
- Specified by:
visitPutDataMapCommand in interface Visitor- Overrides:
visitPutDataMapCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitPutForExternalReadCommand
public Object visitPutForExternalReadCommand(InvocationContext ctx,
PutForExternalReadCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a PutForExternalReadCommand.
- Specified by:
visitPutForExternalReadCommand in interface Visitor- Overrides:
visitPutForExternalReadCommand 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.
visitRemoveNodeCommand
public Object visitRemoveNodeCommand(InvocationContext ctx,
RemoveNodeCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a RemoveNodeCommand.
- Specified by:
visitRemoveNodeCommand in interface Visitor- Overrides:
visitRemoveNodeCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitRemoveKeyCommand
public Object visitRemoveKeyCommand(InvocationContext ctx,
RemoveKeyCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a RemoveKeyCommand.
- Specified by:
visitRemoveKeyCommand in interface Visitor- Overrides:
visitRemoveKeyCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitMoveCommand
public Object visitMoveCommand(InvocationContext ctx,
MoveCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a MoveCommand.
- Specified by:
visitMoveCommand in interface Visitor- Overrides:
visitMoveCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitClearDataCommand
public Object visitClearDataCommand(InvocationContext ctx,
ClearDataCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a RemoveDataCommand.
- Specified by:
visitClearDataCommand in interface Visitor- Overrides:
visitClearDataCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
visitPrepareCommand
public Object visitPrepareCommand(InvocationContext ctx,
PrepareCommand command)
throws Throwable
- Description copied from interface:
Visitor
- Visits a PrepareCommand.
- Specified by:
visitPrepareCommand in interface Visitor- Overrides:
visitPrepareCommand in class AbstractVisitor
- Parameters:
ctx - invocation contextcommand - command to visit
- Returns:
- response from the visit
- Throws:
Throwable - in the event of problems.
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.
invalidateAcrossCluster
protected void invalidateAcrossCluster(Fqn fqn,
TransactionWorkspace workspace,
boolean synchronous,
InvocationContext ctx)
throws Throwable
- Throws:
Throwable
getNodeVersion
protected DataVersion getNodeVersion(TransactionWorkspace w,
Fqn f)
getWorkspace
protected TransactionWorkspace getWorkspace(InvocationContext ctx)
resetStatistics
public void resetStatistics()
dumpStatistics
public Map<String,Object> dumpStatistics()
getStatisticsEnabled
public boolean getStatisticsEnabled()
setStatisticsEnabled
public void setStatisticsEnabled(boolean enabled)
getInvalidations
public long getInvalidations()
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.