java.lang.Object
org.fuin.cqrs4j.SimpleEventDispatcher
- All Implemented Interfaces:
EventDispatcher
Registry with all event handlers.
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleEventDispatcher(@NotNull List<EventHandler> eventHandlers) Constructor with list of event handlers.SimpleEventDispatcher(@NotNull EventHandler... eventHandlers) Constructor with array of event handlers. -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddispatchCommonEvents(@NotNull List<org.fuin.esc.api.CommonEvent> commonEvents) Dispatch all common events to the appropriate event handler.final voiddispatchEvent(@NotNull org.fuin.ddd4j.ddd.Event event) Dispatches the given event to the appropriate event handler.final voiddispatchEvents(@NotNull List<org.fuin.ddd4j.ddd.Event> events) Dispatch all events to the appropriate event handler.final @NotNull Set<org.fuin.ddd4j.ddd.EventType>Returns a set of all known types.
-
Constructor Details
-
SimpleEventDispatcher
Constructor with array of event handlers.- Parameters:
eventHandlers- Event handlers.
-
SimpleEventDispatcher
Constructor with list of event handlers.- Parameters:
eventHandlers- Event handlers.
-
-
Method Details
-
getAllTypes
Description copied from interface:EventDispatcherReturns a set of all known types.- Specified by:
getAllTypesin interfaceEventDispatcher- Returns:
- All known event types.
-
dispatchCommonEvents
public final void dispatchCommonEvents(@NotNull @NotNull List<org.fuin.esc.api.CommonEvent> commonEvents) Description copied from interface:EventDispatcherDispatch all common events to the appropriate event handler.- Specified by:
dispatchCommonEventsin interfaceEventDispatcher- Parameters:
commonEvents- Events to dispatch.
-
dispatchEvents
Description copied from interface:EventDispatcherDispatch all events to the appropriate event handler.- Specified by:
dispatchEventsin interfaceEventDispatcher- Parameters:
events- Events to dispatch.
-
dispatchEvent
public final void dispatchEvent(@NotNull @NotNull org.fuin.ddd4j.ddd.Event event) Description copied from interface:EventDispatcherDispatches the given event to the appropriate event handler. The event is ignored if no event handler can be found that is capable of handling it.- Specified by:
dispatchEventin interfaceEventDispatcher- Parameters:
event- Event to dispatch.
-