R
- the type of result of the command handlingC
- the type of payload of the commandpublic class MonitorAwareCallback<C,R> extends Object implements CommandCallback<C,R>
Constructor and Description |
---|
MonitorAwareCallback(CommandCallback<C,R> delegate,
MessageMonitor.MonitorCallback messageMonitorCallback)
Initialize a callback wrapped around the
delegate which will notify a Message Monitor for the given messageMonitorCallback . |
Modifier and Type | Method and Description |
---|---|
void |
onFailure(CommandMessage<? extends C> commandMessage,
Throwable cause)
Invoked when command handling execution resulted in an error.
|
void |
onSuccess(CommandMessage<? extends C> commandMessage,
R result)
Invoked when command handling execution was successful.
|
public MonitorAwareCallback(CommandCallback<C,R> delegate, MessageMonitor.MonitorCallback messageMonitorCallback)
delegate
which will notify a Message Monitor for the given messageMonitorCallback
.delegate
- the CommandCallback which is being wrapped, may be null
messageMonitorCallback
- the callback for the Message Monitorpublic void onSuccess(CommandMessage<? extends C> commandMessage, R result)
CommandCallback
onSuccess
in interface CommandCallback<C,R>
commandMessage
- The message that was dispatchedresult
- The result of the command handling execution, if any.public void onFailure(CommandMessage<? extends C> commandMessage, Throwable cause)
CommandCallback
onFailure
in interface CommandCallback<C,R>
commandMessage
- The message that was dispatchedcause
- The exception raised during command handlingCopyright © 2010–2018. All rights reserved.