org.jboss.cache.interceptors
Class OptimisticValidatorInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.OptimisticInterceptor
          extended by org.jboss.cache.interceptors.OptimisticValidatorInterceptor
All Implemented Interfaces:
InterceptorMBean

public class OptimisticValidatorInterceptor
extends OptimisticInterceptor

Validates the data in the transaction workspace against data in the actual cache (versions only), and then performs commits if necessary. Does not pass on prepare/commit/rollbacks to the other interceptors.

Currently uses simplistic integer based versioning and validation. Plans are to have this configurable as there will always be a performance/complexity tradeoff.

On the commit it applies the changes in the workspace to the real nodes in the cache.

On rollback clears the nodes in the workspace.

Author:
Manik Surtani (manik@jboss.org), Steve Woodcock (stevew@jofti.com)

Field Summary
 
Fields inherited from class org.jboss.cache.interceptors.OptimisticInterceptor
txManager, txTable
 
Constructor Summary
OptimisticValidatorInterceptor()
           
 
Method Summary
 java.lang.Object invoke(org.jgroups.blocks.MethodCall m)
           
 void setCache(TreeCache cache)
          Set of GlobalTransactions that originated somewhere else (we didn't create them).
 
Methods inherited from class org.jboss.cache.interceptors.OptimisticInterceptor
getTransactionWorkspace
 
Methods inherited from class org.jboss.cache.interceptors.Interceptor
dumpStatistics, getInvocationContext, getNext, getStatisticsEnabled, isActive, isOnePhaseCommitPrepareMehod, isPreparing, isTransactionLifecycleMethod, isValid, resetStatistics, setInvocationContext, setNext, setStatisticsEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptimisticValidatorInterceptor

public OptimisticValidatorInterceptor()
Method Detail

setCache

public void setCache(TreeCache cache)
Set of GlobalTransactions that originated somewhere else (we didn't create them). This is a result of a PREPARE phase. GlobalTransactions in this list should be ignored by this interceptor when registering for TX completion

Overrides:
setCache in class OptimisticInterceptor

invoke

public java.lang.Object invoke(org.jgroups.blocks.MethodCall m)
                        throws java.lang.Throwable
Overrides:
invoke in class Interceptor
Throws:
java.lang.Throwable


Copyright © 1998-2005 JBoss Inc . All Rights Reserved.