public class LockControlCommand extends AbstractTransactionBoundaryCommand implements FlagAffectedCommand, TopologyAffectedCommand, TransactionalRemoteLockCommand
VisitableCommand.LoadType| Modifier and Type | Field and Description |
|---|---|
static int |
COMMAND_ID |
cacheName, globalTx| Constructor and Description |
|---|
LockControlCommand(ByteString cacheName) |
LockControlCommand(Collection<?> keys,
ByteString cacheName,
long flags,
GlobalTransaction gtx) |
LockControlCommand(Object key,
ByteString cacheName,
long flags,
GlobalTransaction gtx) |
| 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(ComponentRegistry componentRegistry)
It creates the transaction context.
|
boolean |
equals(Object o) |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
long |
getFlagsBitSet() |
Object |
getKeyLockOwner()
It returns the lock owner of the key.
|
Collection<Object> |
getKeys() |
Collection<?> |
getKeysToLock()
It returns a
Collection with the keys to be lock. |
Object |
getSingleKey() |
int |
hashCode() |
boolean |
hasSkipLocking()
It checks if this command should acquire locks.
|
boolean |
hasZeroLockAcquisition() |
CompletionStage<?> |
invokeAsync(ComponentRegistry registry)
Invoke the command asynchronously.
|
boolean |
isUnlock() |
boolean |
multipleKeys() |
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput). |
void |
setFlagsBitSet(long bitSet)
Set the flags, replacing any existing flags.
|
void |
setGlobalTransaction(GlobalTransaction gtx) |
void |
setUnlock(boolean unlock) |
String |
toString() |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput. |
getCacheName, getGlobalTransaction, getOrigin, getTopologyId, invalidRemoteTxReturnValue, isReturnValueExpected, loadType, markTransactionAsRemote, setOrigin, setTopologyId, visitRemoteTransactionclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddFlag, addFlags, addFlags, getFlags, hasAllFlags, hasAnyFlag, hasFlag, setFlagsinit, loadTypegetTopologyId, setTopologyIdpublic static final int COMMAND_ID
public LockControlCommand(ByteString cacheName)
public LockControlCommand(Collection<?> keys, ByteString cacheName, long flags, GlobalTransaction gtx)
public LockControlCommand(Object key, ByteString cacheName, long 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 CompletionStage<?> invokeAsync(ComponentRegistry registry) throws Throwable
CacheRpcCommand
This method replaces ReplicableCommand.invoke() for remote execution.
The default implementation and ReplicableCommand.invoke() will be removed in future versions.
invokeAsync in interface CacheRpcCommandinvokeAsync in class AbstractTransactionBoundaryCommandThrowablepublic RemoteTxInvocationContext createContext(ComponentRegistry componentRegistry)
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 long getFlagsBitSet()
getFlagsBitSet in interface FlagAffectedCommandFlagAffectedCommand.setFlagsBitSet(long), FlagAffectedCommand.addFlags(long)
and FlagAffectedCommand.addFlags(Set) methods.public void setFlagsBitSet(long bitSet)
FlagAffectedCommandsetFlagsBitSet in interface FlagAffectedCommandpublic Collection<?> 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 © 2022 JBoss by Red Hat. All rights reserved.