org.jboss.cache.interceptors
Class PessimisticLockInterceptor
java.lang.Object
org.jboss.cache.commands.AbstractVisitor
org.jboss.cache.interceptors.base.CommandInterceptor
org.jboss.cache.interceptors.base.PostProcessingCommandInterceptor
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 6000 2008-06-17 23:43:54Z manik.surtani@jboss.com $
- Author:
- Bela Ban
Method Summary |
void |
doAfterCall(InvocationContext ctx,
VisitableCommand command)
Callback that is invoked after every handleXXX() method defined above. |
protected Object |
handleClearDataCommand(InvocationContext ctx,
ClearDataCommand command)
|
protected Object |
handleCommitCommand(InvocationContext ctx,
CommitCommand command)
|
protected Object |
handleEvictFqnCommand(InvocationContext ctx,
EvictCommand command)
|
protected Object |
handleGetChildrenNamesCommand(InvocationContext ctx,
GetChildrenNamesCommand command)
|
protected Object |
handleGetKeysCommand(InvocationContext ctx,
GetKeysCommand command)
|
protected Object |
handleGetKeyValueCommand(InvocationContext ctx,
GetKeyValueCommand command)
|
protected Object |
handleGetNodeCommand(InvocationContext ctx,
GetNodeCommand command)
|
protected Object |
handleMoveCommand(InvocationContext ctx,
MoveCommand command)
|
protected Object |
handlePrepareCommand(InvocationContext ctx,
PrepareCommand command)
|
protected Object |
handlePutDataMapCommand(InvocationContext ctx,
PutDataMapCommand command)
|
protected Object |
handlePutForExternalReadCommand(InvocationContext ctx,
PutForExternalReadCommand command)
|
protected Object |
handlePutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
|
protected Object |
handleRemoveKeyCommand(InvocationContext ctx,
RemoveKeyCommand command)
|
protected Object |
handleRemoveNodeCommand(InvocationContext ctx,
RemoveNodeCommand command)
|
protected Object |
handleRollbackCommand(InvocationContext ctx,
RollbackCommand command)
|
void |
injectDependencies(DataContainer dataContainer,
LockManager lockManager,
CommandsFactory commandsFactory)
|
void |
lockAllForRemoval(NodeSPI node,
InvocationContext ctx,
TransactionEntry entry)
Acquires write locks on the node and all child nodes, adding children to the list of removed nodes in the context. |
Methods inherited from class org.jboss.cache.interceptors.base.PostProcessingCommandInterceptor |
handleCreateNodeCommand, handleExistsNodeCommand, handleGetDataMapCommand, handleGravitateDataCommand, handleInvalidateCommand, handleOptimisticPrepareCommand, visitClearDataCommand, visitCommitCommand, visitCreateNodeCommand, visitEvictFqnCommand, visitExistsNodeCommand, visitGetChildrenNamesCommand, visitGetDataMapCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand, visitOptimisticPrepareCommand, visitPrepareCommand, visitPutDataMapCommand, visitPutForExternalReadCommand, visitPutKeyValueCommand, visitRemoveKeyCommand, visitRemoveNodeCommand, visitRollbackCommand |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PessimisticLockInterceptor
public PessimisticLockInterceptor()
injectDependencies
public void injectDependencies(DataContainer dataContainer,
LockManager lockManager,
CommandsFactory commandsFactory)
handlePutDataMapCommand
protected Object handlePutDataMapCommand(InvocationContext ctx,
PutDataMapCommand command)
throws Throwable
- Overrides:
handlePutDataMapCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handlePutKeyValueCommand
protected Object handlePutKeyValueCommand(InvocationContext ctx,
PutKeyValueCommand command)
throws Throwable
- Overrides:
handlePutKeyValueCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handlePutForExternalReadCommand
protected Object handlePutForExternalReadCommand(InvocationContext ctx,
PutForExternalReadCommand command)
throws Throwable
- Overrides:
handlePutForExternalReadCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handlePrepareCommand
protected Object handlePrepareCommand(InvocationContext ctx,
PrepareCommand command)
throws Throwable
- Overrides:
handlePrepareCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleCommitCommand
protected Object handleCommitCommand(InvocationContext ctx,
CommitCommand command)
throws Throwable
- Overrides:
handleCommitCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleRollbackCommand
protected Object handleRollbackCommand(InvocationContext ctx,
RollbackCommand command)
throws Throwable
- Overrides:
handleRollbackCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleMoveCommand
protected Object handleMoveCommand(InvocationContext ctx,
MoveCommand command)
throws Throwable
- Overrides:
handleMoveCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleRemoveNodeCommand
protected Object handleRemoveNodeCommand(InvocationContext ctx,
RemoveNodeCommand command)
throws Throwable
- Overrides:
handleRemoveNodeCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
lockAllForRemoval
public void lockAllForRemoval(NodeSPI node,
InvocationContext ctx,
TransactionEntry entry)
throws InterruptedException
- Acquires write locks on the node and all child nodes, adding children to the list of removed nodes in the context.
- Parameters:
node
- node to inspectctx
- invocation contextentry
- transaction entry
- Throws:
InterruptedException
- in the event of interruption
handleRemoveKeyCommand
protected Object handleRemoveKeyCommand(InvocationContext ctx,
RemoveKeyCommand command)
throws Throwable
- Overrides:
handleRemoveKeyCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleClearDataCommand
protected Object handleClearDataCommand(InvocationContext ctx,
ClearDataCommand command)
throws Throwable
- Overrides:
handleClearDataCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleEvictFqnCommand
protected Object handleEvictFqnCommand(InvocationContext ctx,
EvictCommand command)
throws Throwable
- Overrides:
handleEvictFqnCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleGetKeyValueCommand
protected Object handleGetKeyValueCommand(InvocationContext ctx,
GetKeyValueCommand command)
throws Throwable
- Overrides:
handleGetKeyValueCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleGetNodeCommand
protected Object handleGetNodeCommand(InvocationContext ctx,
GetNodeCommand command)
throws Throwable
- Overrides:
handleGetNodeCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleGetKeysCommand
protected Object handleGetKeysCommand(InvocationContext ctx,
GetKeysCommand command)
throws Throwable
- Overrides:
handleGetKeysCommand
in class PostProcessingCommandInterceptor
- Throws:
Throwable
handleGetChildrenNamesCommand
protected 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 contextcommand
- command which was invoked
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.