public abstract class AbstractDataWriteCommand extends AbstractDataCommand implements DataWriteCommand, RemoteLockCommand
Modifier and Type | Field and Description |
---|---|
protected CommandInvocationId |
commandInvocationId |
key
flags
Modifier | Constructor and Description |
---|---|
protected |
AbstractDataWriteCommand() |
protected |
AbstractDataWriteCommand(Object key,
Set<Flag> flags,
CommandInvocationId commandInvocationId) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBlock()
If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool.
|
Set<Object> |
getAffectedKeys() |
Object |
getKeyLockOwner()
It returns the lock owner of the key.
|
Collection<Object> |
getKeysToLock()
It returns a
Collection with the keys to be lock. |
boolean |
hasSkipLocking()
It checks if this command should acquire locks.
|
boolean |
hasZeroLockAcquisition() |
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
equals, getKey, hashCode, ignoreCommandOnStatus, setKey, shouldInvoke, toString
getMetadata, getTopologyId, setMetadata, setTopologyId
getFlags, setFlags
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getValueMatcher, isConditional, isSuccessful, isWriteOnly, setValueMatcher, updateStatusFromRemoteResponse
acceptVisitor, alwaysReadsExistingValues, ignoreCommandOnStatus, readsExistingValues, shouldInvoke
getTopologyId, setTopologyId
getCommandId, getParameters, perform, readFrom, setParameters, writeTo
getMetadata, setMetadata
addFlag, addFlags, getFlags, hasFlag, setFlags, setFlags
getKey
protected CommandInvocationId commandInvocationId
protected AbstractDataWriteCommand()
protected AbstractDataWriteCommand(Object key, Set<Flag> flags, CommandInvocationId commandInvocationId)
public Set<Object> getAffectedKeys()
getAffectedKeys
in interface WriteCommand
public boolean isReturnValueExpected()
ReplicableCommand
ResponseGenerator
may choose to simply return null to save on marshalling costs.isReturnValueExpected
in interface ReplicableCommand
isReturnValueExpected
in class AbstractDataCommand
public boolean canBlock()
ReplicableCommand
canBlock
in interface ReplicableCommand
canBlock
in class AbstractDataCommand
true
if the command can block/wait, false
otherwisepublic Collection<Object> getKeysToLock()
RemoteLockCommand
Collection
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 RemoteLockCommand
Collection
of keys to lock.public final Object getKeyLockOwner()
RemoteLockCommand
Usually, in transaction caches it is the GlobalTransaction
and in
non-transactional caches the CommandInvocationId
.
getKeyLockOwner
in interface RemoteLockCommand
public final boolean hasZeroLockAcquisition()
hasZeroLockAcquisition
in interface RemoteLockCommand
public final boolean hasSkipLocking()
RemoteLockCommand
hasSkipLocking
in interface RemoteLockCommand
true
if locks should be acquired for the keys in RemoteLockCommand.getKeysToLock()
.Copyright © 2017 JBoss, a division of Red Hat. All rights reserved.