org.infinispan.commands.tx
Class PrepareCommand
java.lang.Object
org.infinispan.commands.tx.AbstractTransactionBoundaryCommand
org.infinispan.commands.tx.PrepareCommand
- All Implemented Interfaces:
- ReplicableCommand, TransactionBoundaryCommand, VisitableCommand
public class PrepareCommand
- extends AbstractTransactionBoundaryCommand
// TODO: MANIK: Document this
- Since:
- 4.0
- Author:
- Manik Surtani (manik@jboss.org)
COMMAND_ID
public static final byte COMMAND_ID
- See Also:
- Constant Field Values
modifications
protected WriteCommand[] modifications
localAddress
protected Address localAddress
onePhaseCommit
protected boolean onePhaseCommit
PrepareCommand
public PrepareCommand(GlobalTransaction gtx,
Address localAddress,
boolean onePhaseCommit,
WriteCommand... modifications)
PrepareCommand
public PrepareCommand(GlobalTransaction gtx,
List<WriteCommand> commands,
Address localAddress,
boolean onePhaseCommit)
PrepareCommand
public PrepareCommand()
removeModifications
public void removeModifications(Collection<WriteCommand> modificationsToRemove)
acceptVisitor
public Object acceptVisitor(InvocationContext ctx,
Visitor visitor)
throws Throwable
- Description copied from interface:
VisitableCommand
- Accept a visitor, and return the result of accepting this visitor.
- Parameters:
ctx
- invocation contextvisitor
- visitor to accept
- Returns:
- arbitrary return value
- Throws:
Throwable
- in the event of problems
getModifications
public WriteCommand[] getModifications()
getLocalAddress
public Address getLocalAddress()
isOnePhaseCommit
public boolean isOnePhaseCommit()
existModifications
public boolean existModifications()
getModificationsCount
public int getModificationsCount()
getCommandId
public byte getCommandId()
- Description copied from interface:
ReplicableCommand
- Used by marshallers to convert this command into an id for streaming.
- Returns:
- the method id of this command. This is compatible with pre-2.2.0 MethodCall ids.
getParameters
public Object[] getParameters()
- Description copied from interface:
ReplicableCommand
- Used by marshallers to stream this command across a network
- Specified by:
getParameters
in interface ReplicableCommand
- Overrides:
getParameters
in class AbstractTransactionBoundaryCommand
- Returns:
- an object array of arguments, compatible with pre-2.2.0 MethodCall args.
setParameters
public void setParameters(int commandId,
Object[] args)
- Description copied from interface:
ReplicableCommand
- Used by the
CommandsFactory
to create a command from raw data read off a stream.
- Specified by:
setParameters
in interface ReplicableCommand
- Overrides:
setParameters
in class AbstractTransactionBoundaryCommand
- Parameters:
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 args
equals
public boolean equals(Object o)
- Overrides:
equals
in class AbstractTransactionBoundaryCommand
hashCode
public int hashCode()
- Overrides:
hashCode
in class AbstractTransactionBoundaryCommand
copy
public PrepareCommand copy()
toString
public String toString()
- Overrides:
toString
in class Object
containsModificationType
public boolean containsModificationType(Class<? extends ReplicableCommand> replicableCommandClass)
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.