org.jboss.cache.interceptors
Class CacheStoreInterceptor

java.lang.Object
  |
  +--org.jboss.cache.interceptors.Interceptor
        |
        +--org.jboss.cache.interceptors.CacheStoreInterceptor

public class CacheStoreInterceptor
extends Interceptor

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,v 1.4 2005/07/22 14:33:51 hmesha Exp $
Author:
Bela Ban

Field Summary
protected  CacheLoader loader
           
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
           
 
Constructor Summary
CacheStoreInterceptor()
           
 
Method Summary
protected  Modification convertMethodCallToModification(org.jgroups.blocks.MethodCall methodCall)
           
protected  CacheLoader getLoader()
           
 java.lang.Object invoke(org.jgroups.blocks.MethodCall m)
          Pass the method on.
 void setCache(TreeCache cache)
           
 
Methods inherited from class org.jboss.cache.interceptors.Interceptor
getNext, setNext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

loader

protected CacheLoader loader

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

CacheStoreInterceptor

public CacheStoreInterceptor()
Method Detail

setCache

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

invoke

public java.lang.Object invoke(org.jgroups.blocks.MethodCall m)
                        throws java.lang.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
Parameters:
m -
Returns:
Throws:
java.lang.Throwable

getLoader

protected CacheLoader getLoader()

convertMethodCallToModification

protected Modification convertMethodCallToModification(org.jgroups.blocks.MethodCall methodCall)
                                                throws java.lang.Exception
java.lang.Exception


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