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, log, trace
 
Constructor Summary
CacheStoreInterceptor()
           
 
Method Summary
 long getCacheLoaderStores()
           
protected  void init(CacheLoaderManager loaderManager)
           
 void resetStatistics()
          Resets statistics gathered.
 boolean skip(InvocationContext ctx, VisitableCommand command)
          if this is a shared cache loader and the call is of remote origin, pass up the chain
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
visitCollection, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitKeySetCommand, visitLockControlCommand, visitSizeCommand, 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

init

protected void init(CacheLoaderManager loaderManager)

start

protected void start()

skip

public final boolean skip(InvocationContext ctx,
                          VisitableCommand command)
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

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

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

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()

Google Analytics

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