org.jboss.cache.interceptors
Class PassivationInterceptor

java.lang.Object
  extended by org.jboss.cache.commands.AbstractVisitor
      extended by org.jboss.cache.interceptors.base.CommandInterceptor
          extended by org.jboss.cache.interceptors.base.JmxStatsCommandInterceptor
              extended by org.jboss.cache.interceptors.PassivationInterceptor
All Implemented Interfaces:
Visitor, JmxStatisticsExposer
Direct Known Subclasses:
LegacyPassivationInterceptor

public class PassivationInterceptor
extends JmxStatsCommandInterceptor

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 7168 2008-11-19 17:37:20Z jason.greene@jboss.com $
Author:
{Hany Mesha}

Field Summary
protected  CacheLoader loader
           
 
Fields inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
PassivationInterceptor()
           
 
Method Summary
 Map<String,Object> dumpStatistics()
          Returns a map of statistics.
 long getPassivations()
           
protected  void passivate(InvocationContext ctx, Fqn fqn)
           
 void resetStatistics()
          Resets statistics gathered.
 void setDependencies(Notifier notifier, CacheLoaderManager loaderManager)
           
 Object visitEvictFqnCommand(InvocationContext ctx, EvictCommand command)
          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.
 
Methods inherited from class org.jboss.cache.interceptors.base.JmxStatsCommandInterceptor
checkStatisticsUsed, getStatisticsEnabled, setStatisticsEnabled
 
Methods inherited from class org.jboss.cache.interceptors.base.CommandInterceptor
getNext, handleDefault, hasNext, invokeNextInterceptor, setNext
 
Methods inherited from class org.jboss.cache.commands.AbstractVisitor
visitClearDataCommand, visitCollection, visitCommitCommand, visitCreateNodeCommand, visitExistsNodeCommand, visitGetChildrenNamesCommand, visitGetDataMapCommand, visitGetKeysCommand, visitGetKeyValueCommand, visitGetNodeCommand, visitGravitateDataCommand, visitInvalidateCommand, visitMoveCommand, visitOptimisticPrepareCommand, visitPrepareCommand, visitPutDataMapCommand, visitPutForExternalReadCommand, visitPutKeyValueCommand, visitRemoveKeyCommand, visitRemoveNodeCommand, visitRollbackCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

protected CacheLoader loader
Constructor Detail

PassivationInterceptor

public PassivationInterceptor()
Method Detail

setDependencies

public void setDependencies(Notifier notifier,
                            CacheLoaderManager loaderManager)

visitEvictFqnCommand

public Object visitEvictFqnCommand(InvocationContext ctx,
                                   EvictCommand command)
                            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.

Specified by:
visitEvictFqnCommand in interface Visitor
Overrides:
visitEvictFqnCommand in class AbstractVisitor
Parameters:
ctx - invocation context
command - command to visit
Returns:
response from the visit
Throws:
Throwable - in the event of problems.

passivate

protected void passivate(InvocationContext ctx,
                         Fqn fqn)
                  throws Throwable
Throws:
Throwable

resetStatistics

public void resetStatistics()
Description copied from class: JmxStatsCommandInterceptor
Resets statistics gathered. Is a no-op, and should be overridden if it is to be meaningful.

Specified by:
resetStatistics in interface JmxStatisticsExposer
Overrides:
resetStatistics in class JmxStatsCommandInterceptor

dumpStatistics

public Map<String,Object> dumpStatistics()
Description copied from class: JmxStatsCommandInterceptor
Returns a map of statistics. This is a default implementation which returns an empty map and should be overridden if it is to be meaningful.

Specified by:
dumpStatistics in interface JmxStatisticsExposer
Overrides:
dumpStatistics in class JmxStatsCommandInterceptor
Returns:
an empty map

getPassivations

public long getPassivations()


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