public class TaskQueue extends LinkedBlockingQueue<Runnable>
Modifier and Type | Field and Description |
---|---|
protected static StringManager |
sm |
Constructor and Description |
---|
TaskQueue() |
TaskQueue(Collection<? extends Runnable> c) |
TaskQueue(int capacity) |
Modifier and Type | Method and Description |
---|---|
boolean |
force(Runnable o)
Used to add a task to the queue if the task has been rejected by the Executor.
|
boolean |
force(Runnable o,
long timeout,
TimeUnit unit)
Deprecated.
Unused. Will be removed in Tomcat 10.1.x.
|
boolean |
offer(Runnable o) |
Runnable |
poll(long timeout,
TimeUnit unit) |
int |
remainingCapacity() |
void |
setForcedRemainingCapacity(int forcedRemainingCapacity) |
void |
setParent(ThreadPoolExecutor tp) |
Runnable |
take() |
clear, contains, drainTo, drainTo, iterator, offer, peek, poll, put, remove, size, toArray, toArray, toString
add, addAll, element, remove
containsAll, isEmpty, removeAll, retainAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
add
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
protected static final StringManager sm
public TaskQueue()
public TaskQueue(int capacity)
public TaskQueue(Collection<? extends Runnable> c)
public void setParent(ThreadPoolExecutor tp)
public boolean force(Runnable o)
o
- The task to add to the queuetrue
if the task was added to the queue,
otherwise false
@Deprecated public boolean force(Runnable o, long timeout, TimeUnit unit) throws InterruptedException
o
- The task to add to the queuetimeout
- The timeout to use when adding the taskunit
- The units in which the timeout is expressedtrue
if the task was added to the queue,
otherwise false
InterruptedException
- If the call is interrupted before the
timeout expirespublic boolean offer(Runnable o)
offer
in interface BlockingQueue<Runnable>
offer
in interface Queue<Runnable>
offer
in class LinkedBlockingQueue<Runnable>
public Runnable poll(long timeout, TimeUnit unit) throws InterruptedException
poll
in interface BlockingQueue<Runnable>
poll
in class LinkedBlockingQueue<Runnable>
InterruptedException
public Runnable take() throws InterruptedException
take
in interface BlockingQueue<Runnable>
take
in class LinkedBlockingQueue<Runnable>
InterruptedException
public int remainingCapacity()
remainingCapacity
in interface BlockingQueue<Runnable>
remainingCapacity
in class LinkedBlockingQueue<Runnable>
public void setForcedRemainingCapacity(int forcedRemainingCapacity)
Copyright © 2000-2022 Apache Software Foundation. All Rights Reserved.