org.jboss.cache.interceptors
Class PessimisticLockInterceptor

java.lang.Object
  extended by org.jboss.cache.commands.AbstractVisitor
      extended by org.jboss.cache.interceptors.base.CommandInterceptor
          extended by org.jboss.cache.interceptors.base.PostProcessingCommandInterceptor
              extended by org.jboss.cache.interceptors.PessimisticLockInterceptor
All Implemented Interfaces:
Visitor, InterceptorMBean

public class PessimisticLockInterceptor
extends PostProcessingCommandInterceptor

An interceptor that handles locking. When a TX is associated, we register for TX completion and unlock the locks acquired within the scope of the TX. When no TX is present, we keep track of the locks acquired during the current method and unlock when the method returns.

Version:
$Id: PessimisticLockInterceptor.java 5788 2008-05-01 16:15:04Z manik.surtani@jboss.com $
Author:
Bela Ban

Field Summary
 
Fields inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
PessimisticLockInterceptor()
           
 
Method Summary
 void doAfterCall(InvocationContext ctx, VisitableCommand command)
          Callback that is invoked after every handleXXX() method defined above.
 Object handleCommitCommand(InvocationContext ctx, CommitCommand command)
           
 Object handleEvictFqnCommand(InvocationContext ctx, EvictCommand command)
           
 Object handleGetChildrenNamesCommand(InvocationContext ctx, GetChildrenNamesCommand command)
           
 Object handleGetKeysCommand(InvocationContext ctx, GetKeysCommand command)
           
 Object handleGetKeyValueCommand(InvocationContext ctx, GetKeyValueCommand command)
           
 Object handleGetNodeCommand(InvocationContext ctx, GetNodeCommand command)
           
 Object handleMoveCommand(InvocationContext ctx, MoveCommand command)
           
 Object handlePrepareCommand(InvocationContext ctx, PrepareCommand command)
           
 Object handlePutDataMapCommand(InvocationContext ctx, PutDataMapCommand command)
           
 Object handlePutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
           
 Object handleRemoveDataCommand(InvocationContext ctx, RemoveDataCommand command)
           
 Object handleRemoveKeyCommand(InvocationContext ctx, RemoveKeyCommand command)
           
 Object handleRemoveNodeCommand(InvocationContext ctx, RemoveNodeCommand command)
           
 Object handleRollbackCommand(InvocationContext ctx, RollbackCommand command)
           
 void injectDependencies(DataContainer dataContainer, TransactionTable txTable, LockManager lockManager)
           
 
Methods inherited from class org.jboss.cache.interceptors.base.PostProcessingCommandInterceptor
handleExistsNodeCommand, handleGetDataMapCommand, handleGravitateDataCommand, handleInvalidateCommand, handleOptimisticPrepareCommand, visitCommitCommand, visitEvictFqnCommand, visitExistsNodeCommand, visitGetChildrenNamesCommand, visitGetDataMapCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand, visitOptimisticPrepareCommand, visitPrepareCommand, visitPutDataMapCommand, visitPutKeyValueCommand, visitRemoveDataCommand, visitRemoveKeyCommand, visitRemoveNodeCommand, visitRollbackCommand
 
Methods inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
dumpStatistics, getNext, getStatisticsEnabled, handleDefault, hasNext, invokeNextInterceptor, resetStatistics, setNext, setStatisticsEnabled
 
Methods inherited from class org.jboss.cache.commands.AbstractVisitor
visitCollection, visitCreateNodeCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PessimisticLockInterceptor

public PessimisticLockInterceptor()
Method Detail

injectDependencies

public void injectDependencies(DataContainer dataContainer,
                               TransactionTable txTable,
                               LockManager lockManager)

handlePutDataMapCommand

public Object handlePutDataMapCommand(InvocationContext ctx,
                                      PutDataMapCommand command)
                               throws Throwable
Overrides:
handlePutDataMapCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handlePutKeyValueCommand

public Object handlePutKeyValueCommand(InvocationContext ctx,
                                       PutKeyValueCommand command)
                                throws Throwable
Overrides:
handlePutKeyValueCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handlePrepareCommand

public Object handlePrepareCommand(InvocationContext ctx,
                                   PrepareCommand command)
                            throws Throwable
Overrides:
handlePrepareCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleCommitCommand

public Object handleCommitCommand(InvocationContext ctx,
                                  CommitCommand command)
                           throws Throwable
Overrides:
handleCommitCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleRollbackCommand

public Object handleRollbackCommand(InvocationContext ctx,
                                    RollbackCommand command)
                             throws Throwable
Overrides:
handleRollbackCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleMoveCommand

public Object handleMoveCommand(InvocationContext ctx,
                                MoveCommand command)
                         throws Throwable
Overrides:
handleMoveCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleRemoveNodeCommand

public Object handleRemoveNodeCommand(InvocationContext ctx,
                                      RemoveNodeCommand command)
                               throws Throwable
Overrides:
handleRemoveNodeCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleRemoveKeyCommand

public Object handleRemoveKeyCommand(InvocationContext ctx,
                                     RemoveKeyCommand command)
                              throws Throwable
Overrides:
handleRemoveKeyCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleRemoveDataCommand

public Object handleRemoveDataCommand(InvocationContext ctx,
                                      RemoveDataCommand command)
                               throws Throwable
Overrides:
handleRemoveDataCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleEvictFqnCommand

public Object handleEvictFqnCommand(InvocationContext ctx,
                                    EvictCommand command)
                             throws Throwable
Overrides:
handleEvictFqnCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleGetKeyValueCommand

public Object handleGetKeyValueCommand(InvocationContext ctx,
                                       GetKeyValueCommand command)
                                throws Throwable
Overrides:
handleGetKeyValueCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleGetNodeCommand

public Object handleGetNodeCommand(InvocationContext ctx,
                                   GetNodeCommand command)
                            throws Throwable
Overrides:
handleGetNodeCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleGetKeysCommand

public Object handleGetKeysCommand(InvocationContext ctx,
                                   GetKeysCommand command)
                            throws Throwable
Overrides:
handleGetKeysCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

handleGetChildrenNamesCommand

public Object handleGetChildrenNamesCommand(InvocationContext ctx,
                                            GetChildrenNamesCommand command)
                                     throws Throwable
Overrides:
handleGetChildrenNamesCommand in class PostProcessingCommandInterceptor
Throws:
Throwable

doAfterCall

public void doAfterCall(InvocationContext ctx,
                        VisitableCommand command)
Description copied from class: PostProcessingCommandInterceptor
Callback that is invoked after every handleXXX() method defined above.

Specified by:
doAfterCall in class PostProcessingCommandInterceptor
Parameters:
ctx - invocation context
command - command which was invoked


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