public abstract static class AbstractEventProcessor.Builder extends Object
AbstractEventProcessor
.
The ErrorHandler
is defaulted to a PropagatingErrorHandler
and the MessageMonitor
defaults to a NoOpMessageMonitor
. 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. |
protected void |
validate()
Validates whether the fields contained in this Builder are set accordingly.
|
protected String name
public AbstractEventProcessor.Builder name(String name)
name
of this EventProcessor
implementation.name
- a String
defining this EventProcessor
implementationpublic AbstractEventProcessor.Builder eventHandlerInvoker(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(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(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(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
processedprotected void validate() throws AxonConfigurationException
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2019. All rights reserved.