Interface RegisteredEventListener

All Superinterfaces:
Comparable<RegisteredEventListener>

public interface RegisteredEventListener extends Comparable<RegisteredEventListener>
Represents a listener which is registered in an event manager and is ready to accept an event. Event execution is not concurrent as per the event manager contract, therefore there is no need for locking before event execution.
Since:
4.0
See Also:
  • Method Details

    • fireEvent

      void fireEvent(@NonNull @NonNull Event event)
      Fires the event by invoking the underlying method with the given event. The event type is ensured to only be the same type the listener defined in the method. Event execution is not concurrent as per the event manager contract, therefore there is no need for locking before event execution.
      Parameters:
      event - the event to fire.
      Throws:
      NullPointerException - if the given event is null.
      EventListenerException - if the underlying listeners throws an exception while handling the event.
    • eventListener

      Get the annotation used on the original listener method to identify it as a listener method.
      Returns:
      the annotation used on the original listener method.
    • order

      Get the priority defined in the @EventListener annotation on the original listener method.
      Returns:
      the priority of the underlying event listener.
    • channel

      Get the channel this event is listening to. Defaults to * meaning that the listener listens to all channels.
      Returns:
      the channel this event is listening to.
    • instance

      Get the instance of the listener class used to register all listeners in it.
      Returns:
      the instance of the listener class.
    • eventClass

      @NonNull @NonNull Class<?> eventClass()
      Get the class type of the event the underlying listener is listening to.
      Returns:
      the class type of the event this listener listens to.
    • compareTo

      default int compareTo(@NonNull @NonNull RegisteredEventListener other)
      Specified by:
      compareTo in interface Comparable<RegisteredEventListener>