Class AbstractEventGateway
java.lang.Object
org.axonframework.eventhandling.gateway.AbstractEventGateway
- Direct Known Subclasses:
DefaultEventGateway
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAbstract Builder class to instantiateAbstractEventGatewayimplementations. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiate anAbstractEventGatewaybased on the fields contained in theAbstractEventGateway.Builder. -
Method Summary
Modifier and TypeMethodDescriptionReturns the EventBus used by this EventGateway.protected <E> EventMessage<? extends E> processInterceptors(EventMessage<E> eventMessage) Invokes all the dispatch interceptors and returns the EventMessage instance that should be dispatched.protected voidPublishes (dispatches) an event.protected voidpublishAll(List<?> events) Publishes (dispatches) the givenListofevents.registerDispatchInterceptor(MessageDispatchInterceptor<? super EventMessage<?>> interceptor) Registers an event dispatch interceptor within anEventGateway.
-
Constructor Details
-
AbstractEventGateway
Instantiate anAbstractEventGatewaybased on the fields contained in theAbstractEventGateway.Builder.Will assert that the
EventBusis notnulland throws anAxonConfigurationExceptionif it is.- Parameters:
builder- theAbstractEventGateway.Builderused to instantiate aAbstractEventGatewayinstance
-
-
Method Details
-
publish
Publishes (dispatches) an event.- Parameters:
event- The event to publish.
-
publishAll
Publishes (dispatches) the givenListofevents.- Parameters:
events- TheListof events to publish.
-
registerDispatchInterceptor
public Registration registerDispatchInterceptor(@Nonnull MessageDispatchInterceptor<? super EventMessage<?>> interceptor) Registers an event dispatch interceptor within anEventGateway.- Parameters:
interceptor- To intercept event messages- Returns:
- a registration which can be used to cancel the registration of given interceptor
-
processInterceptors
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
Returns the EventBus used by this EventGateway. Should be used for monitoring or testing.- Returns:
- the EventBus used by this gateway.
-