Class AbstractTransactionBoundaryCommand
java.lang.Object
org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
- All Implemented Interfaces:
CacheRpcCommand, ReplicableCommand, TopologyAffectedCommand, TracedCommand, TransactionBoundaryCommand, VisitableCommand, VersionAware
- Direct Known Subclasses:
CommitCommand, LockControlCommand, PrepareCommand, RollbackCommand
public abstract class AbstractTransactionBoundaryCommand
extends Object
implements TransactionBoundaryCommand
An abstract transaction boundary command that holds a reference to a
GlobalTransaction- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org), Mircea.Markus@jboss.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface VisitableCommand
VisitableCommand.LoadType -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractTransactionBoundaryCommand(int topologyId, ByteString cacheName, GlobalTransaction globalTx) protectedAbstractTransactionBoundaryCommand(ByteString cacheName) protectedAbstractTransactionBoundaryCommand(ByteString cacheName, GlobalTransaction globalTx) -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the origin of the commandintinthashCode()protected ObjectThis is what is returned to remote callers when an invalid RemoteTransaction is encountered.invokeAsync(ComponentRegistry registry) Invoke the command asynchronously.booleanIf true, a return value will be provided when performed remotely.loadType()voidmarkTransactionAsRemote(boolean isRemote) voidSet the origin of the commandvoidsetTopologyId(int topologyId) toString()protected voidMethods inherited from interface ReplicableCommand
getCommandId, isSuccessful, logThrowable, readFrom, supportedSince, writeToMethods inherited from interface TracedCommand
getOperationName, getSpanAttributes, setSpanAttributesMethods inherited from interface VisitableCommand
acceptVisitor, init
-
Field Details
-
cacheName
-
globalTx
-
-
Constructor Details
-
AbstractTransactionBoundaryCommand
-
AbstractTransactionBoundaryCommand
-
AbstractTransactionBoundaryCommand
protected AbstractTransactionBoundaryCommand(int topologyId, ByteString cacheName, GlobalTransaction globalTx)
-
-
Method Details
-
getTopologyId
@ProtoField(1) public int getTopologyId()- Specified by:
getTopologyIdin interfaceTopologyAffectedCommand
-
setTopologyId
public void setTopologyId(int topologyId) - Specified by:
setTopologyIdin interfaceTopologyAffectedCommand
-
getCacheName
- Specified by:
getCacheNamein interfaceCacheRpcCommand- Returns:
- the name of the cache that produced this command. This will also be the name of the cache this command is intended for.
-
getGlobalTransaction
- Specified by:
getGlobalTransactionin interfaceTransactionBoundaryCommand
-
markTransactionAsRemote
public void markTransactionAsRemote(boolean isRemote) - Specified by:
markTransactionAsRemotein interfaceTransactionBoundaryCommand
-
invalidRemoteTxReturnValue
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.- Returns:
- return value to respond to a remote caller with if the transaction context is invalid.
-
invokeAsync
Description copied from interface:CacheRpcCommandInvoke the command asynchronously.- Specified by:
invokeAsyncin interfaceCacheRpcCommand- Specified by:
invokeAsyncin interfaceVisitableCommand- Throws:
Throwable
-
visitRemoteTransaction
-
loadType
- Specified by:
loadTypein interfaceVisitableCommand- Returns:
- Nodes on which the command needs to read the previous values of the keys it acts on.
-
equals
-
hashCode
-
toString
-
getOrigin
Description copied from interface:CacheRpcCommandGet the origin of the command- Specified by:
getOriginin interfaceCacheRpcCommand
-
setOrigin
Description copied from interface:CacheRpcCommandSet the origin of the command- Specified by:
setOriginin interfaceCacheRpcCommand- Specified by:
setOriginin interfaceReplicableCommand- Parameters:
origin- the sender'sAddress
-
isReturnValueExpected
public boolean isReturnValueExpected()Description copied from interface:ReplicableCommandIf true, a return value will be provided when performed remotely. Otherwise, a remoteResponseGeneratormay choose to simply return null to save on marshalling costs.- Specified by:
isReturnValueExpectedin interfaceReplicableCommand- Returns:
- true or false
-