org.infinispan.commands.tx
Class CommitCommand

java.lang.Object
  extended by org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
      extended by org.infinispan.commands.tx.CommitCommand
All Implemented Interfaces:
CacheRpcCommand, ReplicableCommand, TransactionBoundaryCommand, VisitableCommand
Direct Known Subclasses:
VersionedCommitCommand

public class CommitCommand
extends AbstractTransactionBoundaryCommand

Command corresponding to the 2nd phase of 2PC.

Since:
4.0
Author:
Manik Surtani (manik@jboss.org)

Field Summary
static byte COMMAND_ID
           
static byte RESEND_PREPARE
          This is sent back to callers if the global transaction is not reconised.
 
Fields inherited from class org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
cacheName, configuration, globalTx, icc, invoker, txTable
 
Constructor Summary
CommitCommand(String cacheName)
           
CommitCommand(String cacheName, GlobalTransaction gtx)
           
 
Method Summary
 Object acceptVisitor(InvocationContext ctx, Visitor visitor)
          Accept a visitor, and return the result of accepting this visitor.
 byte getCommandId()
          Used by marshallers to convert this command into an id for streaming.
protected  Object invalidRemoteTxReturnValue()
          This is what is returned to remote callers when an invalid RemoteTransaction is encountered.
 String toString()
           
 
Methods inherited from class org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
equals, getCacheName, getConfiguration, getGlobalTransaction, getOrigin, getParameters, hashCode, ignoreCommandOnStatus, init, injectComponents, isReturnValueExpected, markTransactionAsRemote, perform, setOrigin, setParameters, shouldInvoke, visitRemoteTransaction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

COMMAND_ID

public static final byte COMMAND_ID
See Also:
Constant Field Values

RESEND_PREPARE

public static final byte RESEND_PREPARE
This is sent back to callers if the global transaction is not reconised. It can happen if a prepare is sent to one set of nodes, which then fail, and a commit is sent to a "new" data owner which has not seen the prepare. Responding with this value instructs the caller to re-send the prepare. See DistributionInterceptor.visitCommitCommand() for details.

See Also:
Constant Field Values
Constructor Detail

CommitCommand

public CommitCommand(String cacheName,
                     GlobalTransaction gtx)

CommitCommand

public CommitCommand(String cacheName)
Method Detail

invalidRemoteTxReturnValue

protected Object invalidRemoteTxReturnValue()
Description copied from class: AbstractTransactionBoundaryCommand
This is what is returned to remote callers when an invalid RemoteTransaction is encountered. Can happen if a remote node propagates a transactional call to the current node, and the current node has no idea of the transaction in question. Can happen during rehashing, when ownerships are reassigned during a transactions. Returning a null usually means the transactional command succeeded.

Overrides:
invalidRemoteTxReturnValue in class AbstractTransactionBoundaryCommand
Returns:
return value to respond to a remote caller with if the transaction context is invalid.

acceptVisitor

public Object acceptVisitor(InvocationContext ctx,
                            Visitor visitor)
                     throws Throwable
Description copied from interface: VisitableCommand
Accept a visitor, and return the result of accepting this visitor.

Parameters:
ctx - invocation context
visitor - visitor to accept
Returns:
arbitrary return value
Throws:
Throwable - in the event of problems

getCommandId

public byte getCommandId()
Description copied from interface: ReplicableCommand
Used by marshallers to convert this command into an id for streaming.

Returns:
the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.

toString

public String toString()
Overrides:
toString in class AbstractTransactionBoundaryCommand

-->

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