Class Events


  • public final class Events
    extends Service<EventListener>
    This class implements the event service for the instance.
    Author:
    javaito
    • Field Detail

      • listeners

        public final java.util.List<EventListener> listeners
    • Method Detail

      • sendEvent

        public static void sendEvent​(Event event)
        Send event.
        Parameters:
        event - Event to send.
      • addEventListener

        public static void addEventListener​(EventListener eventListener)
        Add event listener.
        Parameters:
        eventListener - Event listener.
      • removeEventListener

        public static void removeEventListener​(EventListener eventListener)
        Remove event listener.
        Parameters:
        eventListener - Event listener.
      • waitForEvent

        public static <E extends Event> E waitForEvent​(java.lang.Class<E> eventClass)
                                                throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • waitForEvent

        public static <E extends Event> E waitForEvent​(java.lang.Class<E> eventClass,
                                                       long timeout)
                                                throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • waitForEvent

        public static <O,​E extends Event> O waitForEvent​(java.lang.Class<E> eventClass,
                                                               Events.EventCollector<E> eventCollector)
                                                        throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException
      • waitForEvent

        public static <O,​E extends Event> O waitForEvent​(java.lang.Class<E> eventClass,
                                                               Events.EventCollector<E> eventCollector,
                                                               long timeout)
                                                        throws java.lang.InterruptedException
        Throws:
        java.lang.InterruptedException