public class LockControlCommand extends AbstractTransactionBoundaryCommand implements FlagAffectedCommand
Modifier and Type | Field and Description |
---|---|
static int |
COMMAND_ID |
Constructor and Description |
---|
LockControlCommand(Collection<Object> keys,
String cacheName,
Set<Flag> flags,
GlobalTransaction gtx) |
LockControlCommand(Object key,
String cacheName,
Set<Flag> flags,
GlobalTransaction gtx) |
LockControlCommand(String cacheName) |
Modifier and Type | Method and Description |
---|---|
Object |
acceptVisitor(InvocationContext ctx,
Visitor visitor)
Accept a visitor, and return the result of accepting this visitor.
|
boolean |
equals(Object o) |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Set<Flag> |
getFlags() |
Collection<Object> |
getKeys() |
Metadata |
getMetadata()
Get metadata of this command.
|
Object[] |
getParameters()
Used by marshallers to stream this command across a network
|
Object |
getSingleKey() |
boolean |
hasFlag(Flag flag)
Check whether a particular flag is present in the command
|
int |
hashCode() |
boolean |
isUnlock() |
boolean |
multipleKeys() |
Object |
perform(InvocationContext ignored)
Performs the primary function of the command.
|
void |
replaceKey(Object oldKey,
Object replacement) |
void |
replaceKeys(Map<Object,Object> replacements) |
void |
setFlags(Flag... flags)
Use it to store the flags from the InvocationContext into the Command before remoting the Command.
|
void |
setFlags(Set<Flag> flags)
Use it to store the flags from the InvocationContext into the Command before remoting the Command.
|
void |
setGlobalTransaction(GlobalTransaction gtx) |
void |
setMetadata(Metadata metadata)
Sets metadata for this command.
|
void |
setParameters(int commandId,
Object[] args)
Used by the
CommandsFactory to create a command from raw data read off a stream. |
void |
setUnlock(boolean unlock) |
String |
toString() |
canBlock, getCacheName, getGlobalTransaction, getOrigin, getRemoteTransaction, getTopologyId, ignoreCommandOnStatus, init, invalidRemoteTxReturnValue, isReturnValueExpected, markTransactionAsRemote, setOrigin, setTopologyId, shouldInvoke, visitRemoteTransaction
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
ignoreCommandOnStatus, shouldInvoke
getTopologyId, setTopologyId
canBlock, isReturnValueExpected
public static final int COMMAND_ID
public LockControlCommand(String cacheName)
public LockControlCommand(Collection<Object> keys, String cacheName, Set<Flag> flags, GlobalTransaction gtx)
public LockControlCommand(Object key, String cacheName, Set<Flag> flags, GlobalTransaction gtx)
public void setGlobalTransaction(GlobalTransaction gtx)
public Collection<Object> getKeys()
public boolean multipleKeys()
public Object getSingleKey()
public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
VisitableCommand
acceptVisitor
in interface VisitableCommand
ctx
- invocation contextvisitor
- visitor to acceptThrowable
- in the event of problemspublic Object perform(InvocationContext ignored) throws Throwable
ReplicableCommand
perform
in interface ReplicableCommand
perform
in class AbstractTransactionBoundaryCommand
ignored
- invocation contextThrowable
- in the event of problems.public byte getCommandId()
ReplicableCommand
getCommandId
in interface ReplicableCommand
public Object[] getParameters()
ReplicableCommand
getParameters
in interface ReplicableCommand
getParameters
in class AbstractTransactionBoundaryCommand
public void setParameters(int commandId, Object[] args)
ReplicableCommand
CommandsFactory
to create a command from raw data read off a stream.setParameters
in interface ReplicableCommand
setParameters
in class AbstractTransactionBoundaryCommand
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 argspublic boolean isUnlock()
public void setUnlock(boolean unlock)
public boolean equals(Object o)
equals
in class AbstractTransactionBoundaryCommand
public int hashCode()
hashCode
in class AbstractTransactionBoundaryCommand
public String toString()
toString
in class AbstractTransactionBoundaryCommand
public Set<Flag> getFlags()
getFlags
in interface LocalFlagAffectedCommand
LocalFlagAffectedCommand.setFlags(java.util.Set)
public void setFlags(Set<Flag> flags)
LocalFlagAffectedCommand
setFlags
in interface LocalFlagAffectedCommand
public boolean hasFlag(Flag flag)
LocalFlagAffectedCommand
hasFlag
in interface LocalFlagAffectedCommand
flag
- to lookup in the commandpublic void setFlags(Flag... flags)
LocalFlagAffectedCommand
setFlags
in interface LocalFlagAffectedCommand
public Metadata getMetadata()
MetadataAwareCommand
getMetadata
in interface MetadataAwareCommand
public void setMetadata(Metadata metadata)
MetadataAwareCommand
setMetadata
in interface MetadataAwareCommand
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.