org.infinispan.commands.read
Class AbstractDataCommand

java.lang.Object
  extended by org.infinispan.commands.AbstractFlagAffectedCommand
      extended by org.infinispan.commands.read.AbstractDataCommand
All Implemented Interfaces:
DataCommand, FlagAffectedCommand, ReplicableCommand, VisitableCommand
Direct Known Subclasses:
AbstractDataWriteCommand, GetKeyValueCommand

public abstract class AbstractDataCommand
extends AbstractFlagAffectedCommand
implements DataCommand

Since:
4.0
Author:
Mircea.Markus@jboss.com, Sanne Grinovero (C) 2011 Red Hat Inc.

Field Summary
protected  Object key
           
 
Fields inherited from class org.infinispan.commands.AbstractFlagAffectedCommand
flags
 
Constructor Summary
protected AbstractDataCommand()
           
protected AbstractDataCommand(Object key, Set<Flag> flags)
           
 
Method Summary
 boolean equals(Object obj)
           
 Object getKey()
           
abstract  Object[] getParameters()
          Used by marshallers to stream this command across a network
 int hashCode()
           
 boolean ignoreCommandOnStatus(ComponentStatus status)
          Similar to VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor.
 boolean isReturnValueExpected()
          If true, a return value will be provided when performed remotely.
 void setKey(Object key)
           
abstract  void setParameters(int commandId, Object[] parameters)
          Used by the CommandsFactory to create a command from raw data read off a stream.
 boolean shouldInvoke(InvocationContext ctx)
          Used by the InboundInvocationHandler to determine whether the command should be invoked or not.
 String toString()
           
 
Methods inherited from class org.infinispan.commands.AbstractFlagAffectedCommand
getFlags, hasFlag, setFlags
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.infinispan.commands.VisitableCommand
acceptVisitor
 
Methods inherited from interface org.infinispan.commands.ReplicableCommand
getCommandId, perform
 

Field Detail

key

protected Object key
Constructor Detail

AbstractDataCommand

protected AbstractDataCommand(Object key,
                              Set<Flag> flags)

AbstractDataCommand

protected AbstractDataCommand()
Method Detail

getKey

public Object getKey()
Specified by:
getKey in interface DataCommand

setKey

public void setKey(Object key)

setParameters

public abstract void setParameters(int commandId,
                                   Object[] parameters)
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
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.
parameters - object array of args

getParameters

public abstract Object[] getParameters()
Description copied from interface: ReplicableCommand
Used by marshallers to stream this command across a network

Specified by:
getParameters in interface ReplicableCommand
Returns:
an object array of arguments, compatible with pre-2.2.0 MethodCall args.

shouldInvoke

public boolean shouldInvoke(InvocationContext ctx)
Description copied from interface: VisitableCommand
Used by the InboundInvocationHandler to determine whether the command should be invoked or not.

Specified by:
shouldInvoke in interface VisitableCommand
Returns:
true if the command should be invoked, false otherwise.

ignoreCommandOnStatus

public boolean ignoreCommandOnStatus(ComponentStatus status)
Description copied from interface: VisitableCommand
Similar to VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor. Commands can opt to be discarded in case the cache status is not suited (as InvalidateCommand)

Specified by:
ignoreCommandOnStatus in interface VisitableCommand
Returns:
true if the command should NOT be invoked.

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

isReturnValueExpected

public boolean isReturnValueExpected()
Description copied from interface: ReplicableCommand
If true, a return value will be provided when performed remotely. Otherwise, a remote ResponseGenerator may choose to simply return null to save on marshalling costs.

Specified by:
isReturnValueExpected in interface ReplicableCommand
Returns:
true or false

-->

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