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:
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 byteCOMMAND_ID-
Fields inherited from class org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
cacheName, globalTx
-
-
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 ObjectacceptVisitor(InvocationContext ctx, Visitor visitor)Accept a visitor, and return the result of accepting this visitor.voidaddIracMetadata(int segment, IracMetadata metadata)bytegetCommandId()Used by marshallers to convert this command into an id for streaming.IracMetadatagetIracMetadata(int segment)protected ObjectinvalidRemoteTxReturnValue(TransactionTable txTable)This is what is returned to remote callers when an invalid RemoteTransaction is encountered.voidreadFrom(ObjectInput input)Reads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput).StringtoString()voidwriteTo(ObjectOutput output)Writes this instance to theObjectOutput.-
Methods inherited from class org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
equals, getCacheName, getGlobalTransaction, getOrigin, getTopologyId, hashCode, invokeAsync, isReturnValueExpected, loadType, markTransactionAsRemote, setOrigin, setTopologyId, visitRemoteTransaction
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.commands.ReplicableCommand
canBlock, invoke, invokeAsync, isSuccessful
-
Methods inherited from interface org.infinispan.commands.VisitableCommand
init
-
-
-
-
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:VisitableCommandAccept 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(TransactionTable txTable)
Description copied from class:AbstractTransactionBoundaryCommandThis 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:
invalidRemoteTxReturnValuein 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:ReplicableCommandUsed 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:
toStringin classAbstractTransactionBoundaryCommand
-
writeTo
public void writeTo(ObjectOutput output) throws IOException
Description copied from interface:ReplicableCommandWrites this instance to theObjectOutput.- Specified by:
writeToin interfaceReplicableCommand- Overrides:
writeToin classAbstractTransactionBoundaryCommand- Parameters:
output- the stream.- Throws:
IOException- if an error occurred during the I/O.
-
readFrom
public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
Description copied from interface:ReplicableCommandReads this instance from the stream written byReplicableCommand.writeTo(ObjectOutput).- Specified by:
readFromin interfaceReplicableCommand- Overrides:
readFromin classAbstractTransactionBoundaryCommand- Parameters:
input- the stream to read.- Throws:
IOException- if an error occurred during the I/O.ClassNotFoundException- if it tries to load an undefined class.
-
addIracMetadata
public void addIracMetadata(int segment, IracMetadata metadata)
-
getIracMetadata
public IracMetadata getIracMetadata(int segment)
-
-