org.jboss.cache.interceptors
Class OptimisticValidatorInterceptor
java.lang.Object
org.jboss.cache.interceptors.Interceptor
org.jboss.cache.interceptors.OptimisticInterceptor
org.jboss.cache.interceptors.OptimisticValidatorInterceptor
- All Implemented Interfaces:
- InterceptorMBean
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 DataVersioningException
s.
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.
- Author:
- Manik Surtani (manik@jboss.org), Steve Woodcock (stevew@jofti.com)
Methods inherited from class org.jboss.cache.interceptors.Interceptor |
dumpStatistics, getLast, getNext, getStatisticsEnabled, isActive, isOnePhaseCommitPrepareMehod, isPreparing, isValid, resetStatistics, setLast, setNext, setStatisticsEnabled, toString |
OptimisticValidatorInterceptor
public OptimisticValidatorInterceptor()
setCache
public void setCache(CacheSPI cache)
- Overrides:
setCache
in class OptimisticInterceptor
invoke
public Object invoke(InvocationContext ctx)
throws Throwable
- Overrides:
invoke
in class Interceptor
- Throws:
Throwable
Copyright © 2007 JBoss, a division of Red Hat. All Rights Reserved.