org.jboss.cache.interceptors
Class InvocationContextInterceptor

java.lang.Object
  extended by org.jboss.cache.commands.AbstractVisitor
      extended by org.jboss.cache.interceptors.base.CommandInterceptor
          extended by org.jboss.cache.interceptors.BaseTransactionalContextInterceptor
              extended by org.jboss.cache.interceptors.InvocationContextInterceptor
All Implemented Interfaces:
Visitor

public class InvocationContextInterceptor
extends BaseTransactionalContextInterceptor

Always place this interceptor at the start of the interceptor chain to ensure invocation contexts and set up and cleaned up correctly.

Author:
Manik Surtani (manik AT jboss DOT org)

Field Summary
 
Fields inherited from class org.jboss.cache.interceptors.BaseTransactionalContextInterceptor
txManager, txTable
 
Fields inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
InvocationContextInterceptor()
           
 
Method Summary
 java.lang.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.
 void setDependencies(RPCManager rpcManager)
           
 java.lang.Object visitClearDataCommand(InvocationContext ctx, ClearDataCommand command)
          Visits a RemoveDataCommand.
 java.lang.Object visitCommitCommand(InvocationContext ctx, CommitCommand command)
          Visits a CommitCommand.
 java.lang.Object visitExistsNodeCommand(InvocationContext ctx, ExistsCommand command)
          Visits a RemoteExistsCommand.
 java.lang.Object visitOptimisticPrepareCommand(InvocationContext ctx, OptimisticPrepareCommand command)
          Visits a OptimisticPrepareCommand.
 java.lang.Object visitPrepareCommand(InvocationContext ctx, PrepareCommand command)
          Visits a PrepareCommand.
 java.lang.Object visitPutDataMapCommand(InvocationContext ctx, PutDataMapCommand command)
          Visits a PutDataMapCommand.
 java.lang.Object visitPutForExternalReadCommand(InvocationContext ctx, PutForExternalReadCommand command)
          Visits a PutForExternalReadCommand.
 java.lang.Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
          Visits a PutKeyValueCommand.
 java.lang.Object visitRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand command)
          Visits a RemoveKeyCommand.
 java.lang.Object visitRemoveNodeCommand(InvocationContext ctx, RemoveNodeCommand command)
          Visits a RemoveNodeCommand.
 java.lang.Object visitRollbackCommand(InvocationContext ctx, RollbackCommand command)
          Visits a RollbackCommand.
 
Methods inherited from class org.jboss.cache.interceptors.BaseTransactionalContextInterceptor
copyInvocationScopeOptionsToTxScope, isRollingBack, setTransactionalContext
 
Methods inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
getNext, hasNext, invokeNextInterceptor, setNext
 
Methods inherited from class org.jboss.cache.commands.AbstractVisitor
visitCollection, visitCreateNodeCommand, visitEvictFqnCommand, visitGetDataMapCommand, visitGetChildrenNamesCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvocationContextInterceptor

public InvocationContextInterceptor()
Method Detail

setDependencies

public void setDependencies(RPCManager rpcManager)

visitPutDataMapCommand

public java.lang.Object visitPutDataMapCommand(InvocationContext ctx,
                                               PutDataMapCommand command)
                                        throws java.lang.Throwable
Description copied from interface: Visitor
Visits a PutDataMapCommand.

Specified by:
visitPutDataMapCommand in interface Visitor
Overrides:
visitPutDataMapCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitExistsNodeCommand

public java.lang.Object visitExistsNodeCommand(InvocationContext ctx,
                                               ExistsCommand command)
                                        throws java.lang.Throwable
Description copied from interface: Visitor
Visits a RemoteExistsCommand.

Specified by:
visitExistsNodeCommand in interface Visitor
Overrides:
visitExistsNodeCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitPutForExternalReadCommand

public java.lang.Object visitPutForExternalReadCommand(InvocationContext ctx,
                                                       PutForExternalReadCommand command)
                                                throws java.lang.Throwable
Description copied from interface: Visitor
Visits a PutForExternalReadCommand.

Specified by:
visitPutForExternalReadCommand in interface Visitor
Overrides:
visitPutForExternalReadCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitPutKeyValueCommand

public java.lang.Object visitPutKeyValueCommand(InvocationContext ctx,
                                                PutKeyValueCommand command)
                                         throws java.lang.Throwable
Description copied from interface: Visitor
Visits a PutKeyValueCommand.

Specified by:
visitPutKeyValueCommand in interface Visitor
Overrides:
visitPutKeyValueCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitRemoveNodeCommand

public java.lang.Object visitRemoveNodeCommand(InvocationContext ctx,
                                               RemoveNodeCommand command)
                                        throws java.lang.Throwable
Description copied from interface: Visitor
Visits a RemoveNodeCommand.

Specified by:
visitRemoveNodeCommand in interface Visitor
Overrides:
visitRemoveNodeCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitClearDataCommand

public java.lang.Object visitClearDataCommand(InvocationContext ctx,
                                              ClearDataCommand command)
                                       throws java.lang.Throwable
Description copied from interface: Visitor
Visits a RemoveDataCommand.

Specified by:
visitClearDataCommand in interface Visitor
Overrides:
visitClearDataCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitRemoveKeyCommand

public java.lang.Object visitRemoveKeyCommand(InvocationContext ctx,
                                              RemoveKeyCommand command)
                                       throws java.lang.Throwable
Description copied from interface: Visitor
Visits a RemoveKeyCommand.

Specified by:
visitRemoveKeyCommand in interface Visitor
Overrides:
visitRemoveKeyCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitPrepareCommand

public java.lang.Object visitPrepareCommand(InvocationContext ctx,
                                            PrepareCommand command)
                                     throws java.lang.Throwable
Description copied from interface: Visitor
Visits a PrepareCommand.

Specified by:
visitPrepareCommand in interface Visitor
Overrides:
visitPrepareCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitRollbackCommand

public java.lang.Object visitRollbackCommand(InvocationContext ctx,
                                             RollbackCommand command)
                                      throws java.lang.Throwable
Description copied from interface: Visitor
Visits a RollbackCommand.

Specified by:
visitRollbackCommand in interface Visitor
Overrides:
visitRollbackCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitCommitCommand

public java.lang.Object visitCommitCommand(InvocationContext ctx,
                                           CommitCommand command)
                                    throws java.lang.Throwable
Description copied from interface: Visitor
Visits a CommitCommand.

Specified by:
visitCommitCommand in interface Visitor
Overrides:
visitCommitCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

visitOptimisticPrepareCommand

public java.lang.Object visitOptimisticPrepareCommand(InvocationContext ctx,
                                                      OptimisticPrepareCommand command)
                                               throws java.lang.Throwable
Description copied from interface: Visitor
Visits a OptimisticPrepareCommand.

Specified by:
visitOptimisticPrepareCommand in interface Visitor
Overrides:
visitOptimisticPrepareCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
java.lang.Throwable - in the event of problems.

handleDefault

public java.lang.Object handleDefault(InvocationContext ctx,
                                      VisitableCommand command)
                               throws java.lang.Throwable
Description copied from class: CommandInterceptor
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.

Overrides:
handleDefault in class CommandInterceptor
Parameters:
ctx - invocation context
command - command to invoke
Returns:
return value
Throws:
java.lang.Throwable - in the event of problems


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.