public class TaskQueue<R extends Runnable> extends LinkedBlockingQueue<Runnable>
构造器和说明 |
---|
TaskQueue(int capacity) |
限定符和类型 | 方法和说明 |
---|---|
boolean |
offer(Runnable runnable) |
boolean |
retryOffer(Runnable o,
long timeout,
TimeUnit unit)
retry offer task
|
void |
setExecutor(EagerThreadPoolExecutor exec) |
clear, contains, drainTo, drainTo, iterator, offer, peek, poll, poll, put, remainingCapacity, remove, size, take, toArray, toArray, toString
add, addAll, element, remove
containsAll, isEmpty, removeAll, retainAll
add
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
public void setExecutor(EagerThreadPoolExecutor exec)
public boolean offer(Runnable runnable)
offer
在接口中 BlockingQueue<Runnable>
offer
在接口中 Queue<Runnable>
offer
在类中 LinkedBlockingQueue<Runnable>
public boolean retryOffer(Runnable o, long timeout, TimeUnit unit) throws InterruptedException
o
- taskRejectedExecutionException
- if executor is terminated.InterruptedException
Copyright © 2011–2018 The Apache Software Foundation. All rights reserved.