public abstract static class AbstractEventProcessor.Builder extends Object
AbstractEventProcessor
.
The ErrorHandler
is defaulted to a PropagatingErrorHandler
, the MessageMonitor
defaults
to a NoOpMessageMonitor
and the SpanFactory
defaults to a NoOpSpanFactory
. The Event
Processor name
, EventHandlerInvoker
and RollbackConfiguration
are hard
requirements and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AbstractEventProcessor.Builder |
errorHandler(ErrorHandler errorHandler)
Sets the
ErrorHandler invoked when an UnitOfWork is rolled back during processing. |
AbstractEventProcessor.Builder |
eventHandlerInvoker(EventHandlerInvoker eventHandlerInvoker)
Sets the
EventHandlerInvoker which will handle all the individual EventMessage s. |
AbstractEventProcessor.Builder |
messageMonitor(MessageMonitor<? super EventMessage<?>> messageMonitor)
Sets the
MessageMonitor to monitor EventMessage s before and after they're processed. |
AbstractEventProcessor.Builder |
name(String name)
Sets the
name of this EventProcessor implementation. |
AbstractEventProcessor.Builder |
rollbackConfiguration(RollbackConfiguration rollbackConfiguration)
Sets the
RollbackConfiguration specifying the rollback behavior of the UnitOfWork while
processing a batch of events. |
AbstractEventProcessor.Builder |
spanFactory(SpanFactory spanFactory)
Sets the
SpanFactory implementation to use for providing tracing capabilities. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
protected String name
public AbstractEventProcessor.Builder name(@Nonnull String name)
name
of this EventProcessor
implementation.name
- a String
defining this EventProcessor
implementationpublic AbstractEventProcessor.Builder eventHandlerInvoker(@Nonnull EventHandlerInvoker eventHandlerInvoker)
EventHandlerInvoker
which will handle all the individual EventMessage
s.eventHandlerInvoker
- the EventHandlerInvoker
which will handle all the individual EventMessage
spublic AbstractEventProcessor.Builder rollbackConfiguration(@Nonnull RollbackConfiguration rollbackConfiguration)
RollbackConfiguration
specifying the rollback behavior of the UnitOfWork
while
processing a batch of events.rollbackConfiguration
- the RollbackConfiguration
specifying the rollback behavior of the UnitOfWork
while processing a batch of events.public AbstractEventProcessor.Builder errorHandler(@Nonnull ErrorHandler errorHandler)
ErrorHandler
invoked when an UnitOfWork
is rolled back during processing. Defaults
to a PropagatingErrorHandler
.errorHandler
- the ErrorHandler
invoked when an UnitOfWork
is rolled back during
processingpublic AbstractEventProcessor.Builder messageMonitor(@Nonnull MessageMonitor<? super EventMessage<?>> messageMonitor)
MessageMonitor
to monitor EventMessage
s before and after they're processed. Defaults
to a NoOpMessageMonitor
.messageMonitor
- a MessageMonitor
to monitor EventMessage
s before and after they're
processedpublic AbstractEventProcessor.Builder spanFactory(@Nonnull SpanFactory spanFactory)
SpanFactory
implementation to use for providing tracing capabilities. Defaults to a
NoOpSpanFactory
by default, which provides no tracing capabilities.spanFactory
- The SpanFactory
implementationprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2023. All rights reserved.