Class ListenerCallQueue<L>

  • All Implemented Interfaces:
    java.lang.Runnable

    @GwtIncompatible
    final class ListenerCallQueue<L>
    extends java.lang.Object
    implements java.lang.Runnable
    A special purpose queue/executor that executes listener callbacks serially on a configured executor. Each callback task can be enqueued and executed as separate phases.

    This class is very similar to SerializingExecutor with the exception that tasks can be enqueued without necessarily executing immediately.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static class  ListenerCallQueue.Callback<L>  
    • Constructor Summary

      Constructors 
      Constructor Description
      ListenerCallQueue​(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.Callback<L> callback)
      Enqueues a task to be run.
      (package private) void execute()
      Executes all listeners added 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

      • logger

        private static final java.util.logging.Logger logger
      • listener

        private final L listener
      • executor

        private final java.util.concurrent.Executor executor
      • isThreadScheduled

        private boolean isThreadScheduled
    • Constructor Detail

      • ListenerCallQueue

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

      • execute

        void execute()
        Executes all listeners added prior to this call, serially and in order.
      • run

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