Package ch.ivyteam.ivy.event
Interface ISystemEventDispatcher
-
- All Known Subinterfaces:
IApplication
public interface ISystemEventDispatcher
Implemented by the system event dispatcher.- API:
- This is a public API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ISystemEventDispatcher.DispatchStatus
Status of the event dispatch.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSystemEventListener(EnumSet<SystemEventCategory> categories, ISystemEventListener listener)
Adds the given listener and invokes it, if an event of the given categories is received.void
removeSystemEventListener(EnumSet<SystemEventCategory> categories, ISystemEventListener listener)
Removes the given event listener from the given categories.ISystemEventDispatcher.DispatchStatus
sendSystemEvent(SystemEvent<?> event)
Sends the givenSystemEvent
to 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 givenSystemEvent
to all interested listeners. TheISystemEventDispatcher
implementation 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.OK
if sending was successful,ISystemEventDispatcher.DispatchStatus.ERROR
if sending failed (partially)- API:
- This public API is available in IvyScript and Java. It has the visibility ADVANCED.
-
-