This is the base class for all interceptors to extend, and implements the {@link org.jboss.cache.commands.Visitor} interfaceallowing it to intercept invocations on {@link org.jboss.cache.commands.VisitableCommand}s.
Commands are created either by the {@link org.jboss.cache.invocation.CacheInvocationDelegate} (for invocations on the {@link org.jboss.cache.Cache}public interface), the {@link org.jboss.cache.invocation.NodeInvocationDelegate} for invocations on the {@link org.jboss.cache.Node}public interface, or by the {@link org.jboss.cache.marshall.CommandAwareRpcDispatcher} for remotely originating invocations, andare passed up the interceptor chain by using the {@link org.jboss.cache.interceptors.InterceptorChain} helper class.
When writing interceptors, authors can either override a specific visitXXX() method (such as {@link #visitGetKeyValueCommand(org.jboss.cache.InvocationContext,org.jboss.cache.commands.read.GetKeyValueCommand)}) or the more generic {@link #handleDefault(org.jboss.cache.InvocationContext,org.jboss.cache.commands.VisitableCommand)} which is the default behaviour ofany visit method, as defined in {@link org.jboss.cache.commands.AbstractVisitor#handleDefault(org.jboss.cache.InvocationContext,org.jboss.cache.commands.VisitableCommand)}.
The preferred approach is to override the specific visitXXX() methods that are of interest rather than to override {@link #handleDefault(org.jboss.cache.InvocationContext,org.jboss.cache.commands.VisitableCommand)}and then write a series of if statements or a switch block, if command-specific behaviour is needed.
@author Mircea.Markus@jboss.com
@see VisitableCommand
@see org.jboss.cache.commands.Visitor
@see org.jboss.cache.interceptors.InterceptorChain
@since 2.2