public static class SimpleCommandBus.Builder extends Object
SimpleCommandBus
.
The TransactionManager
is defaulted to a NoTransactionManager
, the MessageMonitor
is
defaulted to a NoOpMessageMonitor
and the RollbackConfiguration
defaults to a
RollbackConfigurationType.UNCHECKED_EXCEPTIONS
.
The TransactionManager
, MessageMonitor
and RollbackConfiguration
are hard
requirements. Thus setting them to null
will result in an AxonConfigurationException
.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
SimpleCommandBus |
build()
Initializes a
SimpleCommandBus as specified through this Builder. |
SimpleCommandBus.Builder |
messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
Sets the
MessageMonitor of generic type CommandMessage used the to monitor the command bus. |
SimpleCommandBus.Builder |
rollbackConfiguration(RollbackConfiguration rollbackConfiguration)
Sets the
RollbackConfiguration which allows you to specify when a UnitOfWork should be rolled
back. |
SimpleCommandBus.Builder |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to manage transactions. |
protected void |
validate()
Validate whether the fields contained in this Builder as set accordingly.
|
public SimpleCommandBus.Builder transactionManager(TransactionManager transactionManager)
TransactionManager
used to manage transactions. Defaults to a NoTransactionManager
.transactionManager
- a TransactionManager
used to manage transactionspublic SimpleCommandBus.Builder messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
MessageMonitor
of generic type CommandMessage
used the to monitor the command bus.
Defaults to a NoOpMessageMonitor
.messageMonitor
- a MessageMonitor
used the message monitor to monitor the command buspublic SimpleCommandBus.Builder rollbackConfiguration(RollbackConfiguration rollbackConfiguration)
RollbackConfiguration
which allows you to specify when a UnitOfWork
should be rolled
back. Defaults to a RollbackConfigurationType.UNCHECKED_EXCEPTIONS
, which triggers a rollback on all
unchecked exceptions.rollbackConfiguration
- a RollbackConfiguration
specifying when a UnitOfWork
should be
rolled backpublic SimpleCommandBus build()
SimpleCommandBus
as specified through this Builder.SimpleCommandBus
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.