An ExecutorService that executes each submitted task using
one of possibly several pooled threads, normally configured
using Executors factory methods.
public
ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue)
public
ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, RejectedExecutionHandler handler)
public
ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
public
ThreadPoolExecutor
(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory, RejectedExecutionHandler handler)
public List<Future< T>>
invokeAll
(Collection<Callable> tasks)
throws
InterruptedException
[Inherited From AbstractExecutorService]
public List<Future< T>>
invokeAll
(Collection<Callable> tasks, long timeout, TimeUnit unit)
throws
InterruptedException
[Inherited From AbstractExecutorService]
public T
invokeAny
(Collection<Callable> tasks)
throws
InterruptedException
ExecutionException
[Inherited From AbstractExecutorService]
public T
invokeAny
(Collection<Callable> tasks, long timeout, TimeUnit unit)
throws
InterruptedException
ExecutionException
TimeoutException
[Inherited From AbstractExecutorService]
protected RunnableFuture< T>
newTaskFor
(Callable< T> callable)
[Inherited From AbstractExecutorService]
protected RunnableFuture< T>
newTaskFor
(Runnable runnable, T value)
[Inherited From AbstractExecutorService]
pack-private void
reject
(Runnable command)
pack-privatevolatile
int runState
runState provides the main lifecyle control, taking on values:
RUNNING: Accept new tasks and process queued tasks
SHUTDOWN: Don't accept new tasks, but process queued tasks
STOP: Don't accept new tasks, don't process queued tasks,
and interrupt in-progress tasks
TERMINATED: Same as STOP, plus all threads have terminated
The numerical order among these values matters, to allow
ordered comparisons.