Package org.axonframework.eventhandling
Interface EventProcessor
- All Superinterfaces:
MessageHandlerInterceptorSupport<EventMessage<?>>
- All Known Subinterfaces:
StreamingEventProcessor
- All Known Implementing Classes:
AbstractEventProcessor,PooledStreamingEventProcessor,SubscribingEventProcessor,TrackingEventProcessor
An Event Processor processes event messages from an event queue or event bus.
Typically, an Event Processor is in charge of publishing the events to a group of registered handlers. This allows
attributes and behavior (e.g. transaction management, asynchronous processing, distribution) to be applied over
a whole group at once.
- Since:
- 1.2
- Author:
- Allard Buijze
-
Method Summary
Modifier and TypeMethodDescriptionList<MessageHandlerInterceptor<? super EventMessage<?>>> Return the list of already registeredMessageHandlerInterceptors for this event processor.getName()Returns the name of this event processor.booleanisError()Indicates whether the processor has been shut down due to an error.booleanIndicates whether this processor is currently running (i.e. consuming events from its message source).voidshutDown()Stops processing events.default CompletableFuture<Void> Initiates a shutdown, providing aCompletableFuturethat completes when the shutdown process is finished.voidstart()Start processing events.Methods inherited from interface org.axonframework.messaging.MessageHandlerInterceptorSupport
registerHandlerInterceptor
-
Method Details
-
getName
String getName()Returns the name of this event processor. This name is used to detect distributed instances of the same event processor. Multiple instances referring to the same logical event processor (on different JVM's) must have the same name.- Returns:
- the name of this event processor
-
getHandlerInterceptors
List<MessageHandlerInterceptor<? super EventMessage<?>>> getHandlerInterceptors()Return the list of already registeredMessageHandlerInterceptors for this event processor. To register a new interceptor useMessageHandlerInterceptorSupport.registerHandlerInterceptor(MessageHandlerInterceptor)- Returns:
- the list of registered interceptors of this event processor
-
start
void start()Start processing events. -
shutDown
void shutDown()Stops processing events. Blocks until the shutdown is complete. -
isRunning
boolean isRunning()Indicates whether this processor is currently running (i.e. consuming events from its message source).- Returns:
truewhen running, otherwisefalse
-
isError
boolean isError()Indicates whether the processor has been shut down due to an error. In such case, the processor has forcefully shut down, as it wasn't able to automatically recover.Note that this method returns
falsewhen the processor was stopped usingshutDown().- Returns:
truewhen paused due to an error, otherwisefalse
-
shutdownAsync
Initiates a shutdown, providing aCompletableFuturethat completes when the shutdown process is finished.- Returns:
- a CompletableFuture that completes when the shutdown process is finished.
-