Class TransportFilter.QueuingExecutor.HandOffQueue

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<java.lang.Runnable>, java.util.Collection<java.lang.Runnable>, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.Queue<java.lang.Runnable>
    Enclosing class:
    TransportFilter.QueuingExecutor

    private static class TransportFilter.QueuingExecutor.HandOffQueue
    extends java.util.concurrent.SynchronousQueue<java.lang.Runnable>
    Synchronous queue that tries to empty taskQueue before it blocks waiting for new tasks to be submitted. It is passed to ThreadPoolExecutor, where it is used used to hand off tasks from task-submitting thread to worker threads.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private HandOffQueue​(java.util.Queue<java.lang.Runnable> taskQueue, boolean threadSafeQueue)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Runnable poll​(long timeout, java.util.concurrent.TimeUnit unit)  
      java.lang.Runnable take()  
      • Methods inherited from class java.util.concurrent.SynchronousQueue

        clear, contains, containsAll, drainTo, drainTo, isEmpty, iterator, offer, offer, peek, poll, put, remainingCapacity, remove, removeAll, retainAll, size, spliterator, toArray, toArray, toString
      • Methods inherited from class java.util.AbstractQueue

        add, addAll, element, remove
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.concurrent.BlockingQueue

        add
      • Methods inherited from interface java.util.Collection

        addAll, equals, hashCode, parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Queue

        element, remove
    • Field Detail

      • taskQueue

        private final java.util.Queue<java.lang.Runnable> taskQueue
      • threadSafeQueue

        private final boolean threadSafeQueue
    • Constructor Detail

      • HandOffQueue

        private HandOffQueue​(java.util.Queue<java.lang.Runnable> taskQueue,
                             boolean threadSafeQueue)
    • Method Detail

      • take

        public java.lang.Runnable take()
                                throws java.lang.InterruptedException
        Specified by:
        take in interface java.util.concurrent.BlockingQueue<java.lang.Runnable>
        Overrides:
        take in class java.util.concurrent.SynchronousQueue<java.lang.Runnable>
        Throws:
        java.lang.InterruptedException
      • poll

        public java.lang.Runnable poll​(long timeout,
                                       java.util.concurrent.TimeUnit unit)
                                throws java.lang.InterruptedException
        Specified by:
        poll in interface java.util.concurrent.BlockingQueue<java.lang.Runnable>
        Overrides:
        poll in class java.util.concurrent.SynchronousQueue<java.lang.Runnable>
        Throws:
        java.lang.InterruptedException