org.jboss.cache.interceptors
Class OptimisticInterceptor
java.lang.Object
org.jboss.cache.interceptors.Interceptor
org.jboss.cache.interceptors.MethodDispacherInterceptor
org.jboss.cache.interceptors.OptimisticInterceptor
- All Implemented Interfaces:
- InterceptorMBean
- Direct Known Subclasses:
- OptimisticCreateIfNotExistsInterceptor, OptimisticLockingInterceptor, OptimisticNodeInterceptor, OptimisticValidatorInterceptor
public abstract class OptimisticInterceptor
- extends MethodDispacherInterceptor
Abstract interceptor for optimistic locking
- Author:
- Manik Surtani (manik@jboss.org)
Method Summary |
protected GlobalTransaction |
getGlobalTransaction(InvocationContext ctx)
|
protected TransactionWorkspace |
getTransactionWorkspace(GlobalTransaction gtx)
|
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.interceptors.MethodDispacherInterceptor |
handleAddChildMethod, handleBlockChannelMethod, handleCommitMethod, handleDataGravitationCleanupMethod, handleEvictMethod, handleEvictVersionedNodeMethod, handleExistsMethod, handleGetDataMapMethod, handleGetChildrenNamesMethod, handleGetKeysMethod, handleGetKeyValueMethod, handleGetNodeMethod, handleLockMethod, handleMoveMethod, handleOptimisticPrepareMethod, handlePrepareMethod, handlePrintMethod, handlePutDataEraseMethod, handlePutDataEraseVersionedMethod, handlePutDataMethod, handlePutDataVersionedMethod, handlePutForExternalReadMethod, handlePutForExternalReadVersionedMethod, handlePutKeyValueMethod, handlePutKeyValueVersionedMethod, handleReleaseAllLocksMethod, handleRemoveDataMethod, handleRemoveDataVersionedMethod, handleRemoveKeyMethod, handleRemoveKeyVersionedMethod, handleRemoveNodeMethod, handleRemoveNodeVersionedMethod, handleRollbackMethod, handleUnblockChannelMethod, invoke, skipMethodCall |
Methods inherited from class org.jboss.cache.interceptors.Interceptor |
assertTransactionValid, dumpStatistics, getLast, getNext, getStatisticsEnabled, initLogger, isActive, isPreparing, isValid, nextInterceptor, peekNode, resetStatistics, setCache, setLast, setNext, setStatisticsEnabled, toString |
txManager
protected TransactionManager txManager
txTable
protected TransactionTable txTable
OptimisticInterceptor
public OptimisticInterceptor()
getTransactionWorkspace
protected TransactionWorkspace getTransactionWorkspace(GlobalTransaction gtx)
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.
- Parameters:
list
- n
-
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 undelete
lockAndCreateWorkspaceNode
protected WorkspaceNode lockAndCreateWorkspaceNode(NodeFactory nodeFactory,
NodeSPI node,
TransactionWorkspace workspace,
GlobalTransaction gtx,
long timeout)
Copyright © 2008 JBoss, a division of Red Hat. All Rights Reserved.