Package org.axonframework.queryhandling
Class DefaultQueryGateway.Builder
java.lang.Object
org.axonframework.queryhandling.DefaultQueryGateway.Builder
- Enclosing class:
DefaultQueryGateway
Builder class to instantiate a
DefaultQueryGateway.
The dispatchInterceptors is defaulted to an empty list. The QueryBus is a
hard requirement and as such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Initializes aDefaultQueryGatewayas specified through this Builder.dispatchInterceptors(List<MessageDispatchInterceptor<? super QueryMessage<?, ?>>> dispatchInterceptors) dispatchInterceptors(MessageDispatchInterceptor<? super QueryMessage<?, ?>>... dispatchInterceptors) protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
queryBus
- Parameters:
queryBus- aQueryBusto deliverQueryMessages on received in thisQueryGatewayimplementation- Returns:
- the current Builder instance, for fluent interfacing
-
dispatchInterceptors
public DefaultQueryGateway.Builder dispatchInterceptors(MessageDispatchInterceptor<? super QueryMessage<?, ?>>... dispatchInterceptors) Sets theListofMessageDispatchInterceptors forQueryMessages. Are invoked when a query is being dispatched.- Parameters:
dispatchInterceptors- which are invoked when a query is being dispatched- Returns:
- the current Builder instance, for fluent interfacing
-
dispatchInterceptors
public DefaultQueryGateway.Builder dispatchInterceptors(List<MessageDispatchInterceptor<? super QueryMessage<?, ?>>> dispatchInterceptors) Sets theListofMessageDispatchInterceptors forQueryMessages. Are invoked when a query is being dispatched.- Parameters:
dispatchInterceptors- which are invoked when a query is being dispatched- Returns:
- the current Builder instance, for fluent interfacing
-
build
Initializes aDefaultQueryGatewayas specified through this Builder.- Returns:
- a
DefaultQueryGatewayas specified through this Builder
-
validate
Validates whether the fields contained in this Builder are set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-