Class ListenerCallQueue.PerListenerQueue<L>

  • All Implemented Interfaces:
    java.lang.Runnable
    Enclosing class:
    ListenerCallQueue<L>

    private static final class ListenerCallQueue.PerListenerQueue<L>
    extends java.lang.Object
    implements java.lang.Runnable
    A special purpose queue/executor that dispatches listener events serially on a configured executor. Each event can be added and dispatched as separate phases.

    This class is very similar to SequentialExecutor with the exception that events can be added without necessarily executing immediately.

    • Constructor Summary

      Constructors 
      Constructor Description
      PerListenerQueue​(L listener, java.util.concurrent.Executor executor)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void add​(ListenerCallQueue.Event<L> event, java.lang.Object label)
      Enqueues a event to be run.
      (package private) void dispatch()
      Dispatches all listeners enqueued prior to this call, serially and in order.
      void run()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • listener

        final L listener
      • executor

        final java.util.concurrent.Executor executor
      • labelQueue

        final java.util.Queue<java.lang.Object> labelQueue
      • isThreadScheduled

        boolean isThreadScheduled
    • Constructor Detail

      • PerListenerQueue

        PerListenerQueue​(L listener,
                         java.util.concurrent.Executor executor)
    • Method Detail

      • dispatch

        void dispatch()
        Dispatches all listeners enqueued prior to this call, serially and in order.
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable