Interface EventMessageHandler

All Superinterfaces:
MessageHandler<EventMessage<?>>
All Known Subinterfaces:
Saga<T>
All Known Implementing Classes:
AnnotatedSaga, AnnotationEventHandlerAdapter, EventValidator

public interface EventMessageHandler extends MessageHandler<EventMessage<?>>
Interface to be implemented by classes that can handle events.
Since:
0.1
Author:
Allard Buijze
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    handle(EventMessage<?> event)
    Process the given event.
    default void
    Performs any activities that are required to reset the state managed by handlers assigned to this handler.
    default <R> void
    prepareReset(R resetContext)
    Performs any activities that are required to reset the state managed by handlers assigned to this handler.
    default boolean
    Indicates whether the handlers managed by this invoker support a reset.

    Methods inherited from interface org.axonframework.messaging.MessageHandler

    canHandle, canHandleType, getTargetType
  • Method Details

    • handle

      Object handle(EventMessage<?> event) throws Exception
      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:
      handle in interface MessageHandler<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 provided resetContext
      Parameters:
      resetContext - a R used to support the reset operation
    • supportsReset

      default boolean supportsReset()
      Indicates whether the handlers managed by this invoker support a reset.
      Returns:
      true if a reset is supported, otherwise false