Class DefaultEventService
java.lang.Object
eu.rarogsoftware.rarog.platform.core.plugins.events.DefaultEventService
- All Implemented Interfaces:
EventService
-
Nested Class Summary
Nested classes/interfaces inherited from interface eu.rarogsoftware.rarog.platform.api.plugins.events.EventService
EventService.EventType
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventService
(TaskManager taskManager, MetricsService metricsService) DefaultEventService
(Clock clock, TaskManager taskManager, MetricsService metricsService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
publishAsyncEvent
(Object event) Publishes the event in an asynchronous manner.void
publishParallelAsyncEvent
(Object event) Publishes the event in an asynchronous, parallel manner.void
publishSyncEvent
(Object event) Publishes the event in a synchronous way, the method returns after all the handlers process the event.void
Publishes the event in a synchronous way, the method returns after all the handlers process the event.void
registerListener
(EventListener listener) Registers allEventHandler
s from passed object.void
unregisterListener
(EventListener listener) Unregisters allEventHandler
s from passed object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface eu.rarogsoftware.rarog.platform.api.plugins.events.EventService
publishEvent
-
Field Details
-
listeners
-
-
Constructor Details
-
DefaultEventService
DefaultEventService(Clock clock, TaskManager taskManager, MetricsService metricsService) -
DefaultEventService
-
-
Method Details
-
publishSyncEvent
Description copied from interface:EventService
Publishes the event in a synchronous way, the method returns after all the handlers process the event. Swallows the exceptions in listeners- Specified by:
publishSyncEvent
in interfaceEventService
- Parameters:
event
- Event to be published.
-
publishSyncEventWithExceptions
Description copied from interface:EventService
Publishes the event in a synchronous way, the method returns after all the handlers process the event. Rethrows the exceptions in listeners asEventDeliveryFailedException
- Specified by:
publishSyncEventWithExceptions
in interfaceEventService
- Parameters:
event
- Event to be published.
-
publishAsyncEvent
Description copied from interface:EventService
Publishes the event in an asynchronous manner. The method returns just after single task of invoking all handlers sequentially is submitted toTaskManager
Swallows the exceptions in listeners- Specified by:
publishAsyncEvent
in interfaceEventService
- Parameters:
event
- Event to be published.
-
publishParallelAsyncEvent
Description copied from interface:EventService
Publishes the event in an asynchronous, parallel manner. The method submits single task per event handler toTaskManager
and returns. Events are processed in parallel if there are available threads in TaskManager's thread pool. Swallows the exceptions in listeners- Specified by:
publishParallelAsyncEvent
in interfaceEventService
- Parameters:
event
- Event to be published.
-
registerListener
Description copied from interface:EventService
Registers allEventHandler
s from passed object. If handlers with more than one parameter are found, this fact is logged and the method is skipped but processing is not stopped. If the passedEventListener
doesn't have any valid handlers,IllegalArgumentException
is thrown.- Specified by:
registerListener
in interfaceEventService
- Parameters:
listener
- Event Listener class which definesEventHandler
methods.
-
unregisterListener
Description copied from interface:EventService
Unregisters allEventHandler
s from passed object.- Specified by:
unregisterListener
in interfaceEventService
- Parameters:
listener
- Event Listener class which definesEventHandler
methods.
-