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
s.public 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 commands.public 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 Builder.protected void validate() throws AxonConfigurationException
AxonConfigurationException
- If one field is asserted to be incorrect according to the Builder's
specifications.Copyright © 2010–2024. All rights reserved.