Class EventManager
- java.lang.Object
-
- edu.kit.ipd.sdq.eventsim.middleware.events.EventManager
-
public class EventManager extends Object
Wraps the OSGiEventAdminservice for better type safety.SimulationEvents andIEventHandlers are strongly typed, whereas the classical way of using OSGiEvents (hidden by this wrapper) involves undesired type casts.
-
-
Constructor Summary
Constructors Constructor Description EventManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T extends SimulationEvent>
voidregisterEventHandler(Class<T> eventType, IEventHandler<T> handler, String filter)Registers the specified handler with events of the specified type.voidtriggerEvent(SimulationEvent event)Delivers the specifiedeventto interested event handlers.voidunregisterAllEventHandlers()
-
-
-
Method Detail
-
triggerEvent
public void triggerEvent(SimulationEvent event)
Delivers the specifiedeventto 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 handlerhandler- the event handler
-
unregisterAllEventHandlers
public void unregisterAllEventHandlers()
-
-