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
Modifier and TypeInterfaceDescriptionstatic enum
Status of the event dispatch. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.sendSystemEvent
(SystemEvent<?> event) Sends the givenSystemEvent
to all interested listeners.
-
Method Details
-
addSystemEventListener
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 Java.
-
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 Java.
-
sendSystemEvent
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 Java.
-