public class LockControlCommand extends AbstractTransactionBoundaryCommand implements FlagAffectedCommand, TransactionalRemoteLockCommand
| Modifier and Type | Field and Description |
|---|---|
static int |
COMMAND_ID |
| Constructor and Description |
|---|
LockControlCommand(Collection<?> 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.
|
RemoteTxInvocationContext |
createContext()
It creates the transaction context.
|
boolean |
equals(Object o) |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Set<Flag> |
getFlags() |
Object |
getKeyLockOwner()
It returns the lock owner of the key.
|
Collection<Object> |
getKeys() |
Collection<Object> |
getKeysToLock()
It returns a
Collection with the keys to be lock. |
Metadata |
getMetadata()
Get metadata of this command.
|
Object |
getSingleKey() |
int |
hashCode() |
boolean |
hasSkipLocking()
It checks if this command should acquire locks.
|
boolean |
hasZeroLockAcquisition() |
boolean |
isUnlock() |
boolean |
multipleKeys() |
Object |
perform(InvocationContext ignored)
Performs the primary function of the command.
|
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput). |
void |
replaceKey(Object oldKey,
Object replacement) |
void |
replaceKeys(Map<Object,Object> replacements) |
void |
setFlags(Set<Flag> flags)
Set the flags, replacing any existing flags.
|
void |
setGlobalTransaction(GlobalTransaction gtx) |
void |
setMetadata(Metadata metadata)
Sets metadata for this command.
|
void |
setUnlock(boolean unlock) |
String |
toString() |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput. |
canBlock, getCacheName, getGlobalTransaction, getOrigin, getRemoteTransaction, getTopologyId, ignoreCommandOnStatus, init, invalidRemoteTxReturnValue, isReturnValueExpected, markTransactionAsRemote, readsExistingValues, setOrigin, setTopologyId, shouldInvoke, visitRemoteTransactionclone, finalize, getClass, notify, notifyAll, wait, wait, waitalwaysReadsExistingValues, ignoreCommandOnStatus, readsExistingValues, shouldInvokegetTopologyId, setTopologyIdcanBlock, getParameters, isReturnValueExpected, setParametersaddFlag, addFlags, hasFlag, setFlagspublic static final int COMMAND_ID
public LockControlCommand(String cacheName)
public LockControlCommand(Collection<?> 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
VisitableCommandacceptVisitor in interface VisitableCommandctx - invocation contextvisitor - visitor to acceptThrowable - in the event of problemspublic Object perform(InvocationContext ignored) throws Throwable
ReplicableCommandperform in interface ReplicableCommandperform in class AbstractTransactionBoundaryCommandignored - invocation contextThrowable - in the event of problems.public RemoteTxInvocationContext createContext()
TransactionalRemoteLockCommandcreateContext in interface TransactionalRemoteLockCommandTxInvocationContext.public byte getCommandId()
ReplicableCommandgetCommandId in interface ReplicableCommandpublic void writeTo(ObjectOutput output) throws IOException
ReplicableCommandObjectOutput.writeTo in interface ReplicableCommandwriteTo in class AbstractTransactionBoundaryCommandoutput - the stream.IOException - if an error occurred during the I/O.public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
ReplicableCommandReplicableCommand.writeTo(ObjectOutput).readFrom in interface ReplicableCommandreadFrom in class AbstractTransactionBoundaryCommandinput - the stream to read.IOException - if an error occurred during the I/O.ClassNotFoundException - if it tries to load an undefined class.public boolean isUnlock()
public void setUnlock(boolean unlock)
public boolean equals(Object o)
equals in class AbstractTransactionBoundaryCommandpublic int hashCode()
hashCode in class AbstractTransactionBoundaryCommandpublic String toString()
toString in class AbstractTransactionBoundaryCommandpublic Set<Flag> getFlags()
getFlags in interface LocalFlagAffectedCommandLocalFlagAffectedCommand.setFlags(java.util.Set). The set should
not be modified directly, only via the LocalFlagAffectedCommand.setFlags(Set), LocalFlagAffectedCommand.addFlag(Flag) and LocalFlagAffectedCommand.addFlags(Set) methods.public void setFlags(Set<Flag> flags)
LocalFlagAffectedCommandsetFlags in interface LocalFlagAffectedCommandflags - The new flags.public Metadata getMetadata()
MetadataAwareCommandgetMetadata in interface MetadataAwareCommandpublic void setMetadata(Metadata metadata)
MetadataAwareCommandsetMetadata in interface MetadataAwareCommandpublic Collection<Object> getKeysToLock()
RemoteLockCommandCollection with the keys to be lock.
It may return an empty collection if no keys needs to be locked independently of the return value of RemoteLockCommand.hasSkipLocking(). It may contains duplicated keys and null is not a valid return value.
getKeysToLock in interface RemoteLockCommandCollection of keys to lock.public Object getKeyLockOwner()
RemoteLockCommand
Usually, in transaction caches it is the GlobalTransaction and in
non-transactional caches the CommandInvocationId.
getKeyLockOwner in interface RemoteLockCommandpublic boolean hasZeroLockAcquisition()
hasZeroLockAcquisition in interface RemoteLockCommandpublic boolean hasSkipLocking()
RemoteLockCommandhasSkipLocking in interface RemoteLockCommandtrue if locks should be acquired for the keys in RemoteLockCommand.getKeysToLock().Copyright © 2025 JBoss, a division of Red Hat. All rights reserved.