Class AbstractEventGateway.Builder
java.lang.Object
org.axonframework.eventhandling.gateway.AbstractEventGateway.Builder
- Direct Known Subclasses:
DefaultEventGateway.Builder
- Enclosing class:
AbstractEventGateway
Abstract Builder class to instantiate
AbstractEventGateway implementations.
The dispatchInterceptors are defaulted to an empty list. The EventBus is a hard
requirement and as such should be provided.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondispatchInterceptors(List<MessageDispatchInterceptor<? super EventMessage<?>>> dispatchInterceptors) dispatchInterceptors(MessageDispatchInterceptor<? super EventMessage<?>>... dispatchInterceptors) Sets theEventBusused to publish events.protected voidvalidate()Validate whether the fields contained in this Builder as set accordingly.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
eventBus
Sets theEventBusused to publish events.- Parameters:
eventBus- anEventBusused to publish events- Returns:
- the current Builder instance, for fluent interfacing
-
dispatchInterceptors
public AbstractEventGateway.Builder dispatchInterceptors(MessageDispatchInterceptor<? super EventMessage<?>>... dispatchInterceptors) Sets theListofMessageDispatchInterceptors forEventMessages. Are invoked when an event is being dispatched.- Parameters:
dispatchInterceptors- which are invoked when an event is being dispatched- Returns:
- the current Builder instance, for fluent interfacing
-
dispatchInterceptors
public AbstractEventGateway.Builder dispatchInterceptors(List<MessageDispatchInterceptor<? super EventMessage<?>>> dispatchInterceptors) Sets theListofMessageDispatchInterceptors forEventMessages. Are invoked when an event is being dispatched.- Parameters:
dispatchInterceptors- which are invoked when an event is being dispatched- Returns:
- the current Builder instance, for fluent interfacing
-
validate
protected void validate()Validate whether the fields contained in this Builder as set accordingly.- Throws:
AxonConfigurationException- if one field is asserted to be incorrect according to the Builder's specifications
-