R - The type of return value expected by the callbackC - The type of payload of the dispatched commandpublic class RetryingCallback<C,R> extends Object implements CommandCallback<C,R>
DefaultCommandGateway| Constructor and Description |
|---|
RetryingCallback(CommandCallback<C,R> delegate,
RetryScheduler retryScheduler,
CommandBus commandBus)
Initialize the RetryingCallback with the given
delegate, representing the actual callback passed as
a parameter to dispatch, the given commandMessage, retryScheduler and
commandBus. |
| 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 RetryingCallback(CommandCallback<C,R> delegate, RetryScheduler retryScheduler, CommandBus commandBus)
delegate, representing the actual callback passed as
a parameter to dispatch, the given commandMessage, retryScheduler and
commandBus.delegate - The callback to invoke when the command succeeds, or when retries are rejected.retryScheduler - The scheduler that decides if and when a retry should be scheduledcommandBus - The commandBus on which the command must be dispatchedpublic void onSuccess(CommandMessage<? extends C> commandMessage, R result)
CommandCallbackonSuccess 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)
CommandCallbackonFailure in interface CommandCallback<C,R>commandMessage - The message that was dispatchedcause - The exception raised during command handlingCopyright © 2010–2017. All rights reserved.