public abstract class CommandInterceptor extends AbstractVisitor
Visitor interface allowing it to
 intercept invocations on VisitableCommands.
 
 Commands are either created by the CacheImpl (for invocations on the Cache public interface), or
 by the InboundInvocationHandler for remotely originating invocations, and are passed up the interceptor chain
 by using the InterceptorChain helper class.
 
 When writing interceptors, authors can either override a specific visitXXX() method (such as AbstractVisitor.visitGetKeyValueCommand(InvocationContext, GetKeyValueCommand)) or the more generic handleDefault(InvocationContext, VisitableCommand) which is the default behaviour of any visit method, as defined
 in AbstractVisitor.handleDefault(InvocationContext, VisitableCommand).
 
 The preferred approach is to override the specific visitXXX() methods that are of interest rather than to override
 handleDefault(InvocationContext, VisitableCommand) and then write a series of if statements or a switch
 block, if command-specific behaviour is needed.
 VisitableCommand, 
Visitor, 
InterceptorChain| Modifier and Type | Field and Description | 
|---|---|
| protected Configuration | configuration | 
| Constructor and Description | 
|---|
| CommandInterceptor() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Log | getLog() | 
| CommandInterceptor | getNext()Retrieves the next interceptor in the chain. | 
| protected Object | handleDefault(InvocationContext ctx,
             VisitableCommand command)The default behaviour of the visitXXX methods, which is to ignore the call and pass the call up to the next
 interceptor in the chain. | 
| boolean | hasNext() | 
| Object | invokeNextInterceptor(InvocationContext ctx,
                     VisitableCommand command)Invokes the next interceptor in the chain. | 
| void | setNext(CommandInterceptor next)Sets the next interceptor in the chain to the interceptor passed in. | 
visitApplyDeltaCommand, visitClearCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutKeyValueCommand, visitPutMapCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommandprotected Configuration configuration
protected Log getLog()
public final CommandInterceptor getNext()
public final boolean hasNext()
public final void setNext(CommandInterceptor next)
next - next interceptor in the chain.public final Object invokeNextInterceptor(InvocationContext ctx, VisitableCommand command) throws Throwable
ctx - invocation contextcommand - command to pass up the chain.Throwable - in the event of problemsprotected Object handleDefault(InvocationContext ctx, VisitableCommand command) throws Throwable
handleDefault in class AbstractVisitorctx - invocation contextcommand - command to invokeThrowable - in the event of problemsCopyright © 2012 JBoss by Red Hat. All Rights Reserved.