org.jboss.cache.interceptors
Class ActivationInterceptor

java.lang.Object
  extended by org.jboss.cache.interceptors.Interceptor
      extended by org.jboss.cache.interceptors.BaseCacheLoaderInterceptor
          extended by org.jboss.cache.interceptors.CacheLoaderInterceptor
              extended by org.jboss.cache.interceptors.ActivationInterceptor
All Implemented Interfaces:
ActivationInterceptorMBean, CacheLoaderInterceptorMBean, InterceptorMBean

public class ActivationInterceptor
extends CacheLoaderInterceptor
implements ActivationInterceptorMBean

Loads nodes that don't exist at the time of the call into memory from the CacheLoader. If the nodes were evicted earlier then we remove them from the cache loader after their attributes have been initialized and their children have been loaded in memory.

Version:
$Id: ActivationInterceptor.java,v 1.22 2006/02/18 20:45:54 jerrygauth Exp $
Author:
{Hany Mesha}

Field Summary
protected static java.lang.Object NULL
           
protected  EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap transactions
          List that we have registered for
protected  javax.transaction.TransactionManager tx_mgr
           
protected  TransactionTable tx_table
           
 
Fields inherited from class org.jboss.cache.interceptors.BaseCacheLoaderInterceptor
loader
 
Constructor Summary
ActivationInterceptor()
           
 
Method Summary
 java.util.Map dumpStatistics()
          Returns a map of the cache interceptor's statistics Map elements consist of {String name, Object value} entries
 long getActivations()
          Returns the number of cache node activations
protected  CacheLoader getLoader()
           
protected  boolean hasModifications(java.lang.Object[] args)
           
 java.lang.Object invoke(org.jgroups.blocks.MethodCall m)
          Makes sure a node is loaded into memory before a call executes.
 void resetStatistics()
          Resets an interceptor's cache statistics
 
Methods inherited from class org.jboss.cache.interceptors.CacheLoaderInterceptor
getCacheLoaderLoads, getCacheLoaderMisses, getNode, loadNode, lock, setCache
 
Methods inherited from class org.jboss.cache.interceptors.BaseCacheLoaderInterceptor
obtainLoaderLock, obtainLoaderLocks, releaseLoaderLock, releaseLoaderLocks
 
Methods inherited from class org.jboss.cache.interceptors.Interceptor
getInvocationContext, getNext, getStatisticsEnabled, isActive, isOnePhaseCommitPrepareMehod, isPreparing, isTransactionLifecycleMethod, isValid, setInvocationContext, setNext, setStatisticsEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.cache.interceptors.CacheLoaderInterceptorMBean
getCacheLoaderLoads, getCacheLoaderMisses
 
Methods inherited from interface org.jboss.cache.interceptors.InterceptorMBean
getStatisticsEnabled, setStatisticsEnabled
 

Field Detail

tx_mgr

protected javax.transaction.TransactionManager tx_mgr

tx_table

protected TransactionTable tx_table

transactions

protected EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap transactions
List that we have registered for


NULL

protected static final java.lang.Object NULL
Constructor Detail

ActivationInterceptor

public ActivationInterceptor()
Method Detail

invoke

public java.lang.Object invoke(org.jgroups.blocks.MethodCall m)
                        throws java.lang.Throwable
Makes sure a node is loaded into memory before a call executes. If node is already loaded and its attributes already initialized, then remove it from the cache loader and notify the cache listeners that the node has been activated.

Overrides:
invoke in class CacheLoaderInterceptor
Parameters:
m -
Returns:
Throws:
java.lang.Throwable

getActivations

public long getActivations()
Description copied from interface: ActivationInterceptorMBean
Returns the number of cache node activations

Specified by:
getActivations in interface ActivationInterceptorMBean
Returns:
the number of cache node activations

resetStatistics

public void resetStatistics()
Description copied from interface: InterceptorMBean
Resets an interceptor's cache statistics

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

dumpStatistics

public java.util.Map dumpStatistics()
Description copied from interface: InterceptorMBean
Returns a map of the cache interceptor's statistics Map elements consist of {String name, Object value} entries

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

hasModifications

protected boolean hasModifications(java.lang.Object[] args)

getLoader

protected CacheLoader getLoader()


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