Class EventManager
- java.lang.Object
-
- edu.kit.ipd.sdq.eventsim.middleware.events.EventManager
-
public class EventManager extends Object
Wraps the OSGiEventAdmin
service for better type safety.SimulationEvent
s andIEventHandler
s are strongly typed, whereas the classical way of using OSGiEvent
s (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.void
triggerEvent(SimulationEvent event)
Delivers the specifiedevent
to interested event handlers.void
unregisterAllEventHandlers()
-
-
-
Method Detail
-
triggerEvent
public void triggerEvent(SimulationEvent event)
Delivers the specifiedevent
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 handlerhandler
- the event handler
-
unregisterAllEventHandlers
public void unregisterAllEventHandlers()
-
-