public static class AsynchronousCommandBus.Builder extends SimpleCommandBus.Builder
AsynchronousCommandBus
.
The TransactionManager
, MessageMonitor
, RollbackConfiguration
and Executor
are
respectively defaulted to a NoTransactionManager
, a NoOpMessageMonitor
, a
RollbackConfigurationType.UNCHECKED_EXCEPTIONS
and a Executors.newCachedThreadPool()
. The default
executor
uses an AxonThreadFactory
to create threads with a sensible naming scheme. The
TransactionManager, MessageMonitor, RollbackConfiguration and Executor are hard requirements. Thus setting
them to null
will result in an AxonConfigurationException
.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AsynchronousCommandBus |
build()
Initializes a
AsynchronousCommandBus as specified through this Builder. |
AsynchronousCommandBus.Builder |
executor(Executor executor)
Sets the
Executor which processes the Command dispatching threads. |
AsynchronousCommandBus.Builder |
messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
Sets the
MessageMonitor of generic type CommandMessage used the to monitor the command bus. |
AsynchronousCommandBus.Builder |
rollbackConfiguration(RollbackConfiguration rollbackConfiguration)
Sets the
RollbackConfiguration which allows you to specify when a UnitOfWork should be rolled
back. |
AsynchronousCommandBus.Builder |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to manage transactions. |
validate
public AsynchronousCommandBus.Builder transactionManager(TransactionManager transactionManager)
SimpleCommandBus.Builder
TransactionManager
used to manage transactions. Defaults to a NoTransactionManager
.transactionManager
in class SimpleCommandBus.Builder
transactionManager
- a TransactionManager
used to manage transactionspublic AsynchronousCommandBus.Builder messageMonitor(MessageMonitor<? super CommandMessage<?>> messageMonitor)
SimpleCommandBus.Builder
MessageMonitor
of generic type CommandMessage
used the to monitor the command bus.
Defaults to a NoOpMessageMonitor
.messageMonitor
in class SimpleCommandBus.Builder
messageMonitor
- a MessageMonitor
used the message monitor to monitor the command buspublic AsynchronousCommandBus.Builder rollbackConfiguration(RollbackConfiguration rollbackConfiguration)
SimpleCommandBus.Builder
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
in class SimpleCommandBus.Builder
rollbackConfiguration
- a RollbackConfiguration
specifying when a UnitOfWork
should be
rolled backpublic AsynchronousCommandBus.Builder executor(Executor executor)
Executor
which processes the Command dispatching threads.executor
- a Executor
to processes the Command dispatching threadspublic AsynchronousCommandBus build()
AsynchronousCommandBus
as specified through this Builder.build
in class SimpleCommandBus.Builder
AsynchronousCommandBus
as specified through this BuilderCopyright © 2010–2019. All rights reserved.