org.infinispan.interceptors
Class DistTxInterceptor

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

public class DistTxInterceptor
extends TxInterceptor

A special form of the TxInterceptor that is aware of distribution and consistent hashing, and as such only replays methods during a remote prepare that are targeted to this specific cache instance.

Since:
4.0
Author:
Manik Surtani

Field Summary
 
Fields inherited from class org.infinispan.interceptors.base.CommandInterceptor
configuration, log, trace
 
Constructor Summary
DistTxInterceptor()
           
 
Method Summary
protected  VisitableCommand getCommandToReplay(VisitableCommand command)
          Only replays modifications that are
 void injectDistributionManager(DistributionManager dm, CommandsFactory commandsFactory)
           
 Object visitClearCommand(InvocationContext ctx, ClearCommand command)
           
 Object visitCommitCommand(TxInvocationContext ctx, CommitCommand cmd)
           
 Object visitPrepareCommand(TxInvocationContext ctx, PrepareCommand cmd)
           
 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 cmd)
           
 
Methods inherited from class org.infinispan.interceptors.TxInterceptor
enlist, getCommits, getPrepares, getRollbacks, init, isStatisticsEnabled, resetStatistics, setStatisticsEnabled, visitGetKeyValueCommand, visitInvalidateCommand, visitLockControlCommand
 
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, visitKeySetCommand, visitSizeCommand, visitValuesCommand
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DistTxInterceptor

public DistTxInterceptor()
Method Detail

injectDistributionManager

public void injectDistributionManager(DistributionManager dm,
                                      CommandsFactory commandsFactory)

getCommandToReplay

protected VisitableCommand getCommandToReplay(VisitableCommand command)
Only replays modifications that are

Overrides:
getCommandToReplay in class TxInterceptor
Parameters:
command - modification in a prepare call
Returns:
a VisitableCommand representing this modification, fit for replaying, or null if the command should not be replayed.

visitPrepareCommand

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

visitRollbackCommand

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

visitCommitCommand

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

visitPutKeyValueCommand

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

visitRemoveCommand

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

visitReplaceCommand

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

visitClearCommand

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

visitPutMapCommand

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

Google Analytics

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