public abstract static class AbstractCommandGateway.Builder extends Object
AbstractCommandGateway implementations.
The dispatchInterceptors are defaulted to an empty list.
The CommandBus is a hard requirement and as such should be provided.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
AbstractCommandGateway.Builder |
commandBus(CommandBus commandBus)
Sets the
CommandBus used to dispatch commands. |
AbstractCommandGateway.Builder |
dispatchInterceptors(List<MessageDispatchInterceptor<? super CommandMessage<?>>> dispatchInterceptors)
|
AbstractCommandGateway.Builder |
dispatchInterceptors(MessageDispatchInterceptor<? super CommandMessage<?>>... dispatchInterceptors)
|
AbstractCommandGateway.Builder |
retryScheduler(RetryScheduler retryScheduler)
Sets the
RetryScheduler capable of performing retries of failed commands. |
protected void |
validate()
Validate whether the fields contained in this Builder as set accordingly.
|
public AbstractCommandGateway.Builder commandBus(CommandBus commandBus)
CommandBus used to dispatch commands.commandBus - a CommandBus used to dispatch commandspublic AbstractCommandGateway.Builder retryScheduler(RetryScheduler retryScheduler)
RetryScheduler capable of performing retries of failed commands. May be null when
to prevent retries.retryScheduler - a RetryScheduler capable of performing retries of failed commandspublic AbstractCommandGateway.Builder dispatchInterceptors(MessageDispatchInterceptor<? super CommandMessage<?>>... dispatchInterceptors)
List of MessageDispatchInterceptors for CommandMessages.
Are invoked when a command is being dispatched.dispatchInterceptors - which are invoked when a command is being dispatchedpublic AbstractCommandGateway.Builder dispatchInterceptors(List<MessageDispatchInterceptor<? super CommandMessage<?>>> dispatchInterceptors)
List of MessageDispatchInterceptors for CommandMessages.
Are invoked when a command is being dispatched.dispatchInterceptors - which are invoked when a command is being dispatchedprotected void validate()
AxonConfigurationException - if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2020. All rights reserved.