public interface ReplicableCommand
RpcManager
Modifier and Type | Method and Description |
---|---|
boolean |
canBlock()
If true, the command is processed asynchronously in a thread provided by an Infinispan thread pool.
|
byte |
getCommandId()
Used by marshallers to convert this command into an id for streaming.
|
default Object[] |
getParameters()
Deprecated.
will be replaced by
writeTo(ObjectOutput) . Note: don't implement both since they are used
during the transition period. |
boolean |
isReturnValueExpected()
If true, a return value will be provided when performed remotely.
|
Object |
perform(InvocationContext ctx)
Performs the primary function of the command.
|
default void |
readFrom(ObjectInput input)
Reads this instance from the stream written by
writeTo(ObjectOutput) . |
default void |
setParameters(int commandId,
Object[] parameters)
Deprecated.
will be replaced by
readFrom(ObjectInput) . Note: don't implement both since they are used
during the transition period. |
default void |
writeTo(ObjectOutput output)
Writes this instance to the
ObjectOutput . |
Object perform(InvocationContext ctx) throws Throwable
ctx
- invocation contextThrowable
- in the event of problems.byte getCommandId()
@Deprecated default Object[] getParameters()
writeTo(ObjectOutput)
. Note: don't implement both since they are used
during the transition period.@Deprecated default void setParameters(int commandId, Object[] parameters)
readFrom(ObjectInput)
. Note: don't implement both since they are used
during the transition period.CommandsFactory
to create a command from raw data read off a stream.commandId
- command id to set. This is usually unused but *could* be used in the event of a command having
multiple IDs, such as PutKeyValueCommand
.parameters
- object array of argsboolean isReturnValueExpected()
ResponseGenerator
may choose to simply return null to save on marshalling costs.boolean canBlock()
true
if the command can block/wait, false
otherwisedefault void writeTo(ObjectOutput output) throws IOException
ObjectOutput
.output
- the stream.IOException
- if an error occurred during the I/O.default void readFrom(ObjectInput input) throws IOException, ClassNotFoundException
writeTo(ObjectOutput)
.input
- the stream to read.IOException
- if an error occurred during the I/O.ClassNotFoundException
- if it tries to load an undefined class.Copyright © 2022 JBoss, a division of Red Hat. All rights reserved.