Class AbstractEventGateway

java.lang.Object
org.axonframework.eventhandling.gateway.AbstractEventGateway
Direct Known Subclasses:
DefaultEventGateway

public abstract class AbstractEventGateway extends Object
Abstract implementation of an EventGateway, which handles the dispatch interceptors. The actual publishing of events is left to the subclasses.
Since:
4.1
Author:
Bert Laverman
  • Constructor Details

  • Method Details

    • publish

      protected void publish(@Nonnull Object event)
      Publishes (dispatches) an event.
      Parameters:
      event - The event to publish.
    • publishAll

      protected void publishAll(@Nonnull List<?> events)
      Publishes (dispatches) the given List of events.
      Parameters:
      events - The List of events to publish.
    • registerDispatchInterceptor

      public Registration registerDispatchInterceptor(@Nonnull MessageDispatchInterceptor<? super EventMessage<?>> interceptor)
      Registers an event dispatch interceptor within an EventGateway.
      Parameters:
      interceptor - To intercept event messages
      Returns:
      a registration which can be used to cancel the registration of given interceptor
    • processInterceptors

      protected <E> EventMessage<? extends E> processInterceptors(EventMessage<E> eventMessage)
      Invokes all the dispatch interceptors and returns the EventMessage instance that should be dispatched.
      Parameters:
      eventMessage - The incoming event message
      Returns:
      The event message to dispatch
    • getEventBus

      public EventBus getEventBus()
      Returns the EventBus used by this EventGateway. Should be used for monitoring or testing.
      Returns:
      the EventBus used by this gateway.