Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.interceptors
Class ClusteringInterceptor

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.ClusteringInterceptor
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
BaseDistributionInterceptor, ReplicationInterceptor

public abstract class ClusteringInterceptor
extends BaseRpcInterceptor

Base class for replication and distribution interceptors.

Since:
5.2
Author:
anistor@redhat.com

Field Summary
protected  CommandsFactory cf
           
protected  DataContainer dataContainer
           
protected  EntryFactory entryFactory
           
protected  LockManager lockManager
           
protected  boolean needReliableReturnValues
           
protected  StateTransferManager stateTransferManager
           
 
Fields inherited from class org.infinispan.interceptors.base.BaseRpcInterceptor
defaultSynchronous, rpcManager
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
cacheConfiguration
 
Constructor Summary
ClusteringInterceptor()
           
 
Method Summary
 void configure()
           
protected  boolean ignorePreviousValueOnBackup(WriteCommand command, InvocationContext ctx)
          For conditional operations (replace, remove, put if absent) Used only for optimistic transactional caches, to solve the following situation:
 void injectDependencies(CommandsFactory cf, EntryFactory entryFactory, LockManager lockManager, DataContainer dataContainer, StateTransferManager stateTransferManager)
           
protected  boolean isNeedReliableReturnValues(FlagAffectedCommand command)
           
protected  boolean needsRemoteGet(InvocationContext ctx, AbstractDataCommand command)
           
protected abstract  InternalCacheEntry retrieveFromRemoteSource(Object key, InvocationContext ctx, boolean acquireRemoteLock, FlagAffectedCommand command)
          Retrieves a cache entry from a remote source.
 
Methods inherited from class org.infinispan.interceptors.base.BaseRpcInterceptor
init, inject, isLocalModeForced, isSynchronous, shouldInvokeRemoteTxCommand
 
Methods inherited from class org.infinispan.interceptors.base.CommandInterceptor
getLockAcquisitionTimeout, getLog, getNext, handleDefault, hasNext, hasSkipLocking, injectConfiguration, invokeNextInterceptor, setNext
 
Methods inherited from class org.infinispan.commands.AbstractVisitor
visitApplyDeltaCommand, visitClearCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutKeyValueCommand, visitPutMapCommand, visitRemoveCommand, visitReplaceCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cf

protected CommandsFactory cf

entryFactory

protected EntryFactory entryFactory

lockManager

protected LockManager lockManager

dataContainer

protected DataContainer dataContainer

stateTransferManager

protected StateTransferManager stateTransferManager

needReliableReturnValues

protected boolean needReliableReturnValues
Constructor Detail

ClusteringInterceptor

public ClusteringInterceptor()
Method Detail

injectDependencies

public void injectDependencies(CommandsFactory cf,
                               EntryFactory entryFactory,
                               LockManager lockManager,
                               DataContainer dataContainer,
                               StateTransferManager stateTransferManager)

configure

public void configure()

isNeedReliableReturnValues

protected boolean isNeedReliableReturnValues(FlagAffectedCommand command)

needsRemoteGet

protected boolean needsRemoteGet(InvocationContext ctx,
                                 AbstractDataCommand command)

ignorePreviousValueOnBackup

protected boolean ignorePreviousValueOnBackup(WriteCommand command,
                                              InvocationContext ctx)
For conditional operations (replace, remove, put if absent) Used only for optimistic transactional caches, to solve the following situation:
 - node A (owner, tx originator) does a successful replace
 - the actual value changes
 - tx commits. The value is applied on A (the check was performed at operation time) but is not applied on
   B (check is performed at commit time).
 In such situations (optimistic caches) the remote conditional command should not re-check the old value.
 


retrieveFromRemoteSource

protected abstract InternalCacheEntry retrieveFromRemoteSource(Object key,
                                                               InvocationContext ctx,
                                                               boolean acquireRemoteLock,
                                                               FlagAffectedCommand command)
                                                        throws Exception
Retrieves a cache entry from a remote source. Would typically involve an RPC call using a ClusteredGetCommand and some form of quorum of responses if the responses returned are inconsistent - often the case if there is a rehash in progress, involving nodes that the key maps to.

Parameters:
key - key to look up
Returns:
an internal cache entry, or null if it cannot be located
Throws:
Exception

Infinispan Distribution 5.2.6.Final-redhat-2

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