Class DefaultEventService

java.lang.Object
eu.rarogsoftware.rarog.platform.core.plugins.events.DefaultEventService
All Implemented Interfaces:
EventService

@Service @ExportComponent public class DefaultEventService extends Object implements EventService
  • Field Details

    • listeners

      Map<Class<?>,List<eu.rarogsoftware.rarog.platform.core.plugins.events.DefaultEventService.EventConsumerRegistration>> listeners
  • Constructor Details

  • Method Details

    • publishSyncEvent

      public void publishSyncEvent(Object event)
      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 interface EventService
      Parameters:
      event - Event to be published.
    • publishSyncEventWithExceptions

      public void publishSyncEventWithExceptions(Object event)
      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 as EventDeliveryFailedException
      Specified by:
      publishSyncEventWithExceptions in interface EventService
      Parameters:
      event - Event to be published.
    • publishAsyncEvent

      public void publishAsyncEvent(Object event)
      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 to TaskManager Swallows the exceptions in listeners
      Specified by:
      publishAsyncEvent in interface EventService
      Parameters:
      event - Event to be published.
    • publishParallelAsyncEvent

      public void publishParallelAsyncEvent(Object event)
      Description copied from interface: EventService
      Publishes the event in an asynchronous, parallel manner. The method submits single task per event handler to TaskManager 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 interface EventService
      Parameters:
      event - Event to be published.
    • registerListener

      public void registerListener(EventListener listener)
      Description copied from interface: EventService
      Registers all EventHandlers 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 passed EventListener doesn't have any valid handlers, IllegalArgumentException is thrown.
      Specified by:
      registerListener in interface EventService
      Parameters:
      listener - Event Listener class which defines EventHandler methods.
    • unregisterListener

      public void unregisterListener(EventListener listener)
      Description copied from interface: EventService
      Unregisters all EventHandlers from passed object.
      Specified by:
      unregisterListener in interface EventService
      Parameters:
      listener - Event Listener class which defines EventHandler methods.