Package org.axonframework.eventhandling
Class AbstractEventProcessor.Builder
java.lang.Object
org.axonframework.eventhandling.AbstractEventProcessor.Builder
- Direct Known Subclasses:
PooledStreamingEventProcessor.Builder,SubscribingEventProcessor.Builder,TrackingEventProcessor.Builder
- Enclosing class:
AbstractEventProcessor
Abstract Builder class to instantiate a
AbstractEventProcessor.
The ErrorHandler is defaulted to a PropagatingErrorHandler, the MessageMonitor defaults
to a NoOpMessageMonitor and the EventProcessorSpanFactory defaults to
DefaultEventProcessorSpanFactory backed by a NoOpSpanFactory. The Event Processor name,
EventHandlerInvoker and RollbackConfiguration are hard requirements and as such should be
provided.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionerrorHandler(ErrorHandler errorHandler) Sets theErrorHandlerinvoked when anUnitOfWorkis rolled back during processing.eventHandlerInvoker(EventHandlerInvoker eventHandlerInvoker) Sets theEventHandlerInvokerwhich will handle all the individualEventMessages.messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor) Sets theMessageMonitorto monitorEventMessages before and after they're processed.Sets thenameof thisEventProcessorimplementation.rollbackConfiguration(RollbackConfiguration rollbackConfiguration) Sets theRollbackConfigurationspecifying the rollback behavior of theUnitOfWorkwhile processing a batch of events.spanFactory(EventProcessorSpanFactory spanFactory) Sets theEventProcessorSpanFactoryimplementation to use for providing tracing capabilities.spanFactory(SpanFactory spanFactory) Deprecated.protected voidvalidate()Validates whether the fields contained in this Builder are set accordingly.
-
Field Details
-
name
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
name
Sets thenameof thisEventProcessorimplementation.- Parameters:
name- aStringdefining thisEventProcessorimplementation- Returns:
- the current Builder instance, for fluent interfacing
-
eventHandlerInvoker
public AbstractEventProcessor.Builder eventHandlerInvoker(@Nonnull EventHandlerInvoker eventHandlerInvoker) Sets theEventHandlerInvokerwhich will handle all the individualEventMessages.- Parameters:
eventHandlerInvoker- theEventHandlerInvokerwhich will handle all the individualEventMessages- Returns:
- the current Builder instance, for fluent interfacing
-
rollbackConfiguration
public AbstractEventProcessor.Builder rollbackConfiguration(@Nonnull RollbackConfiguration rollbackConfiguration) Sets theRollbackConfigurationspecifying the rollback behavior of theUnitOfWorkwhile processing a batch of events.- Parameters:
rollbackConfiguration- theRollbackConfigurationspecifying the rollback behavior of theUnitOfWorkwhile processing a batch of events.- Returns:
- the current Builder instance, for fluent interfacing
-
errorHandler
Sets theErrorHandlerinvoked when anUnitOfWorkis rolled back during processing. Defaults to aPropagatingErrorHandler.- Parameters:
errorHandler- theErrorHandlerinvoked when anUnitOfWorkis rolled back during processing- Returns:
- the current Builder instance, for fluent interfacing
-
messageMonitor
public AbstractEventProcessor.Builder messageMonitor(@Nonnull MessageMonitor<? super EventMessage<?>> messageMonitor) Sets theMessageMonitorto monitorEventMessages before and after they're processed. Defaults to aNoOpMessageMonitor.- Parameters:
messageMonitor- aMessageMonitorto monitorEventMessages before and after they're processed- Returns:
- the current Builder instance, for fluent interfacing
-
spanFactory
Deprecated.Sets theSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aNoOpSpanFactoryby default, which provides no tracing capabilities.- Parameters:
spanFactory- TheSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
spanFactory
Sets theEventProcessorSpanFactoryimplementation to use for providing tracing capabilities. Defaults to aDefaultEventProcessorSpanFactorybacked by aNoOpSpanFactoryby default, which provides no tracing capabilities.- Parameters:
spanFactory- TheSpanFactoryimplementation- Returns:
- The current Builder instance, for fluent interfacing.
-
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
-
invalid input: 'for more configuration options instead'