Infinispan Distribution 5.2.6.Final-redhat-2

org.infinispan.interceptors.distribution
Class BaseDistributionInterceptor

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
                  extended by org.infinispan.interceptors.distribution.BaseDistributionInterceptor
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
NonTxDistributionInterceptor, TxDistributionInterceptor

public abstract class BaseDistributionInterceptor
extends ClusteringInterceptor

Base class for distribution of entries across a cluster.

Since:
4.0
Author:
Manik Surtani, Mircea.Markus@jboss.com, Pete Muir, Dan Berindei

Field Summary
protected  ClusteringDependentLogic cdl
           
protected  DistributionManager dm
           
 
Fields inherited from class org.infinispan.interceptors.ClusteringInterceptor
cf, dataContainer, entryFactory, lockManager, needReliableReturnValues, stateTransferManager
 
Fields inherited from class org.infinispan.interceptors.base.BaseRpcInterceptor
defaultSynchronous, rpcManager
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
cacheConfiguration
 
Constructor Summary
BaseDistributionInterceptor()
           
 
Method Summary
protected  Log getLog()
           
protected abstract  Object handleWriteCommand(InvocationContext ctx, WriteCommand command, org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator, boolean skipRemoteGet, boolean skipL1Invalidation)
           
 void injectDependencies(DistributionManager distributionManager, ClusteringDependentLogic cdl)
           
protected  boolean isSingleOwnerAndLocal(org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator)
          If a single owner has been configured and the target for the key is the local address, it returns true.
protected  InternalCacheEntry retrieveFromRemoteSource(Object key, InvocationContext ctx, boolean acquireRemoteLock, FlagAffectedCommand command)
          Retrieves a cache entry from a remote source.
 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.ClusteringInterceptor
configure, ignorePreviousValueOnBackup, injectDependencies, isNeedReliableReturnValues, needsRemoteGet
 
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, visitClearCommand, visitCollection, visitCommitCommand, visitDistributedExecuteCommand, visitEntrySetCommand, visitEvictCommand, visitGetKeyValueCommand, visitInvalidateCommand, visitInvalidateL1Command, visitKeySetCommand, visitLockControlCommand, visitPrepareCommand, visitPutKeyValueCommand, visitRollbackCommand, visitSizeCommand, visitUnknownCommand, visitValuesCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dm

protected DistributionManager dm

cdl

protected ClusteringDependentLogic cdl
Constructor Detail

BaseDistributionInterceptor

public BaseDistributionInterceptor()
Method Detail

getLog

protected Log getLog()
Overrides:
getLog in class CommandInterceptor

injectDependencies

public void injectDependencies(DistributionManager distributionManager,
                               ClusteringDependentLogic cdl)

retrieveFromRemoteSource

protected InternalCacheEntry retrieveFromRemoteSource(Object key,
                                                      InvocationContext ctx,
                                                      boolean acquireRemoteLock,
                                                      FlagAffectedCommand command)
                                               throws Exception
Description copied from class: ClusteringInterceptor
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.

Specified by:
retrieveFromRemoteSource in class ClusteringInterceptor
Parameters:
key - key to look up
Returns:
an internal cache entry, or null if it cannot be located
Throws:
Exception

visitPutMapCommand

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

visitReplaceCommand

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

handleWriteCommand

protected abstract Object handleWriteCommand(InvocationContext ctx,
                                             WriteCommand command,
                                             org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator,
                                             boolean skipRemoteGet,
                                             boolean skipL1Invalidation)
                                      throws Throwable
Throws:
Throwable

isSingleOwnerAndLocal

protected boolean isSingleOwnerAndLocal(org.infinispan.interceptors.distribution.BaseDistributionInterceptor.RecipientGenerator recipientGenerator)
If a single owner has been configured and the target for the key is the local address, it returns true.


Infinispan Distribution 5.2.6.Final-redhat-2

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