Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.interceptors
Class InvalidationInterceptor

java.lang.Object
  extended by org.infinispan.commands.AbstractVisitor
      extended by org.infinispan.interceptors.base.CommandInterceptor
          extended by org.infinispan.interceptors.base.BaseRpcInterceptor
              extended by org.infinispan.interceptors.InvalidationInterceptor
All Implemented Interfaces:
Visitor

public class InvalidationInterceptor
extends BaseRpcInterceptor

This interceptor acts as a replacement to the replication interceptor when the CacheImpl is configured with ClusteredSyncMode as INVALIDATE.

The idea is that rather than replicating changes to all caches in a cluster when write methods are called, simply broadcast an InvalidateCommand on the remote caches containing all keys modified. This allows the remote cache to look up the value in a shared cache loader which would have been updated with the changes.

Since:
4.0
Author:
Manik Surtani, Galder ZamarreƱo, Mircea.Markus@jboss.com

Nested Class Summary
static class InvalidationInterceptor.InvalidationFilterVisitor
           
 
Field Summary
 
Fields inherited from class org.infinispan.interceptors.base.BaseRpcInterceptor
defaultSynchronous, rpcManager
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
cacheConfiguration
 
Constructor Summary
InvalidationInterceptor()
           
 
Method Summary
 long getInvalidations()
           
protected  Log getLog()
           
 boolean getStatisticsEnabled()
           
 void injectDependencies(CommandsFactory commandsFactory)
           
protected  void invalidateAcrossCluster(boolean synchronous, Object[] keys)
           
 void resetStatistics()
           
 void setStatisticsEnabled(boolean enabled)
           
 Object visitClearCommand(InvocationContext ctx, ClearCommand command)
           
 Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand 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)
           
 
Methods inherited from class org.infinispan.interceptors.base.BaseRpcInterceptor
init, inject, isLocalModeForced, isSynchronous, shouldInvokeRemoteTxCommand
 
Methods inherited from class org.infinispan.interceptors.base.CommandInterceptor
getLockAcquisitionTimeout, getNext, handleDefault, hasNext, hasSkipLocking, injectConfiguration, invokeNextInterceptor, setNext
 
Methods inherited from class org.infinispan.commands.AbstractVisitor
visitApplyDeltaCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvalidationInterceptor

public InvalidationInterceptor()
Method Detail

getLog

protected Log getLog()
Overrides:
getLog in class CommandInterceptor

injectDependencies

public void injectDependencies(CommandsFactory commandsFactory)

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

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

visitPutMapCommand

public Object visitPutMapCommand(InvocationContext ctx,
                                 PutMapCommand command)
                          throws Throwable
Specified by:
visitPutMapCommand in interface Visitor
Overrides:
visitPutMapCommand 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

visitLockControlCommand

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

invalidateAcrossCluster

protected void invalidateAcrossCluster(boolean synchronous,
                                       Object[] keys)
                                throws Throwable
Throws:
Throwable

resetStatistics

public void resetStatistics()

getStatisticsEnabled

public boolean getStatisticsEnabled()

setStatisticsEnabled

public void setStatisticsEnabled(boolean enabled)

getInvalidations

public long getInvalidations()

Infinispan Distribution 5.2.6.Final-redhat-2

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