public final class ReadOnlyKeyCommand<K,V,R> extends AbstractDataCommand implements LocalCommand
key
flags
Constructor and Description |
---|
ReadOnlyKeyCommand() |
ReadOnlyKeyCommand(Object key,
Function<EntryView.ReadEntryView<K,V>,R> f) |
Modifier and Type | Method and Description |
---|---|
Object |
acceptVisitor(InvocationContext ctx,
Visitor visitor)
Accept a visitor, and return the result of accepting this visitor.
|
boolean |
alwaysReadsExistingValues() |
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
Object |
perform(CacheEntry<K,V> entry) |
Object |
perform(InvocationContext ctx)
Performs the primary function of the command.
|
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 . |
canBlock, equals, getKey, hashCode, ignoreCommandOnStatus, isReturnValueExpected, setKey, shouldInvoke
getMetadata, getTopologyId, setMetadata, setTopologyId
getFlags, setFlags
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getTopologyId, setTopologyId
getParameters, setParameters
public ReadOnlyKeyCommand(Object key, Function<EntryView.ReadEntryView<K,V>,R> f)
public ReadOnlyKeyCommand()
public byte getCommandId()
ReplicableCommand
getCommandId
in interface ReplicableCommand
public void writeTo(ObjectOutput output) throws IOException
ReplicableCommand
ObjectOutput
.writeTo
in interface ReplicableCommand
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
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 perform(InvocationContext ctx) throws Throwable
ReplicableCommand
perform
in interface ReplicableCommand
ctx
- invocation contextThrowable
- in the event of problems.public Object perform(CacheEntry<K,V> entry)
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 boolean readsExistingValues()
readsExistingValues
in interface VisitableCommand
true
if the command needs to read the previous values of the keys it acts on.public boolean alwaysReadsExistingValues()
alwaysReadsExistingValues
in interface VisitableCommand
true
if the command needs to read the previous values even on the backup owners.
In transactional caches, this refers to all the owners except the originator.public String toString()
toString
in class AbstractDataCommand
Copyright © 2024 JBoss, a division of Red Hat. All rights reserved.