Package org.infinispan.commands.tx
Class CommitCommand
- java.lang.Object
-
- org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
-
- org.infinispan.commands.tx.CommitCommand
-
- All Implemented Interfaces:
CacheRpcCommand
,ReplicableCommand
,TopologyAffectedCommand
,TransactionBoundaryCommand
,VisitableCommand
- Direct Known Subclasses:
TotalOrderCommitCommand
,VersionedCommitCommand
public class CommitCommand extends AbstractTransactionBoundaryCommand
Command corresponding to the 2nd phase of 2PC.- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.infinispan.commands.VisitableCommand
VisitableCommand.LoadType
-
-
Field Summary
Fields Modifier and Type Field Description static byte
COMMAND_ID
-
Constructor Summary
Constructors Constructor Description CommitCommand(ByteString cacheName)
CommitCommand(ByteString cacheName, GlobalTransaction gtx)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
canBlock, equals, getCacheName, getGlobalTransaction, getOrigin, getTopologyId, hashCode, init, invokeAsync, isReturnValueExpected, loadType, markTransactionAsRemote, perform, readFrom, setOrigin, setTopologyId, visitRemoteTransaction, writeTo
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
invoke, isSuccessful
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
ignoreCommandOnStatus, shouldInvoke
-
-
-
-
Field Detail
-
COMMAND_ID
public static final byte COMMAND_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CommitCommand
public CommitCommand(ByteString cacheName, GlobalTransaction gtx)
-
CommitCommand
public CommitCommand(ByteString cacheName)
-
-
Method Detail
-
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 contextvisitor
- visitor to accept- Returns:
- arbitrary return value
- Throws:
Throwable
- in the event of problems
-
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 classAbstractTransactionBoundaryCommand
- Returns:
- return value to respond to a remote caller with if the transaction context is invalid.
-
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 classAbstractTransactionBoundaryCommand
-
-