EventListenerRepository Interface
Introduction
The EventListenerRepository interface provides methods to register and unregister event listeners.
Methods
registerListener
Description:
Registers a listener for the specified event class with NORMAL priority. Cancelled events are still delivered.
Parameters:
eventClass- The class of the event to listen for.listener- The consumer that will handle the event.
Returns:
A RegisteredListener instance representing the registered listener.
registerListener (with priority)
Description:
Registers a listener for the specified event class with the specified priority. Cancelled events are still delivered.
Parameters:
eventClass- The class of the event to listen for.listener- The consumer that will handle the event.listenerPriority- The ListenerPriority of the listener.
Returns:
A RegisteredListener instance representing the registered listener.
registerListener (with priority and ignoreCancelled)
Description:
Registers a listener for the specified event class with the specified priority and ignoreCancelled setting.
Parameters:
eventClass- The class of the event to listen for.listener- The consumer that will handle the event.listenerPriority- The ListenerPriority of the listener.ignoreCancelled- Iftrue, the listener is not called for events that have already been cancelled.
Returns:
A RegisteredListener instance representing the registered listener.
unregisterListener
Description:
Unregisters a previously registered listener.
Parameters:
registeredListener- The RegisteredListener to unregister.