org.jboss.cache.interceptors
Class CacheStoreInterceptor
java.lang.Object
org.jboss.cache.interceptors.Interceptor
org.jboss.cache.interceptors.CacheStoreInterceptor
- All Implemented Interfaces:
- CacheStoreInterceptorMBean, InterceptorMBean
public class CacheStoreInterceptor
- extends Interceptor
- implements CacheStoreInterceptorMBean
Writes modifications back to the store on the way out: stores modifications back
through the CacheLoader, either after each method call (no TXs), or at TX commit.
- Version:
- $Id: CacheStoreInterceptor.java 4663 2007-10-22 23:08:18Z manik.surtani@jboss.com $
- Author:
- Bela Ban
Methods inherited from class org.jboss.cache.interceptors.Interceptor |
getLast, getNext, getStatisticsEnabled, isActive, isOnePhaseCommitPrepareMehod, isPreparing, isValid, setLast, setNext, setStatisticsEnabled, toString |
loaderConfig
protected CacheLoaderConfig loaderConfig
tx_mgr
protected TransactionManager tx_mgr
tx_table
protected TransactionTable tx_table
loader
protected CacheLoader loader
CacheStoreInterceptor
public CacheStoreInterceptor()
setCache
public void setCache(CacheSPI cache)
- Overrides:
setCache
in class Interceptor
invoke
public Object invoke(InvocationContext ctx)
throws Throwable
- Pass the method on. When it returns, store the modification back to the store using the CacheLoader.
In case of a transaction, register for TX completion (2PC) and at TX commit, write modifications made
under the given TX to the CacheLoader
- Overrides:
invoke
in class Interceptor
- Returns:
-
- Throws:
Throwable
getCacheLoaderStores
public long getCacheLoaderStores()
- Description copied from interface:
CacheStoreInterceptorMBean
- Returns the number of cache loader stores
- Specified by:
getCacheLoaderStores
in interface CacheStoreInterceptorMBean
- Returns:
- the number of cache loader stores
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 © 2007 JBoss, a division of Red Hat. All Rights Reserved.