A
- The type of the session identifierC
- The type of the commandR
- The type of the expected resultpublic class CommandCallbackWrapper<A,C,R> extends Object implements CommandCallback<C,R>
Constructor and Description |
---|
CommandCallbackWrapper(A channelId,
CommandMessage<C> message,
CommandCallback<? super C,? super R> callback)
Initializes a
CommandCallbackWrapper which wraps the original callback and holds on to the
command message and channelId of the channel on which the message is sent. |
Modifier and Type | Method and Description |
---|---|
A |
getChannelIdentifier()
Returns the identifier of the channel over which the command message was sent.
|
CommandMessage<C> |
getMessage()
Returns the command message that was sent.
|
void |
onResult(CommandMessage<? extends C> message,
CommandResultMessage<? extends R> commandResultMessage)
Invoked when command handling execution is completed.
|
void |
reportResult(CommandResultMessage<R> result)
Invokes
CommandCallback.onResult(CommandMessage, CommandResultMessage) with given result on
the wrapped callback. |
public CommandCallbackWrapper(A channelId, CommandMessage<C> message, CommandCallback<? super C,? super R> callback)
CommandCallbackWrapper
which wraps the original callback and holds on to the
command message
and channelId
of the channel on which the message is sent.channelId
- used to identify the channel used to send the messagemessage
- the command message that was sentcallback
- the command callback to notify when the command result is receivedpublic CommandMessage<C> getMessage()
public A getChannelIdentifier()
public void reportResult(CommandResultMessage<R> result)
CommandCallback.onResult(CommandMessage, CommandResultMessage)
with given result
on
the wrapped callback.result
- the result of the commandpublic void onResult(CommandMessage<? extends C> message, CommandResultMessage<? extends R> commandResultMessage)
CommandCallback
onResult
in interface CommandCallback<C,R>
message
- the CommandMessage
that was dispatchedcommandResultMessage
- the CommandResultMessage
of the command handling executionCopyright © 2010–2019. All rights reserved.