public static class CommandGatewayFactory.Builder extends Object
CommandGatewayFactory
.
The CommandBus
is a hard requirements and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
CommandGatewayFactory |
build()
Initializes a
CommandGatewayFactory as specified through this Builder. |
CommandGatewayFactory.Builder |
commandBus(CommandBus commandBus)
Sets the
CommandBus on which to dispatch CommandMessage s. |
CommandGatewayFactory.Builder |
dispatchInterceptors(List<MessageDispatchInterceptor<? super CommandMessage<?>>> dispatchInterceptors)
Sets the
MessageDispatchInterceptor s which are invoked before dispatching a CommandMessage on
the CommandBus . |
CommandGatewayFactory.Builder |
dispatchInterceptors(MessageDispatchInterceptor<? super CommandMessage<?>>... dispatchInterceptors)
Sets the
MessageDispatchInterceptor s which are invoked before dispatching a CommandMessage on
the CommandBus . |
CommandGatewayFactory.Builder |
retryScheduler(RetryScheduler retryScheduler)
Sets the
RetryScheduler which will decide whether to reschedule commands. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
public CommandGatewayFactory.Builder commandBus(CommandBus commandBus)
CommandBus
on which to dispatch CommandMessage
s.commandBus
- the CommandBus
on which to dispatch CommandMessage
spublic CommandGatewayFactory.Builder retryScheduler(RetryScheduler retryScheduler)
RetryScheduler
which will decide whether to reschedule commands. May be null
to
report failures without rescheduling.retryScheduler
- the RetryScheduler
which will decide whether to reschedule commandspublic CommandGatewayFactory.Builder dispatchInterceptors(MessageDispatchInterceptor<? super CommandMessage<?>>... dispatchInterceptors)
MessageDispatchInterceptor
s which are invoked before dispatching a CommandMessage
on
the CommandBus
. Note that the given dispatchInterceptors
are applied only on commands sent
through gateways that have been created using this factory.dispatchInterceptors
- an array of MessageDispatchInterceptor
s which are invoked before
dispatching a CommandMessage
on the CommandBus
public CommandGatewayFactory.Builder dispatchInterceptors(List<MessageDispatchInterceptor<? super CommandMessage<?>>> dispatchInterceptors)
MessageDispatchInterceptor
s which are invoked before dispatching a CommandMessage
on
the CommandBus
. Note that the given dispatchInterceptors
are applied only on commands sent
through gateways that have been created using this factory.dispatchInterceptors
- a List
of MessageDispatchInterceptor
s which are invoked before
dispatching a CommandMessage
on the CommandBus
public CommandGatewayFactory build()
CommandGatewayFactory
as specified through this Builder.CommandGatewayFactory
as specified through this Builderprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2023. All rights reserved.