Class TransportFilter.QueuingExecutor.HandOffQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<E>
-
- java.util.concurrent.SynchronousQueue<java.lang.Runnable>
-
- org.glassfish.jersey.jdk.connector.internal.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 emptytaskQueue
before it blocks waiting for new tasks to be submitted. It is passed toThreadPoolExecutor
, where it is used used to hand off tasks from task-submitting thread to worker threads.
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
private java.util.Queue<java.lang.Runnable>
taskQueue
private boolean
threadSafeQueue
-
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.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
taskQueue
private final java.util.Queue<java.lang.Runnable> taskQueue
-
threadSafeQueue
private final boolean threadSafeQueue
-
-
Method Detail
-
take
public java.lang.Runnable take() throws java.lang.InterruptedException
- Specified by:
take
in interfacejava.util.concurrent.BlockingQueue<java.lang.Runnable>
- Overrides:
take
in classjava.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 interfacejava.util.concurrent.BlockingQueue<java.lang.Runnable>
- Overrides:
poll
in classjava.util.concurrent.SynchronousQueue<java.lang.Runnable>
- Throws:
java.lang.InterruptedException
-
-