public abstract class AbstractTransactionBoundaryCommand extends Object implements TransactionBoundaryCommand
GlobalTransaction
VisitableCommand.LoadType
Modifier and Type | Field and Description |
---|---|
protected ByteString |
cacheName |
protected GlobalTransaction |
globalTx |
Constructor and Description |
---|
AbstractTransactionBoundaryCommand(ByteString cacheName) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
ByteString |
getCacheName() |
GlobalTransaction |
getGlobalTransaction() |
Address |
getOrigin()
Get the origin of the command
|
int |
getTopologyId() |
int |
hashCode() |
protected Object |
invalidRemoteTxReturnValue(TransactionTable txTable)
This is what is returned to remote callers when an invalid RemoteTransaction is encountered.
|
CompletionStage<?> |
invokeAsync(ComponentRegistry registry)
Invoke the command asynchronously.
|
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
VisitableCommand.LoadType |
loadType() |
void |
markTransactionAsRemote(boolean isRemote) |
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput) . |
void |
setOrigin(Address origin)
Sets the sender's
Address . |
void |
setTopologyId(int topologyId) |
String |
toString() |
protected void |
visitRemoteTransaction(RemoteTransaction tx) |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput . |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
acceptVisitor, init
canBlock, getCommandId, invoke, invokeAsync, isSuccessful
protected GlobalTransaction globalTx
protected final ByteString cacheName
public AbstractTransactionBoundaryCommand(ByteString cacheName)
public int getTopologyId()
getTopologyId
in interface TopologyAffectedCommand
public void setTopologyId(int topologyId)
setTopologyId
in interface TopologyAffectedCommand
public ByteString getCacheName()
getCacheName
in interface CacheRpcCommand
public GlobalTransaction getGlobalTransaction()
getGlobalTransaction
in interface TransactionBoundaryCommand
public void markTransactionAsRemote(boolean isRemote)
markTransactionAsRemote
in interface TransactionBoundaryCommand
protected Object invalidRemoteTxReturnValue(TransactionTable txTable)
public CompletionStage<?> invokeAsync(ComponentRegistry registry) throws Throwable
CacheRpcCommand
This method replaces ReplicableCommand.invoke()
for remote execution.
The default implementation and ReplicableCommand.invoke()
will be removed in future versions.
invokeAsync
in interface CacheRpcCommand
Throwable
protected void visitRemoteTransaction(RemoteTransaction tx)
public void writeTo(ObjectOutput output) throws IOException
ReplicableCommand
ObjectOutput
.writeTo
in interface ReplicableCommand
output
- the stream.IOException
- if an error occurred during the I/O.public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
ReplicableCommand
ReplicableCommand.writeTo(ObjectOutput)
.readFrom
in interface ReplicableCommand
input
- the stream to read.IOException
- if an error occurred during the I/O.ClassNotFoundException
- if it tries to load an undefined class.public VisitableCommand.LoadType loadType()
loadType
in interface VisitableCommand
public Address getOrigin()
CacheRpcCommand
getOrigin
in interface CacheRpcCommand
public void setOrigin(Address origin)
ReplicableCommand
Address
.
By default, it doesn't set anything. Implement this method if the sender's Address
is needed.
setOrigin
in interface CacheRpcCommand
setOrigin
in interface ReplicableCommand
origin
- the sender's Address
public boolean isReturnValueExpected()
ReplicableCommand
ResponseGenerator
may choose to simply return null to save on marshalling
costs.isReturnValueExpected
in interface ReplicableCommand
Copyright © 2021 JBoss by Red Hat. All rights reserved.