Package ch.ivyteam.ivy.event
Interface ISystemEventDispatcher
-
- All Known Subinterfaces:
IApplication
public interface ISystemEventDispatcherImplemented by the system event dispatcher.- API:
- This is a public API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classISystemEventDispatcher.DispatchStatusStatus of the event dispatch.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSystemEventListener(EnumSet<SystemEventCategory> categories, ISystemEventListener listener)Adds the given listener and invokes it, if an event of the given categories is received.voidremoveSystemEventListener(EnumSet<SystemEventCategory> categories, ISystemEventListener listener)Removes the given event listener from the given categories.ISystemEventDispatcher.DispatchStatussendSystemEvent(SystemEvent<?> event)Sends the givenSystemEventto all interested listeners.
-
-
-
Method Detail
-
addSystemEventListener
void addSystemEventListener(EnumSet<SystemEventCategory> categories, ISystemEventListener listener)
Adds the given listener and invokes it, if an event of the given categories is received. The same listener object will only be added once per categegory.- Parameters:
categories- the categories to listen tolistener- the listener to add- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
removeSystemEventListener
void removeSystemEventListener(EnumSet<SystemEventCategory> categories, ISystemEventListener listener)
Removes the given event listener from the given categories. Specifying more categories than the listener is registered for does no harm.- Parameters:
categories- the categories to remove the listener fromlistener- the listener to remove- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
sendSystemEvent
ISystemEventDispatcher.DispatchStatus sendSystemEvent(SystemEvent<?> event)
Sends the givenSystemEventto all interested listeners. TheISystemEventDispatcherimplementation may decide not to dispatch a particular event, if a specific token is not set. However, this is depending on the implementation.- Parameters:
event-- Returns:
ISystemEventDispatcher.DispatchStatus.OKif sending was successful,ISystemEventDispatcher.DispatchStatus.ERRORif sending failed (partially)- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
-