public abstract class AbstractTransactionBoundaryCommand extends Object implements TransactionBoundaryCommand
GlobalTransaction
Modifier and Type | Field and Description |
---|---|
protected String |
cacheName |
protected GlobalTransaction |
globalTx |
protected InvocationContextFactory |
icf |
protected InterceptorChain |
invoker |
protected TransactionTable |
txTable |
Constructor and Description |
---|
AbstractTransactionBoundaryCommand(String cacheName) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBlock()
If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool.
|
boolean |
equals(Object o) |
String |
getCacheName() |
GlobalTransaction |
getGlobalTransaction() |
Address |
getOrigin()
Get the origin of the command
|
protected RemoteTransaction |
getRemoteTransaction() |
int |
getTopologyId() |
int |
hashCode() |
boolean |
ignoreCommandOnStatus(ComponentStatus status)
Similar to
VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor . |
void |
init(InterceptorChain chain,
InvocationContextFactory icf,
TransactionTable txTable) |
protected Object |
invalidRemoteTxReturnValue()
This is what is returned to remote callers when an invalid RemoteTransaction is encountered.
|
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
void |
markTransactionAsRemote(boolean isRemote) |
Object |
perform(InvocationContext ctx)
Performs the primary function of the command.
|
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput) . |
boolean |
readsExistingValues() |
void |
setOrigin(Address origin)
Set the origin of the command
|
void |
setTopologyId(int topologyId) |
boolean |
shouldInvoke(InvocationContext ctx)
Used by the InboundInvocationHandler to determine whether the command should be invoked or not.
|
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, alwaysReadsExistingValues
getCommandId, getParameters, setParameters
protected GlobalTransaction globalTx
protected final String cacheName
protected InterceptorChain invoker
protected InvocationContextFactory icf
protected TransactionTable txTable
public AbstractTransactionBoundaryCommand(String cacheName)
public void init(InterceptorChain chain, InvocationContextFactory icf, TransactionTable txTable)
public int getTopologyId()
getTopologyId
in interface TopologyAffectedCommand
public void setTopologyId(int topologyId)
setTopologyId
in interface TopologyAffectedCommand
public String getCacheName()
getCacheName
in interface CacheRpcCommand
public GlobalTransaction getGlobalTransaction()
getGlobalTransaction
in interface TransactionBoundaryCommand
public void markTransactionAsRemote(boolean isRemote)
markTransactionAsRemote
in interface TransactionBoundaryCommand
protected Object invalidRemoteTxReturnValue()
public Object perform(InvocationContext ctx) throws Throwable
ReplicableCommand
perform
in interface ReplicableCommand
ctx
- invocation contextThrowable
- in the event of problems.protected void visitRemoteTransaction(RemoteTransaction tx)
protected RemoteTransaction getRemoteTransaction()
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 boolean shouldInvoke(InvocationContext ctx)
VisitableCommand
shouldInvoke
in interface VisitableCommand
public boolean ignoreCommandOnStatus(ComponentStatus status)
VisitableCommand
VisitableCommand.shouldInvoke(InvocationContext)
but evaluated by InvocationContextInterceptor
.
Commands can opt to be discarded in case the cache status is not suited (as InvalidateCommand
)ignoreCommandOnStatus
in interface VisitableCommand
public boolean readsExistingValues()
readsExistingValues
in interface VisitableCommand
true
if the command needs to read the previous values of the keys it acts on.public Address getOrigin()
CacheRpcCommand
getOrigin
in interface CacheRpcCommand
public void setOrigin(Address origin)
CacheRpcCommand
setOrigin
in interface CacheRpcCommand
public boolean isReturnValueExpected()
ReplicableCommand
ResponseGenerator
may choose to simply return null to save on marshalling costs.isReturnValueExpected
in interface ReplicableCommand
public final boolean canBlock()
ReplicableCommand
canBlock
in interface ReplicableCommand
true
if the command can block/wait, false
otherwiseCopyright © 2018 JBoss, a division of Red Hat. All rights reserved.