org.jboss.cache.interceptors
Class OptimisticInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.OptimisticInterceptor
All Implemented Interfaces:
InterceptorMBean
Direct Known Subclasses:
OptimisticCreateIfNotExistsInterceptor, OptimisticLockingInterceptor, OptimisticNodeInterceptor, OptimisticValidatorInterceptor

public class OptimisticInterceptor
extends Interceptor

Abstract interceptor for optimistic locking

Author:
Manik Surtani (manik@jboss.org)

Field Summary
protected  boolean trace
           
protected  javax.transaction.TransactionManager txManager
           
protected  TransactionTable txTable
           
 
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next
 
Constructor Summary
OptimisticInterceptor()
           
 
Method Summary
protected  GlobalTransaction getGlobalTransaction(InvocationContext ctx)
           
protected  TransactionWorkspace getTransactionWorkspace(GlobalTransaction gtx)
           
protected  void greedyGetFqns(java.util.List<Fqn> list, NodeSPI<?,?> n, Fqn newBase)
          Adds the Fqn of the node as well as all children and childrens children to the list.
 void setCache(CacheSPI cache)
           
 
Methods inherited from class org.jboss.cache.interceptors.Interceptor
dumpStatistics, getLast, getNext, getStatisticsEnabled, invoke, isActive, isOnePhaseCommitPrepareMehod, isPreparing, isValid, resetStatistics, 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 javax.transaction.TransactionManager txManager

txTable

protected TransactionTable txTable

trace

protected boolean trace
Constructor Detail

OptimisticInterceptor

public OptimisticInterceptor()
Method Detail

setCache

public void setCache(CacheSPI cache)
Overrides:
setCache in class Interceptor

getTransactionWorkspace

protected TransactionWorkspace getTransactionWorkspace(GlobalTransaction gtx)
                                                throws CacheException
Throws:
CacheException

greedyGetFqns

protected void greedyGetFqns(java.util.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.