public static class DistributedCommandBus.Builder extends Object
DistributedCommandBus
.
The MessageMonitor
is defaulted to a NoOpMessageMonitor
.
The CommandRouter
and CommandBusConnector
are hard requirements and as such should be
provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
DistributedCommandBus |
build()
Initializes a
DistributedCommandBus as specified through this Builder. |
DistributedCommandBus.Builder |
commandRouter(CommandRouter commandRouter)
Sets the
CommandRouter used to determine the target node for each dispatched command. |
DistributedCommandBus.Builder |
connector(CommandBusConnector connector)
Sets the
CommandBusConnector which performs the actual transport of the message to the destination
node. |
DistributedCommandBus.Builder |
messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
Sets the
MessageMonitor for generic types implementing CommandMessage , which is used to
monitor incoming messages and their execution result. |
protected void |
validate()
Validate whether the fields contained in this Builder as set accordingly.
|
public DistributedCommandBus.Builder commandRouter(CommandRouter commandRouter)
CommandRouter
used to determine the target node for each dispatched command.commandRouter
- a CommandRouter
used to determine the target node for each dispatched commandpublic DistributedCommandBus.Builder connector(CommandBusConnector connector)
CommandBusConnector
which performs the actual transport of the message to the destination
node.connector
- a CommandBusConnector
which performs the actual transport of the message to the
destination nodepublic DistributedCommandBus.Builder messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
MessageMonitor
for generic types implementing CommandMessage
, which is used to
monitor incoming messages and their execution result.messageMonitor
- a MessageMonitor
used to monitor incoming messages and their execution resultpublic DistributedCommandBus build()
DistributedCommandBus
as specified through this Builder.DistributedCommandBus
as specified through this Builderprotected void validate()
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2019. All rights reserved.