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.
Parameters:
eventClass
- The class of the event to listen for.consumer
- 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.
Parameters:
eventClass
- The class of the event to listen for.consumer
- The consumer that will handle the event.priority
- The priority 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.consumer
- The consumer that will handle the event.priority
- The priority of the listener.ignoreCancelled
- Whether to ignore cancelled events.
Returns:
A RegisteredListener
instance representing the registered listener.
unregisterListener
Description:
Unregisters a previously registered listener.
Parameters:
listener
- The listener to unregister.