Class OptimisticValidatorInterceptor

  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.OptimisticInterceptor
          extended by org.jboss.cache.interceptors.OptimisticValidatorInterceptor
All Implemented Interfaces:

public class OptimisticValidatorInterceptor
extends OptimisticInterceptor

Validates the data in the TransactionWorkspace against data in the underlying data structure (versions only) and then applies changes to the underlying data structure. This is only triggered when commit, rollback or prepare method calls are encountered. Other method calls are directly passed up the interceptor chain, untouched. Note that prepare/commit/rollbacks are not passed up the interceptor chain after being processed.

When preparting, this interceptor does nothing more than validate versions. The validation scheme used is based on the DataVersion implementation used. DataVersion.newerThan(org.jboss.cache.optimistic.DataVersion) is used to determine whether the version of one instance is newer than the version of another. It is up to the DataVersion implementation to deal with attempting to compare incompatible version types (and potentially throwing DataVersioningExceptions.

Upon successful commit, changes in the workspace are applied to the underlying data structure in the cache.

On rollback clears the nodes in the workspace and leaves the underlying data structure untouched.

Manik Surtani (, Steve Woodcock (

Field Summary
Fields inherited from class org.jboss.cache.interceptors.OptimisticInterceptor
trace, txManager, txTable
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next
Constructor Summary
Method Summary
 java.lang.Object invoke(InvocationContext ctx)
Methods inherited from class org.jboss.cache.interceptors.OptimisticInterceptor
getGlobalTransaction, getTransactionWorkspace, greedyGetFqns, setCache
Methods inherited from class org.jboss.cache.interceptors.Interceptor
dumpStatistics, getLast, getNext, getStatisticsEnabled, 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

Constructor Detail


public OptimisticValidatorInterceptor()
Method Detail


public java.lang.Object invoke(InvocationContext ctx)
                        throws java.lang.Throwable
invoke in class Interceptor