Class EventManager


  • public class EventManager
    extends Object
    Wraps the OSGi EventAdmin service for better type safety. SimulationEvents and IEventHandlers are strongly typed, whereas the classical way of using OSGi Events (hidden by this wrapper) involves undesired type casts.
    • Constructor Detail

      • EventManager

        public EventManager()
    • Method Detail

      • triggerEvent

        public void triggerEvent​(SimulationEvent event)
        Delivers the specified event to interested event handlers. Returns not until all interested event handlers processed the event completely (synchronous delivery).
        Parameters:
        event - the event to be delivered
      • registerEventHandler

        public <T extends SimulationEvent> void registerEventHandler​(Class<T> eventType,
                                                                     IEventHandler<T> handler,
                                                                     String filter)
        Registers the specified handler with events of the specified type.
        Parameters:
        eventType - the type of events handled by the handler
        handler - the event handler
      • unregisterAllEventHandlers

        public void unregisterAllEventHandlers()