org.jboss.cache.interceptors
Class OptimisticInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.MethodDispacherInterceptor
          extended by 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)

Field Summary
protected  TransactionManager txManager
           
protected  TransactionTable txTable
           
 
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next, trace
 
Constructor Summary
OptimisticInterceptor()
           
 
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.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

txManager

protected TransactionManager txManager

txTable

protected TransactionTable txTable
Constructor Detail

OptimisticInterceptor

public OptimisticInterceptor()
Method Detail

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.


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