Package org.infinispan.commands
Class AbstractVisitor
- java.lang.Object
-
- org.infinispan.commands.AbstractVisitor
-
- All Implemented Interfaces:
Visitor
- Direct Known Subclasses:
AffectedKeysVisitor
,BaseStateTransferInterceptor.LostDataVisitor
,CommandInterceptor
,ScatteredDistributionInterceptor.PrimaryResponseGenerator
,ScatteredDistributionInterceptor.PrimaryResponseHandler
,TxBatchUpdater
public abstract class AbstractVisitor extends Object implements Visitor
An abstract implementation of a Visitor that delegates all visit calls to a default handler which can be overridden.- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com, Manik Surtani, Galder ZamarreƱo
-
-
Constructor Summary
Constructors Constructor Description AbstractVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
handleDefault(InvocationContext ctx, VisitableCommand command)
A default handler for all commands visited.Object
visitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command)
void
visitCollection(InvocationContext ctx, Collection<? extends VisitableCommand> toVisit)
Helper method to visit a collection of VisitableCommands.Object
visitCommitCommand(TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command)
Object
visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command)
Object
visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command)
<V> Object
visitDistributedExecuteCommand(InvocationContext ctx, org.infinispan.commands.read.DistributedExecuteCommand<V> command)
Object
visitEntrySetCommand(InvocationContext ctx, org.infinispan.commands.read.EntrySetCommand command)
Object
visitEvictCommand(InvocationContext ctx, org.infinispan.commands.write.EvictCommand command)
Object
visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command)
Object
visitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command)
Object
visitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command)
Object
visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command)
Object
visitInvalidateCommand(InvocationContext ctx, org.infinispan.commands.write.InvalidateCommand invalidateCommand)
Object
visitInvalidateL1Command(InvocationContext ctx, org.infinispan.commands.write.InvalidateL1Command invalidateL1Command)
Object
visitKeySetCommand(InvocationContext ctx, org.infinispan.commands.read.KeySetCommand command)
Object
visitLockControlCommand(TxInvocationContext ctx, org.infinispan.commands.control.LockControlCommand command)
Object
visitPrepareCommand(TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command)
Object
visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command)
Object
visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command)
Object
visitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command)
Object
visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command)
Object
visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command)
Object
visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command)
Object
visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command)
Object
visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command)
Object
visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command)
Object
visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command)
Object
visitRollbackCommand(TxInvocationContext ctx, org.infinispan.commands.tx.RollbackCommand command)
Object
visitSizeCommand(InvocationContext ctx, org.infinispan.commands.read.SizeCommand command)
Object
visitUnknownCommand(InvocationContext ctx, VisitableCommand command)
Object
visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command)
Object
visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command)
Object
visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command)
Object
visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.Visitor
visitApplyDeltaCommand, visitRemoveExpiredCommand
-
-
-
-
Method Detail
-
visitPutKeyValueCommand
public Object visitPutKeyValueCommand(InvocationContext ctx, org.infinispan.commands.write.PutKeyValueCommand command) throws Throwable
- Specified by:
visitPutKeyValueCommand
in interfaceVisitor
- Throws:
Throwable
-
visitRemoveCommand
public Object visitRemoveCommand(InvocationContext ctx, org.infinispan.commands.write.RemoveCommand command) throws Throwable
- Specified by:
visitRemoveCommand
in interfaceVisitor
- Throws:
Throwable
-
visitReplaceCommand
public Object visitReplaceCommand(InvocationContext ctx, org.infinispan.commands.write.ReplaceCommand command) throws Throwable
- Specified by:
visitReplaceCommand
in interfaceVisitor
- Throws:
Throwable
-
visitComputeCommand
public Object visitComputeCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeCommand command) throws Throwable
- Specified by:
visitComputeCommand
in interfaceVisitor
- Throws:
Throwable
-
visitComputeIfAbsentCommand
public Object visitComputeIfAbsentCommand(InvocationContext ctx, org.infinispan.commands.write.ComputeIfAbsentCommand command) throws Throwable
- Specified by:
visitComputeIfAbsentCommand
in interfaceVisitor
- Throws:
Throwable
-
visitClearCommand
public Object visitClearCommand(InvocationContext ctx, org.infinispan.commands.write.ClearCommand command) throws Throwable
- Specified by:
visitClearCommand
in interfaceVisitor
- Throws:
Throwable
-
visitPutMapCommand
public Object visitPutMapCommand(InvocationContext ctx, org.infinispan.commands.write.PutMapCommand command) throws Throwable
- Specified by:
visitPutMapCommand
in interfaceVisitor
- Throws:
Throwable
-
visitEvictCommand
public Object visitEvictCommand(InvocationContext ctx, org.infinispan.commands.write.EvictCommand command) throws Throwable
- Specified by:
visitEvictCommand
in interfaceVisitor
- Throws:
Throwable
-
visitSizeCommand
public Object visitSizeCommand(InvocationContext ctx, org.infinispan.commands.read.SizeCommand command) throws Throwable
- Specified by:
visitSizeCommand
in interfaceVisitor
- Throws:
Throwable
-
visitGetKeyValueCommand
public Object visitGetKeyValueCommand(InvocationContext ctx, org.infinispan.commands.read.GetKeyValueCommand command) throws Throwable
- Specified by:
visitGetKeyValueCommand
in interfaceVisitor
- Throws:
Throwable
-
visitGetCacheEntryCommand
public Object visitGetCacheEntryCommand(InvocationContext ctx, org.infinispan.commands.read.GetCacheEntryCommand command) throws Throwable
- Specified by:
visitGetCacheEntryCommand
in interfaceVisitor
- Throws:
Throwable
-
visitGetAllCommand
public Object visitGetAllCommand(InvocationContext ctx, org.infinispan.commands.read.GetAllCommand command) throws Throwable
- Specified by:
visitGetAllCommand
in interfaceVisitor
- Throws:
Throwable
-
visitKeySetCommand
public Object visitKeySetCommand(InvocationContext ctx, org.infinispan.commands.read.KeySetCommand command) throws Throwable
- Specified by:
visitKeySetCommand
in interfaceVisitor
- Throws:
Throwable
-
visitEntrySetCommand
public Object visitEntrySetCommand(InvocationContext ctx, org.infinispan.commands.read.EntrySetCommand command) throws Throwable
- Specified by:
visitEntrySetCommand
in interfaceVisitor
- Throws:
Throwable
-
visitPrepareCommand
public Object visitPrepareCommand(TxInvocationContext ctx, org.infinispan.commands.tx.PrepareCommand command) throws Throwable
- Specified by:
visitPrepareCommand
in interfaceVisitor
- Throws:
Throwable
-
visitRollbackCommand
public Object visitRollbackCommand(TxInvocationContext ctx, org.infinispan.commands.tx.RollbackCommand command) throws Throwable
- Specified by:
visitRollbackCommand
in interfaceVisitor
- Throws:
Throwable
-
visitCommitCommand
public Object visitCommitCommand(TxInvocationContext ctx, org.infinispan.commands.tx.CommitCommand command) throws Throwable
- Specified by:
visitCommitCommand
in interfaceVisitor
- Throws:
Throwable
-
visitInvalidateCommand
public Object visitInvalidateCommand(InvocationContext ctx, org.infinispan.commands.write.InvalidateCommand invalidateCommand) throws Throwable
- Specified by:
visitInvalidateCommand
in interfaceVisitor
- Throws:
Throwable
-
visitInvalidateL1Command
public Object visitInvalidateL1Command(InvocationContext ctx, org.infinispan.commands.write.InvalidateL1Command invalidateL1Command) throws Throwable
- Specified by:
visitInvalidateL1Command
in interfaceVisitor
- Throws:
Throwable
-
handleDefault
protected Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
A default handler for all commands visited. This is called for any visit method called, unless a visit command is appropriately overridden.- Parameters:
ctx
- invocation contextcommand
- command to handle- Returns:
- return value
- Throws:
Throwable
- in the case of a problem
-
visitCollection
public void visitCollection(InvocationContext ctx, Collection<? extends VisitableCommand> toVisit) throws Throwable
Helper method to visit a collection of VisitableCommands.- Parameters:
ctx
- Invocation contexttoVisit
- collection of commands to visit- Throws:
Throwable
- in the event of problems
-
visitLockControlCommand
public Object visitLockControlCommand(TxInvocationContext ctx, org.infinispan.commands.control.LockControlCommand command) throws Throwable
- Specified by:
visitLockControlCommand
in interfaceVisitor
- Throws:
Throwable
-
visitUnknownCommand
public Object visitUnknownCommand(InvocationContext ctx, VisitableCommand command) throws Throwable
- Specified by:
visitUnknownCommand
in interfaceVisitor
- Throws:
Throwable
-
visitDistributedExecuteCommand
public <V> Object visitDistributedExecuteCommand(InvocationContext ctx, org.infinispan.commands.read.DistributedExecuteCommand<V> command) throws Throwable
- Specified by:
visitDistributedExecuteCommand
in interfaceVisitor
- Throws:
Throwable
-
visitGetKeysInGroupCommand
public Object visitGetKeysInGroupCommand(InvocationContext ctx, org.infinispan.commands.remote.GetKeysInGroupCommand command) throws Throwable
- Specified by:
visitGetKeysInGroupCommand
in interfaceVisitor
- Throws:
Throwable
-
visitReadOnlyKeyCommand
public Object visitReadOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyKeyCommand command) throws Throwable
- Specified by:
visitReadOnlyKeyCommand
in interfaceVisitor
- Throws:
Throwable
-
visitReadOnlyManyCommand
public Object visitReadOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadOnlyManyCommand command) throws Throwable
- Specified by:
visitReadOnlyManyCommand
in interfaceVisitor
- Throws:
Throwable
-
visitWriteOnlyKeyCommand
public Object visitWriteOnlyKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyCommand
in interfaceVisitor
- Throws:
Throwable
-
visitReadWriteKeyValueCommand
public Object visitReadWriteKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyValueCommand command) throws Throwable
- Specified by:
visitReadWriteKeyValueCommand
in interfaceVisitor
- Throws:
Throwable
-
visitReadWriteKeyCommand
public Object visitReadWriteKeyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteKeyCommand command) throws Throwable
- Specified by:
visitReadWriteKeyCommand
in interfaceVisitor
- Throws:
Throwable
-
visitWriteOnlyManyEntriesCommand
public Object visitWriteOnlyManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyEntriesCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyEntriesCommand
in interfaceVisitor
- Throws:
Throwable
-
visitWriteOnlyKeyValueCommand
public Object visitWriteOnlyKeyValueCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyKeyValueCommand command) throws Throwable
- Specified by:
visitWriteOnlyKeyValueCommand
in interfaceVisitor
- Throws:
Throwable
-
visitWriteOnlyManyCommand
public Object visitWriteOnlyManyCommand(InvocationContext ctx, org.infinispan.commands.functional.WriteOnlyManyCommand command) throws Throwable
- Specified by:
visitWriteOnlyManyCommand
in interfaceVisitor
- Throws:
Throwable
-
visitReadWriteManyCommand
public Object visitReadWriteManyCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyCommand command) throws Throwable
- Specified by:
visitReadWriteManyCommand
in interfaceVisitor
- Throws:
Throwable
-
visitReadWriteManyEntriesCommand
public Object visitReadWriteManyEntriesCommand(InvocationContext ctx, org.infinispan.commands.functional.ReadWriteManyEntriesCommand command) throws Throwable
- Specified by:
visitReadWriteManyEntriesCommand
in interfaceVisitor
- Throws:
Throwable
-
-