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 TypeMethodDescriptionvoidpublishAsyncEvent(Object event) Publishes the event in an asynchronous manner.voidpublishParallelAsyncEvent(Object event) Publishes the event in an asynchronous, parallel manner.voidpublishSyncEvent(Object event) Publishes the event in a synchronous way, the method returns after all the handlers process the event.voidPublishes the event in a synchronous way, the method returns after all the handlers process the event.voidregisterListener(EventListener listener) Registers allEventHandlers from passed object.voidunregisterListener(EventListener listener) Unregisters allEventHandlers from passed object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:EventServicePublishes the event in a synchronous way, the method returns after all the handlers process the event. Swallows the exceptions in listeners- Specified by:
publishSyncEventin interfaceEventService- Parameters:
event- Event to be published.
-
publishSyncEventWithExceptions
Description copied from interface:EventServicePublishes the event in a synchronous way, the method returns after all the handlers process the event. Rethrows the exceptions in listeners asEventDeliveryFailedException- Specified by:
publishSyncEventWithExceptionsin interfaceEventService- Parameters:
event- Event to be published.
-
publishAsyncEvent
Description copied from interface:EventServicePublishes the event in an asynchronous manner. The method returns just after single task of invoking all handlers sequentially is submitted toTaskManagerSwallows the exceptions in listeners- Specified by:
publishAsyncEventin interfaceEventService- Parameters:
event- Event to be published.
-
publishParallelAsyncEvent
Description copied from interface:EventServicePublishes the event in an asynchronous, parallel manner. The method submits single task per event handler toTaskManagerand returns. Events are processed in parallel if there are available threads in TaskManager's thread pool. Swallows the exceptions in listeners- Specified by:
publishParallelAsyncEventin interfaceEventService- Parameters:
event- Event to be published.
-
registerListener
Description copied from interface:EventServiceRegisters allEventHandlers 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 passedEventListenerdoesn't have any valid handlers,IllegalArgumentExceptionis thrown.- Specified by:
registerListenerin interfaceEventService- Parameters:
listener- Event Listener class which definesEventHandlermethods.
-
unregisterListener
Description copied from interface:EventServiceUnregisters allEventHandlers from passed object.- Specified by:
unregisterListenerin interfaceEventService- Parameters:
listener- Event Listener class which definesEventHandlermethods.
-