org.jboss.cache.interceptors
Class PassivationInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.MethodDispacherInterceptor
          extended by org.jboss.cache.interceptors.PassivationInterceptor
All Implemented Interfaces:
InterceptorMBean, PassivationInterceptorMBean

public class PassivationInterceptor
extends MethodDispacherInterceptor
implements PassivationInterceptorMBean

Writes evicted nodes back to the store on the way in through the CacheLoader, either before each method call (no TXs), or at TX commit.

Version:
$Id: PassivationInterceptor.java 4986 2008-01-04 16:55:01Z manik.surtani@jboss.com $
Author:
{Hany Mesha}

Field Summary
protected  CacheLoader loader
           
 
Fields inherited from class org.jboss.cache.interceptors.Interceptor
cache, configuration, last, log, next, trace
 
Constructor Summary
PassivationInterceptor()
           
 
Method Summary
 Map<String,Object> dumpStatistics()
          This implementation returns an empty Map.
 long getPassivations()
          Returns the number of cache node passivations
protected  Object handleEvictMethod(InvocationContext ctx, Fqn fqn)
          Notifies the cache instance listeners that the evicted node is about to be passivated and stores the evicted node and its attributes back to the store using the CacheLoader.
 void resetStatistics()
          This implementation is a no-op.
 void setCache(CacheSPI cache)
           
 
Methods inherited from class org.jboss.cache.interceptors.MethodDispacherInterceptor
handleAddChildMethod, handleBlockChannelMethod, handleCommitMethod, handleDataGravitationCleanupMethod, 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, getLast, getNext, getStatisticsEnabled, initLogger, isActive, isPreparing, isValid, nextInterceptor, peekNode, setLast, setNext, setStatisticsEnabled, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.interceptors.InterceptorMBean
getStatisticsEnabled, setStatisticsEnabled
 

Field Detail

loader

protected CacheLoader loader
Constructor Detail

PassivationInterceptor

public PassivationInterceptor()
Method Detail

setCache

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

handleEvictMethod

protected Object handleEvictMethod(InvocationContext ctx,
                                   Fqn fqn)
                            throws Throwable
Notifies the cache instance listeners that the evicted node is about to be passivated and stores the evicted node and its attributes back to the store using the CacheLoader.

Overrides:
handleEvictMethod in class MethodDispacherInterceptor
Throws:
Throwable

getPassivations

public long getPassivations()
Description copied from interface: PassivationInterceptorMBean
Returns the number of cache node passivations

Specified by:
getPassivations in interface PassivationInterceptorMBean
Returns:
the number of cache node passivations

resetStatistics

public void resetStatistics()
Description copied from class: Interceptor
This implementation is a no-op. If individual Interceptors wish to expose statistics, they can override this method.

Specified by:
resetStatistics in interface InterceptorMBean
Overrides:
resetStatistics in class Interceptor

dumpStatistics

public Map<String,Object> dumpStatistics()
Description copied from class: Interceptor
This implementation returns an empty Map. If individual Interceptors wish to expose statistics, they can override this method.

Specified by:
dumpStatistics in interface InterceptorMBean
Overrides:
dumpStatistics in class Interceptor
Returns:
a map containing statistics


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