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
|
Object[] |
getParameters()
Used by marshallers to stream this command across a network
|
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 |
setOrigin(Address origin)
Set the origin of the command
|
void |
setParameters(int commandId,
Object[] args)
Used by the
CommandsFactory to create a command from raw data read off a stream. |
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) |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitacceptVisitorgetCommandIdprotected 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 TopologyAffectedCommandpublic void setTopologyId(int topologyId)
setTopologyId in interface TopologyAffectedCommandpublic String getCacheName()
getCacheName in interface CacheRpcCommandpublic GlobalTransaction getGlobalTransaction()
getGlobalTransaction in interface TransactionBoundaryCommandpublic void markTransactionAsRemote(boolean isRemote)
markTransactionAsRemote in interface TransactionBoundaryCommandprotected Object invalidRemoteTxReturnValue()
public Object perform(InvocationContext ctx) throws Throwable
ReplicableCommandperform in interface ReplicableCommandctx - invocation contextThrowable - in the event of problems.protected void visitRemoteTransaction(RemoteTransaction tx)
protected RemoteTransaction getRemoteTransaction()
public Object[] getParameters()
ReplicableCommandgetParameters in interface ReplicableCommandpublic void setParameters(int commandId,
Object[] args)
ReplicableCommandCommandsFactory to create a command from raw data read off a stream.setParameters in interface ReplicableCommandcommandId - command id to set. This is usually unused but *could* be used in the event of a command having
multiple IDs, such as PutKeyValueCommand.args - object array of argspublic boolean shouldInvoke(InvocationContext ctx)
VisitableCommandshouldInvoke in interface VisitableCommandpublic boolean ignoreCommandOnStatus(ComponentStatus status)
VisitableCommandVisitableCommand.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 VisitableCommandpublic Address getOrigin()
CacheRpcCommandgetOrigin in interface CacheRpcCommandpublic void setOrigin(Address origin)
CacheRpcCommandsetOrigin in interface CacheRpcCommandpublic boolean isReturnValueExpected()
ReplicableCommandResponseGenerator
may choose to simply return null to save on marshalling costs.isReturnValueExpected in interface ReplicableCommandpublic final boolean canBlock()
ReplicableCommandcanBlock in interface ReplicableCommandtrue if the command can block/wait, false otherwiseCopyright © 2014 JBoss, a division of Red Hat. All rights reserved.