org.jboss.cache.commands.tx
Class OptimisticPrepareCommand

java.lang.Object
  extended by org.jboss.cache.commands.tx.AbstractTransactionCommand
      extended by org.jboss.cache.commands.tx.PrepareCommand
          extended by org.jboss.cache.commands.tx.OptimisticPrepareCommand
All Implemented Interfaces:
ReplicableCommand, VisitableCommand

public class OptimisticPrepareCommand
extends PrepareCommand

An optimistic version of PrepareCommand.

Since:
2.2
Author:
Mircea.Markus@jboss.com

Field Summary
static int METHOD_ID
           
 
Fields inherited from class org.jboss.cache.commands.tx.PrepareCommand
localAddress, modifications, onePhaseCommit
 
Fields inherited from class org.jboss.cache.commands.tx.AbstractTransactionCommand
globalTransaction
 
Constructor Summary
OptimisticPrepareCommand()
           
OptimisticPrepareCommand(GlobalTransaction gtx, List<WriteCommand> modifications, org.jgroups.Address address, boolean onePhaseCommit)
           
 
Method Summary
 Object acceptVisitor(InvocationContext ctx, Visitor visitor)
          Accept a visitor, and return the result of accepting this visitor.
 OptimisticPrepareCommand copy()
          A shallow copy of all fields except collections.
 int getCommandId()
          Used by marshallers to convert this command into an id for streaming.
 Object[] getParameters()
          Used by marshallers to stream this command across a network
 void setParameters(int commandId, Object[] args)
          Used by the CommandsFactory to create a command from raw data read off a stream.
 String toString()
           
 
Methods inherited from class org.jboss.cache.commands.tx.PrepareCommand
containsModificationType, equals, existModifications, getLocalAddress, getModifications, getModificationsCount, hashCode, isOnePhaseCommit, removeModifications
 
Methods inherited from class org.jboss.cache.commands.tx.AbstractTransactionCommand
getGlobalTransaction, perform, setGlobalTransaction
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

METHOD_ID

public static final int METHOD_ID
See Also:
Constant Field Values
Constructor Detail

OptimisticPrepareCommand

public OptimisticPrepareCommand(GlobalTransaction gtx,
                                List<WriteCommand> modifications,
                                org.jgroups.Address address,
                                boolean onePhaseCommit)

OptimisticPrepareCommand

public OptimisticPrepareCommand()
Method Detail

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.

Specified by:
acceptVisitor in interface VisitableCommand
Overrides:
acceptVisitor in class PrepareCommand
Parameters:
ctx - invocation context
visitor - visitor to accept
Returns:
arbitrary return value
Throws:
Throwable - in the event of problems

getCommandId

public int getCommandId()
Description copied from interface: ReplicableCommand
Used by marshallers to convert this command into an id for streaming.

Specified by:
getCommandId in interface ReplicableCommand
Overrides:
getCommandId in class PrepareCommand
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 PrepareCommand
Returns:
an object array of arguments, compatible with pre-2.2.0 MethodCall args.

copy

public OptimisticPrepareCommand copy()
A shallow copy of all fields except collections.

Overrides:
copy in class PrepareCommand
Returns:
a copy of this command

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 PrepareCommand
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

toString

public String toString()
Overrides:
toString in class PrepareCommand


Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.