Interface EventManager


@Contract public interface EventManager
Event manager is used by generated code to manage events and listeners.
  • Method Details

    • register

      <T> void register(ResolvedType eventType, Consumer<T> eventConsumer, Set<Qualifier> qualifiers)
      Register an event consumer.
      Type Parameters:
      T - type of the event object
      Parameters:
      eventType - type of event
      eventConsumer - consumer accepting the event
      qualifiers - qualifiers the consumer is interested in
    • registerAsync

      <T> void registerAsync(ResolvedType eventType, Consumer<T> eventConsumer, Set<Qualifier> qualifiers)
      Register an asynchronous event consumer.
      Type Parameters:
      T - type of the event object
      Parameters:
      eventType - type of event
      eventConsumer - consumer accepting the event
      qualifiers - qualifiers the consumer is interested in
    • emit

      void emit(ResolvedType eventObjectType, Object eventObject, Set<Qualifier> qualifiers)
      Emit an event.
      Parameters:
      eventObjectType - type of event
      eventObject - event object instance
      qualifiers - qualifiers of the producer of the event
    • emitAsync

      <T> CompletionStage<T> emitAsync(ResolvedType eventObjectType, T eventObject, Set<Qualifier> qualifiers)
      Emit an asynchronous event.
      Type Parameters:
      T - type of the event object
      Parameters:
      eventObjectType - type of event
      eventObject - event object instance
      qualifiers - qualifiers of the producer of the event
      Returns:
      completion stage that completes when all synchronous event observers are notified; it may end exceptionally, if any of these throws an exception - in such a case all exceptions are available through the cause, or suppressed exceptions of EventDispatchException