Interface EventGateway

All Superinterfaces:
DescribableComponent
All Known Implementing Classes:
DefaultEventGateway

public interface EventGateway extends DescribableComponent
Interface towards the Event Handling components of an application.

This interface provides a friendlier API toward the EventSink and allows for components to easily publish events.

Since:
4.1.0
Author:
Bert Laverman
See Also:
  • Method Details

    • publish

      default CompletableFuture<Void> publish(@Nullable ProcessingContext context, Object... events)
      Publishes the given events within the given context. When present, the events should be published as part of the context's lifecycle.

      The events are mapped to EventMessages before they are given to an EventSink.

      Parameters:
      context - The processing context, if any, to publish the given events in.
      events - The collection of events to publish.
      Returns:
      A CompletableFuture of Void. Completion of the future depends on the EventSink used by this gateway.
    • publish

      CompletableFuture<Void> publish(@Nullable ProcessingContext context, List<?> events)
      Publishes the given events within the given context. When present, the events should be published as part of the context's lifecycle.

      The events are mapped to EventMessages before they are given to an EventSink.

      Parameters:
      context - The processing context, if any, to publish the given events in.
      events - The collection of events to publish.
      Returns:
      A CompletableFuture of Void. Completion of the future depends on the EventSink used by this gateway.
    • publish

      default CompletableFuture<Void> publish(List<?> events)
      Publishes the given events within the given context. When present, the events should be published as part of the context's lifecycle.

      The events are mapped to EventMessages before they are given to an EventSink.

      Parameters:
      events - The collection of events to publish.
      Returns:
      A CompletableFuture of Void. Completion of the future depends on the EventSink used by this gateway.
      See Also: