org.jboss.cache.interceptors
Class OptimisticInterceptor
java.lang.Object
org.jboss.cache.commands.AbstractVisitor
org.jboss.cache.interceptors.base.CommandInterceptor
org.jboss.cache.interceptors.OptimisticInterceptor
- All Implemented Interfaces:
- Visitor, InterceptorMBean
- Direct Known Subclasses:
- OptimisticCreateIfNotExistsInterceptor, OptimisticLockingInterceptor, OptimisticNodeInterceptor, OptimisticValidatorInterceptor
public abstract class OptimisticInterceptor
- extends CommandInterceptor
Abstract interceptor for optimistic locking
- Author:
- Manik Surtani (manik@jboss.org)
Method Summary |
protected GlobalTransaction |
getGlobalTransaction(InvocationContext ctx)
|
protected TransactionWorkspace |
getTransactionWorkspace(InvocationContext ctx)
|
protected void |
greedyGetFqns(List<Fqn> list,
NodeSPI<?,?> n,
Fqn newBase)
Adds the Fqn of the node as well as all children and childrens children to the list. |
protected WorkspaceNode |
lockAndCreateWorkspaceNode(NodeFactory nodeFactory,
NodeSPI node,
TransactionWorkspace workspace,
GlobalTransaction gtx,
long timeout)
|
protected void |
undeleteWorkspaceNode(WorkspaceNode nodeToUndelete,
TransactionWorkspace workspace)
|
protected void |
undeleteWorkspaceNode(WorkspaceNode nodeToUndelete,
WorkspaceNode parent)
Undeletes a node that already exists in the workspace, by setting appropriate flags and re-adding to parent's child map. |
Methods inherited from class org.jboss.cache.commands.AbstractVisitor |
visitClearDataCommand, visitCollection, 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 |
txManager
protected TransactionManager txManager
txTable
protected TransactionTable txTable
lockManager
protected LockManager lockManager
OptimisticInterceptor
public OptimisticInterceptor()
getTransactionWorkspace
protected TransactionWorkspace getTransactionWorkspace(InvocationContext ctx)
throws CacheException
- Throws:
CacheException
greedyGetFqns
protected void greedyGetFqns(List<Fqn> list,
NodeSPI<?,?> n,
Fqn newBase)
- Adds the Fqn of the node as well as all children and childrens children to the list.
getGlobalTransaction
protected GlobalTransaction getGlobalTransaction(InvocationContext ctx)
throws CacheException
- Returns:
- the
GlobalTransaction
, extracted from the current InvocationContext
.
- Throws:
CacheException
- if the GlobalTransaction
or Transaction
associated with the
InvocationContext
is null.
undeleteWorkspaceNode
protected void undeleteWorkspaceNode(WorkspaceNode nodeToUndelete,
TransactionWorkspace workspace)
undeleteWorkspaceNode
protected void undeleteWorkspaceNode(WorkspaceNode nodeToUndelete,
WorkspaceNode parent)
- Undeletes a node that already exists in the workspace, by setting appropriate flags and re-adding to parent's child map.
- Parameters:
nodeToUndelete
- WorkspaceNode to undeleteparent
- parent of node to undelete
lockAndCreateWorkspaceNode
protected WorkspaceNode lockAndCreateWorkspaceNode(NodeFactory nodeFactory,
NodeSPI node,
TransactionWorkspace workspace,
GlobalTransaction gtx,
long timeout)
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.