Interface EventHandlingComponent

All Superinterfaces:
DescribableComponent, EventHandler, MessageHandler
All Known Implementing Classes:
AnnotatedEventHandlingComponent, DelegatingEventHandlingComponent, InterceptingEventHandlingComponent, SequenceCachingEventHandlingComponent, SequenceOverridingEventHandlingComponent, SequencingEventHandlingComponent, SimpleEventHandlingComponent, TracingEventHandlingComponent

public interface EventHandlingComponent extends EventHandler, DescribableComponent
Interface describing a group of EventHandlers belonging to a single component.

As such, it allows registration of EventHandlers through the EventHandlerRegistry. Besides handling and registration, it specifies which events it supports.

Since:
3.0.0
Author:
Rene de Waele, Steven van Beelen
  • Method Details

    • supportedEvents

      Set<QualifiedName> supportedEvents()
      All supported events, referenced through a QualifiedName.
      Returns:
      All supported events, referenced through a QualifiedName.
    • supports

      default boolean supports(@Nonnull QualifiedName eventName)
      Checks whether the given eventName is supported by this component.
      Parameters:
      eventName - The name of the event to check for support.
      Returns:
      true if the given eventName is supported, false otherwise.
    • sequenceIdentifierFor

      @Nonnull Object sequenceIdentifierFor(@Nonnull EventMessage event, @Nonnull ProcessingContext context)
      Returns the sequence identifier for the given event. When two events have the same sequence identifier (as defined by their equals method), they will be executed sequentially. Important: All EventHandlers for the same QualifiedName within a single EventHandlingComponent must return the same sequence identifier for a given event. Mixing different sequence identifiers within the scope of a single EventHandlingComponent is not supported and may lead to undefined behavior.
      Parameters:
      event - The event for which to get the sequencing identifier.
      context - The processing context in which the event is being handled.
      Returns:
      A sequence identifier for the given event.