Package org.axonframework.eventhandling
Interface EventMessageHandler
- All Superinterfaces:
MessageHandler<EventMessage<?>>
- All Known Subinterfaces:
Saga<T>
- All Known Implementing Classes:
AnnotatedSaga,AnnotationEventHandlerAdapter,EventValidator
Interface to be implemented by classes that can handle events.
- Since:
- 0.1
- Author:
- Allard Buijze
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionhandle(EventMessage<?> event) Process the given event.default voidPerforms any activities that are required to reset the state managed by handlers assigned to this handler.default <R> voidprepareReset(R resetContext) Performs any activities that are required to reset the state managed by handlers assigned to this handler.default booleanIndicates whether the handlers managed by this invoker support a reset.Methods inherited from interface org.axonframework.messaging.MessageHandler
canHandle, canHandleType, getTargetType
-
Method Details
-
handle
Process the given event. The implementation may decide to process or skip the given event. It is highly unrecommended to throw any exception during the event handling process.- Specified by:
handlein interfaceMessageHandler<EventMessage<?>>- Parameters:
event- the event to handle- Returns:
- the result of the event handler invocation. Is generally ignored
- Throws:
Exception- when an exception is raised during event handling
-
prepareReset
default void prepareReset()Performs any activities that are required to reset the state managed by handlers assigned to this handler. -
prepareReset
default <R> void prepareReset(R resetContext) Performs any activities that are required to reset the state managed by handlers assigned to this handler.- Type Parameters:
R- the type of the providedresetContext- Parameters:
resetContext- aRused to support the reset operation
-
supportsReset
default boolean supportsReset()Indicates whether the handlers managed by this invoker support a reset.- Returns:
trueif a reset is supported, otherwisefalse
-