public class PrepareCommand extends AbstractTransactionCommand
Modifier and Type | Field and Description |
---|---|
protected org.jgroups.Address |
localAddress |
static int |
METHOD_ID |
protected List<WriteCommand> |
modifications |
protected boolean |
onePhaseCommit |
globalTransaction
Constructor and Description |
---|
PrepareCommand() |
PrepareCommand(GlobalTransaction gtx,
List<WriteCommand> modifications,
org.jgroups.Address localAddress,
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.
|
boolean |
containsModificationType(Class<? extends ReplicableCommand> replicableCommandClass) |
PrepareCommand |
copy() |
boolean |
equals(Object o) |
boolean |
existModifications() |
int |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
org.jgroups.Address |
getLocalAddress() |
List<WriteCommand> |
getModifications() |
int |
getModificationsCount() |
Object[] |
getParameters()
Used by marshallers to stream this command across a network
|
int |
hashCode() |
boolean |
isOnePhaseCommit() |
void |
removeModifications(Collection<WriteCommand> modificationsToRemove) |
void |
setParameters(int commandId,
Object[] args)
Used by the
CommandsFactory to create a command from raw data read off a stream. |
String |
toString() |
getGlobalTransaction, perform, setGlobalTransaction
public static final int METHOD_ID
protected List<WriteCommand> modifications
protected org.jgroups.Address localAddress
protected boolean onePhaseCommit
public PrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, org.jgroups.Address localAddress, boolean onePhaseCommit)
public PrepareCommand()
public void removeModifications(Collection<WriteCommand> modificationsToRemove)
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
VisitableCommand
ctx
- invocation contextvisitor
- visitor to acceptThrowable
- in the event of problemspublic List<WriteCommand> getModifications()
public org.jgroups.Address getLocalAddress()
public boolean isOnePhaseCommit()
public boolean existModifications()
public int getModificationsCount()
public int getCommandId()
ReplicableCommand
public Object[] getParameters()
ReplicableCommand
getParameters
in interface ReplicableCommand
getParameters
in class AbstractTransactionCommand
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 AbstractTransactionCommand
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 boolean equals(Object o)
equals
in class AbstractTransactionCommand
public int hashCode()
hashCode
in class AbstractTransactionCommand
public PrepareCommand copy()
public String toString()
toString
in class AbstractTransactionCommand
public boolean containsModificationType(Class<? extends ReplicableCommand> replicableCommandClass)
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.