Class RetryingCallback<C,R>
java.lang.Object
org.axonframework.commandhandling.gateway.RetryingCallback<C,R>
- Type Parameters:
C- The type of payload of the dispatched commandR- The type of return value expected by the callback
- All Implemented Interfaces:
CommandCallback<C,R>
Callback implementation that will invoke a retry scheduler if a command results in a runtime exception.
Generally, it is not necessary to use this class directly. It is used by CommandGateway implementations to support
retrying of commands.
- Since:
- 2.0
- Author:
- Allard Buijze
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionRetryingCallback(CommandCallback<C, R> delegate, RetryScheduler retryScheduler, CommandBus commandBus) Initialize the RetryingCallback with the givendelegate, representing the actual callback passed as a parameter to dispatch, the givencommandMessage,retrySchedulerandcommandBus. -
Method Summary
Modifier and TypeMethodDescriptionvoidonResult(CommandMessage<? extends C> commandMessage, CommandResultMessage<? extends R> commandResultMessage) Invoked when command handling execution is completed.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.commandhandling.CommandCallback
wrap
-
Constructor Details
-
RetryingCallback
public RetryingCallback(CommandCallback<C, R> delegate, RetryScheduler retryScheduler, CommandBus commandBus) Initialize the RetryingCallback with the givendelegate, representing the actual callback passed as a parameter to dispatch, the givencommandMessage,retrySchedulerandcommandBus.- Parameters:
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 dispatched
-
-
Method Details
-
onResult
public void onResult(@Nonnull CommandMessage<? extends C> commandMessage, @Nonnull CommandResultMessage<? extends R> commandResultMessage) Description copied from interface:CommandCallbackInvoked when command handling execution is completed.- Specified by:
onResultin interfaceCommandCallback<C,R> - Parameters:
commandMessage- theCommandMessagethat was dispatchedcommandResultMessage- theCommandResultMessageof the command handling execution
-