org.infinispan.commands.read
Class AbstractDataCommand
java.lang.Object
org.infinispan.commands.AbstractFlagAffectedCommand
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.
key
protected Object key
AbstractDataCommand
protected AbstractDataCommand(Object key,
Set<Flag> flags)
AbstractDataCommand
protected AbstractDataCommand()
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.