org.infinispan.commands.read
Class AbstractDataCommand
java.lang.Object
org.infinispan.commands.read.AbstractDataCommand
- All Implemented Interfaces:
- DataCommand, FlagAffectedCommand, ReplicableCommand, VisitableCommand
- Direct Known Subclasses:
- AbstractDataWriteCommand, GetKeyValueCommand
public abstract class AbstractDataCommand
- extends Object
- implements DataCommand, FlagAffectedCommand
- Since:
- 4.0
- Author:
- Mircea.Markus@jboss.com, Sanne Grinovero (C) 2011 Red Hat Inc.
key
protected Object key
flags
protected Set<Flag> flags
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)
getFlags
public Set<Flag> getFlags()
- Specified by:
getFlags
in interface FlagAffectedCommand
- Returns:
- the Flags which where set in the context - only valid to invoke after
FlagAffectedCommand.setFlags(Set)
setFlags
public void setFlags(Set<Flag> flags)
- Description copied from interface:
FlagAffectedCommand
- Use it to store the flags from the InvocationContext into the Command before remoting the Command.
- Specified by:
setFlags
in interface FlagAffectedCommand
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
Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.