Class LEventManager


  • public final class LEventManager
    extends AbstractLogger
    This class for managing events and these subscribers.
    Author:
    kong
    • Constructor Detail

      • LEventManager

        public LEventManager()
    • Method Detail

      • emit

        public java.lang.Object emit​(LEvent type,
                                     java.lang.Object... args)
        Emit an event with its parameters
        Parameters:
        type - see LEvent
        args - a list parameters of this event
        Returns:
        the event result (the response of its subscribers), see Object or null
        See Also:
        LEventProducer.emit(LEvent, Object...)
      • subscribe

        public void subscribe()
        Collect all subscribers and these corresponding events.
      • hasSubscriber

        public boolean hasSubscriber​(LEvent type)
        Check if an event has any subscribers or not.
        Parameters:
        type - see LEvent
        Returns:
        true if an event has any subscribers
      • clear

        public void clear()
        Clear all subscribers and these corresponding events.