org.infinispan.interceptors
Class CacheStoreInterceptor

java.lang.Object
  extended by org.infinispan.commands.AbstractVisitor
      extended by org.infinispan.interceptors.base.CommandInterceptor
          extended by org.infinispan.interceptors.base.JmxStatsCommandInterceptor
              extended by org.infinispan.interceptors.CacheStoreInterceptor
All Implemented Interfaces:
Visitor, JmxStatisticsExposer
Direct Known Subclasses:
DistCacheStoreInterceptor

public class CacheStoreInterceptor
extends JmxStatsCommandInterceptor

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.

Since:
4.0
Author:
Bela Ban

Nested Class Summary
 class CacheStoreInterceptor.StoreModificationsBuilder
           
 
Field Summary
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
configuration
 
Constructor Summary
CacheStoreInterceptor()
           
 
Method Summary
protected  void clearCacheStore()
           
protected  void commitCommand(TxInvocationContext ctx)
           
 long getCacheLoaderStores()
           
protected  Log getLog()
           
protected  void init(CacheLoaderManager loaderManager, InternalEntryFactory entryFactory, TransactionManager transactionManager)
           
protected  void prepareCacheLoader(TxInvocationContext ctx, GlobalTransaction gtx, TxInvocationContext transactionContext, boolean onePhase)
           
 void resetStatistics()
          Resets statistics gathered.
protected  boolean skip(InvocationContext ctx)
          if this is a shared cache loader and the call is of remote origin, pass up the chain
protected  boolean skipKey(Object key)
           
protected  void start()
           
 Object visitClearCommand(InvocationContext ctx, ClearCommand command)
           
 Object visitCommitCommand(TxInvocationContext ctx, CommitCommand command)
           
 Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand command)
           
 Object visitPutKeyValueCommand(InvocationContext ctx, PutKeyValueCommand command)
           
 Object visitPutMapCommand(InvocationContext ctx, PutMapCommand command)
           
 Object visitRemoveCommand(InvocationContext ctx, RemoveCommand command)
           
 Object visitReplaceCommand(InvocationContext ctx, ReplaceCommand command)
           
 Object visitRollbackCommand(TxInvocationContext ctx, RollbackCommand command)
           
 
Methods inherited from class org.infinispan.interceptors.base.JmxStatsCommandInterceptor
checkStatisticsUsed, getStatisticsEnabled, setStatisticsEnabled
 
Methods inherited from class org.infinispan.interceptors.base.CommandInterceptor
getNext, handleDefault, hasNext, invokeNextInterceptor, setNext
 
Methods inherited from class org.infinispan.commands.AbstractVisitor
visitApplyDeltaCommand, visitCollection, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheStoreInterceptor

public CacheStoreInterceptor()
Method Detail

getLog

protected Log getLog()
Overrides:
getLog in class CommandInterceptor

init

protected void init(CacheLoaderManager loaderManager,
                    InternalEntryFactory entryFactory,
                    TransactionManager transactionManager)

start

protected void start()

skip

protected boolean skip(InvocationContext ctx)
if this is a shared cache loader and the call is of remote origin, pass up the chain


visitCommitCommand

public Object visitCommitCommand(TxInvocationContext ctx,
                                 CommitCommand command)
                          throws Throwable
Specified by:
visitCommitCommand in interface Visitor
Overrides:
visitCommitCommand in class AbstractVisitor
Throws:
Throwable

commitCommand

protected void commitCommand(TxInvocationContext ctx)
                      throws Throwable
Throws:
Throwable

visitRollbackCommand

public Object visitRollbackCommand(TxInvocationContext ctx,
                                   RollbackCommand command)
                            throws Throwable
Specified by:
visitRollbackCommand in interface Visitor
Overrides:
visitRollbackCommand in class AbstractVisitor
Throws:
Throwable

visitPrepareCommand

public Object visitPrepareCommand(TxInvocationContext ctx,
                                  PrepareCommand command)
                           throws Throwable
Specified by:
visitPrepareCommand in interface Visitor
Overrides:
visitPrepareCommand in class AbstractVisitor
Throws:
Throwable

visitRemoveCommand

public Object visitRemoveCommand(InvocationContext ctx,
                                 RemoveCommand command)
                          throws Throwable
Specified by:
visitRemoveCommand in interface Visitor
Overrides:
visitRemoveCommand in class AbstractVisitor
Throws:
Throwable

visitClearCommand

public Object visitClearCommand(InvocationContext ctx,
                                ClearCommand command)
                         throws Throwable
Specified by:
visitClearCommand in interface Visitor
Overrides:
visitClearCommand in class AbstractVisitor
Throws:
Throwable

clearCacheStore

protected void clearCacheStore()
                        throws CacheLoaderException
Throws:
CacheLoaderException

visitPutKeyValueCommand

public Object visitPutKeyValueCommand(InvocationContext ctx,
                                      PutKeyValueCommand command)
                               throws Throwable
Specified by:
visitPutKeyValueCommand in interface Visitor
Overrides:
visitPutKeyValueCommand in class AbstractVisitor
Throws:
Throwable

visitReplaceCommand

public Object visitReplaceCommand(InvocationContext ctx,
                                  ReplaceCommand command)
                           throws Throwable
Specified by:
visitReplaceCommand in interface Visitor
Overrides:
visitReplaceCommand in class AbstractVisitor
Throws:
Throwable

visitPutMapCommand

public Object visitPutMapCommand(InvocationContext ctx,
                                 PutMapCommand command)
                          throws Throwable
Specified by:
visitPutMapCommand in interface Visitor
Overrides:
visitPutMapCommand in class AbstractVisitor
Throws:
Throwable

prepareCacheLoader

protected final void prepareCacheLoader(TxInvocationContext ctx,
                                        GlobalTransaction gtx,
                                        TxInvocationContext transactionContext,
                                        boolean onePhase)
                                 throws Throwable
Throws:
Throwable

skipKey

protected boolean skipKey(Object key)

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

getCacheLoaderStores

public long getCacheLoaderStores()

-->

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