public class DynamicThreadPoolExecutor extends ThreadPoolExecutor
ExecutorService
that executes each submitted task using one of
possibly several pooled threads, normally configured using
DynamicExecutors
factory methods.Modifier and Type | Class and Description |
---|---|
static class |
DynamicThreadPoolExecutor.DynamicQueue<E>
Much like a
SynchronousQueue which acts as a rendezvous channel. |
static class |
DynamicThreadPoolExecutor.ForceQueuePolicy
A handler for rejected tasks that adds the specified element to this queue,
waiting if necessary for space to become available.
|
static class |
DynamicThreadPoolExecutor.TimedBlockingPolicy
A handler for rejected tasks that inserts the specified element into this
queue, waiting if necessary up to the specified wait time for space to become
available.
|
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
DynamicThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory) |
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(Runnable r,
Throwable t) |
protected void |
beforeExecute(Thread t,
Runnable r) |
int |
getActiveCount() |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public DynamicThreadPoolExecutor(int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
public int getActiveCount()
getActiveCount
in class ThreadPoolExecutor
protected void beforeExecute(Thread t, Runnable r)
beforeExecute
in class ThreadPoolExecutor
protected void afterExecute(Runnable r, Throwable t)
afterExecute
in class ThreadPoolExecutor
Copyright © 2009-2013 jclouds. All Rights Reserved.