public static class SimpleQueryBus.Builder extends Object
SimpleQueryBus
.
The MessageMonitor
is defaulted to NoOpMessageMonitor
, TransactionManager
to NoTransactionManager
, QueryInvocationErrorHandler
to LoggingQueryInvocationErrorHandler
, and
QueryUpdateEmitter
to SimpleQueryUpdateEmitter
.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
SimpleQueryBus |
build()
Initializes a
SimpleQueryBus as specified through this Builder. |
SimpleQueryBus.Builder |
errorHandler(QueryInvocationErrorHandler errorHandler)
Sets the
QueryInvocationErrorHandler to handle exceptions during query handler invocation. |
SimpleQueryBus.Builder |
messageMonitor(MessageMonitor<? super QueryMessage<?,?>> messageMonitor)
Sets the
MessageMonitor used to monitor query messages. |
SimpleQueryBus.Builder |
queryUpdateEmitter(QueryUpdateEmitter queryUpdateEmitter)
Sets the
QueryUpdateEmitter used to emits updates for the
QueryBus.subscriptionQuery(SubscriptionQueryMessage) . |
SimpleQueryBus.Builder |
transactionManager(TransactionManager transactionManager)
Sets the
TransactionManager used to manage the query handling transactions. |
protected void |
validate()
Validate whether the fields contained in this Builder are set accordingly.
|
public SimpleQueryBus.Builder messageMonitor(MessageMonitor<? super QueryMessage<?,?>> messageMonitor)
MessageMonitor
used to monitor query messages. Defaults to a NoOpMessageMonitor
.messageMonitor
- a MessageMonitor
used to monitor query messagespublic SimpleQueryBus.Builder transactionManager(TransactionManager transactionManager)
TransactionManager
used to manage the query handling transactions. Defaults to a
NoTransactionManager
.transactionManager
- a TransactionManager
used to manage the query handling transactionspublic SimpleQueryBus.Builder errorHandler(QueryInvocationErrorHandler errorHandler)
QueryInvocationErrorHandler
to handle exceptions during query handler invocation. Defaults
to a LoggingQueryInvocationErrorHandler
using this instance it's Logger
.errorHandler
- a QueryInvocationErrorHandler
to handle exceptions during query handler
invocationpublic SimpleQueryBus.Builder queryUpdateEmitter(QueryUpdateEmitter queryUpdateEmitter)
QueryUpdateEmitter
used to emits updates for the
QueryBus.subscriptionQuery(SubscriptionQueryMessage)
. Defaults to a SimpleQueryUpdateEmitter
.queryUpdateEmitter
- the QueryUpdateEmitter
used to emits updates for the
QueryBus.subscriptionQuery(SubscriptionQueryMessage)
public SimpleQueryBus build()
SimpleQueryBus
as specified through this Builder.SimpleQueryBus
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–2018. All rights reserved.