public class InvalidateCommand extends RemoveCommand
Modifier and Type | Field and Description |
---|---|
static int |
COMMAND_ID |
protected Object[] |
keys |
notifier, value, valueEquivalence, valueMatcher
commandInvocationId
key
flags
Constructor and Description |
---|
InvalidateCommand() |
InvalidateCommand(CacheNotifier notifier,
Set<Flag> flags,
Collection<Object> keys,
CommandInvocationId commandInvocationId) |
InvalidateCommand(CacheNotifier notifier,
Set<Flag> flags,
CommandInvocationId commandInvocationId,
Object... keys) |
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) |
Set<Object> |
getAffectedKeys() |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Object |
getKey() |
Object[] |
getKeys() |
Collection<Object> |
getKeysToLock()
It returns a
Collection with the keys to be lock. |
int |
hashCode() |
boolean |
ignoreCommandOnStatus(ComponentStatus status)
Similar to
VisitableCommand.shouldInvoke(InvocationContext) but evaluated by InvocationContextInterceptor . |
protected void |
invalidate(InvocationContext ctx,
Object keyToInvalidate) |
void |
notify(InvocationContext ctx,
Object removedValue,
Metadata removedMetadata,
boolean isPre) |
Object |
perform(InvocationContext ctx)
Performs an invalidation on a specified entry
|
void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
ReplicableCommand.writeTo(ObjectOutput) . |
boolean |
readsExistingValues() |
String |
toString() |
void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput . |
getValue, getValueMatcher, init, isConditional, isNonExistent, isReturnValueExpected, isSuccessful, performRemove, setValue, setValueMatcher, updateStatusFromRemoteResponse
canBlock, getKeyLockOwner, hasSkipLocking, hasZeroLockAcquisition
setKey, shouldInvoke
getMetadata, getTopologyId, setMetadata, setTopologyId
getFlags, setFlags
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
isWriteOnly
alwaysReadsExistingValues, shouldInvoke
getTopologyId, setTopologyId
getParameters, setParameters
getMetadata, setMetadata
public static final int COMMAND_ID
protected Object[] keys
public InvalidateCommand()
public InvalidateCommand(CacheNotifier notifier, Set<Flag> flags, CommandInvocationId commandInvocationId, Object... keys)
public InvalidateCommand(CacheNotifier notifier, Set<Flag> flags, Collection<Object> keys, CommandInvocationId commandInvocationId)
public Object perform(InvocationContext ctx) throws Throwable
perform
in interface ReplicableCommand
perform
in class RemoveCommand
ctx
- invocation contextThrowable
- in the event of problems.protected void invalidate(InvocationContext ctx, Object keyToInvalidate) throws Throwable
Throwable
public void notify(InvocationContext ctx, Object removedValue, Metadata removedMetadata, boolean isPre)
notify
in class RemoveCommand
public byte getCommandId()
ReplicableCommand
getCommandId
in interface ReplicableCommand
getCommandId
in class RemoveCommand
public String toString()
toString
in class RemoveCommand
public void writeTo(ObjectOutput output) throws IOException
ReplicableCommand
ObjectOutput
.writeTo
in interface ReplicableCommand
writeTo
in class RemoveCommand
output
- the stream.IOException
- if an error occurred during the I/O.public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
ReplicableCommand
ReplicableCommand.writeTo(ObjectOutput)
.readFrom
in interface ReplicableCommand
readFrom
in class RemoveCommand
input
- the stream to read.IOException
- if an error occurred during the I/O.ClassNotFoundException
- if it tries to load an undefined class.public Object acceptVisitor(InvocationContext ctx, Visitor visitor) throws Throwable
VisitableCommand
acceptVisitor
in interface VisitableCommand
acceptVisitor
in class RemoveCommand
ctx
- invocation contextvisitor
- visitor to acceptThrowable
- in the event of problemspublic Object getKey()
getKey
in interface DataCommand
getKey
in class AbstractDataCommand
public Object[] getKeys()
public Set<Object> getAffectedKeys()
getAffectedKeys
in interface WriteCommand
getAffectedKeys
in class AbstractDataWriteCommand
public 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
getKeysToLock
in class AbstractDataWriteCommand
Collection
of keys to lock.public boolean ignoreCommandOnStatus(ComponentStatus status)
VisitableCommand
VisitableCommand.shouldInvoke(InvocationContext)
but evaluated by InvocationContextInterceptor
.
Commands can opt to be discarded in case the cache status is not suited (as InvalidateCommand
)ignoreCommandOnStatus
in interface VisitableCommand
ignoreCommandOnStatus
in class RemoveCommand
public boolean readsExistingValues()
readsExistingValues
in interface VisitableCommand
readsExistingValues
in class RemoveCommand
true
if the command needs to read the previous values of the keys it acts on.public boolean equals(Object o)
equals
in class RemoveCommand
public int hashCode()
hashCode
in class RemoveCommand
Copyright © 2018 JBoss, a division of Red Hat. All rights reserved.