Class DefaultEventGateway
java.lang.Object
org.axonframework.eventhandling.gateway.AbstractEventGateway
org.axonframework.eventhandling.gateway.DefaultEventGateway
- All Implemented Interfaces:
EventGateway,MessageDispatchInterceptorSupport<EventMessage<?>>
Default implementation of the EventGateway interface. It allow configuration of
EventDispatchInterceptors.
The Event Dispatch Interceptors can intercept and alter events dispatched on this specific gateway. Typically,
this would be used to add gateway specific meta data to the Event.- Since:
- 4.1
- Author:
- Bert laverman
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInstantiate aDefaultEventGatewaybased on the fields contained in theDefaultEventGateway.Builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic DefaultEventGateway.Builderbuilder()Instantiate a Builder to be able to create aDefaultEventGateway.voidPublish a collection of events on this bus (one, or multiple).Methods inherited from class org.axonframework.eventhandling.gateway.AbstractEventGateway
getEventBus, processInterceptors, publish, publishAll, registerDispatchInterceptorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.axonframework.eventhandling.gateway.EventGateway
publishMethods inherited from interface org.axonframework.messaging.MessageDispatchInterceptorSupport
registerDispatchInterceptor
-
Constructor Details
-
DefaultEventGateway
Instantiate aDefaultEventGatewaybased on the fields contained in theDefaultEventGateway.Builder.Will assert that the
EventBusis notnulland will throw anAxonConfigurationExceptionif this is the case.- Parameters:
builder- theDefaultEventGateway.Builderused to instantiate aDefaultEventGatewayinstance
-
-
Method Details
-
builder
Instantiate a Builder to be able to create aDefaultEventGateway.The
dispatchInterceptorsare defaulted to an empty list. TheEventBusis a hard requirement and as such should be provided.- Returns:
- a Builder to be able to create a
DefaultEventGateway
-
publish
Description copied from interface:EventGatewayPublish a collection of events on this bus (one, or multiple). The events will be dispatched to all subscribed listeners.Implementations may treat the given
eventsas a single batch and distribute the events as such to all subscribed EventListeners. When the giveneventsis an empty list, nothing happens.- Specified by:
publishin interfaceEventGateway- Parameters:
events- The collection of events to publish
-