public class PrepareCommand extends AbstractTransactionBoundaryCommand
Modifier and Type | Field and Description |
---|---|
static byte |
COMMAND_ID |
protected WriteCommand[] |
modifications |
protected CacheNotifier |
notifier |
protected boolean |
onePhaseCommit |
protected RecoveryManager |
recoveryManager |
Constructor and Description |
---|
PrepareCommand(String cacheName) |
PrepareCommand(String cacheName,
GlobalTransaction gtx,
boolean onePhaseCommit,
WriteCommand... modifications) |
PrepareCommand(String cacheName,
GlobalTransaction gtx,
List<WriteCommand> commands,
boolean onePhaseCommit) |
Modifier and Type | Method and Description |
---|---|
Object |
acceptVisitor(InvocationContext ctx,
Visitor visitor)
Accept a visitor, and return the result of accepting this visitor.
|
PrepareCommand |
copy() |
Set<Object> |
getAffectedKeys() |
Object[] |
getAffectedKeysToLock(boolean sort)
It returns an array of keys affected by the WriteCommand in modifications.
|
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
WriteCommand[] |
getModifications() |
Object[] |
getParameters()
Used by marshallers to stream this command across a network
|
protected RemoteTransaction |
getRemoteTransaction() |
boolean |
hasModifications() |
void |
initialize(CacheNotifier notifier,
RecoveryManager recoveryManager) |
boolean |
isOnePhaseCommit() |
boolean |
isReplayEntryWrapping()
If set to true, then the keys touched by this transaction are to be wrapped again and original ones discarded.
|
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
Object |
perform(InvocationContext ignored)
Performs the primary function 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 |
setReplayEntryWrapping(boolean replayEntryWrapping) |
String |
toString() |
boolean |
writesToASingleKey() |
canBlock, equals, getCacheName, getGlobalTransaction, getOrigin, getTopologyId, hashCode, ignoreCommandOnStatus, init, invalidRemoteTxReturnValue, markTransactionAsRemote, setOrigin, setTopologyId, shouldInvoke, visitRemoteTransaction
public static final byte COMMAND_ID
protected WriteCommand[] modifications
protected boolean onePhaseCommit
protected CacheNotifier notifier
protected RecoveryManager recoveryManager
public PrepareCommand(String cacheName, GlobalTransaction gtx, boolean onePhaseCommit, WriteCommand... modifications)
public PrepareCommand(String cacheName, GlobalTransaction gtx, List<WriteCommand> commands, boolean onePhaseCommit)
public PrepareCommand(String cacheName)
public void initialize(CacheNotifier notifier, RecoveryManager recoveryManager)
public Object perform(InvocationContext ignored) throws Throwable
ReplicableCommand
perform
in interface ReplicableCommand
perform
in class AbstractTransactionBoundaryCommand
ignored
- invocation contextThrowable
- in the event of problems.protected RemoteTransaction getRemoteTransaction()
getRemoteTransaction
in class AbstractTransactionBoundaryCommand
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
VisitableCommand
ctx
- invocation contextvisitor
- visitor to acceptThrowable
- in the event of problemspublic WriteCommand[] getModifications()
public boolean isOnePhaseCommit()
public byte getCommandId()
ReplicableCommand
public Object[] getParameters()
ReplicableCommand
getParameters
in interface ReplicableCommand
getParameters
in class AbstractTransactionBoundaryCommand
public void setParameters(int commandId, Object[] args)
ReplicableCommand
CommandsFactory
to create a command from raw data read off a stream.setParameters
in interface ReplicableCommand
setParameters
in class AbstractTransactionBoundaryCommand
commandId
- 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 PrepareCommand copy()
public String toString()
toString
in class AbstractTransactionBoundaryCommand
public boolean hasModifications()
public boolean isReplayEntryWrapping()
public void setReplayEntryWrapping(boolean replayEntryWrapping)
isReplayEntryWrapping()
public boolean writesToASingleKey()
public boolean isReturnValueExpected()
ReplicableCommand
ResponseGenerator
may choose to simply return null to save on marshalling costs.isReturnValueExpected
in interface ReplicableCommand
isReturnValueExpected
in class AbstractTransactionBoundaryCommand
public Object[] getAffectedKeysToLock(boolean sort)
sort
- if true
, the array returned is sorted by the key hash.Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.