public class ScalingThreadPoolExecutor extends ThreadPoolExecutor
ThreadPoolExecutor that scales from a min to a max number of threads as tasks get
added.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Method and Description |
|---|---|
static ScalingThreadPoolExecutor |
newScalingThreadPool(int min,
int max,
long keepAliveTime)
Creates a
ScalingThreadPoolExecutor. |
static ScalingThreadPoolExecutor |
newScalingThreadPool(int min,
int max,
long keepAliveTime,
ThreadFactory threadFactory)
Creates a
ScalingThreadPoolExecutor. |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, finalize, getActiveCount, 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, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic static ScalingThreadPoolExecutor newScalingThreadPool(int min, int max, long keepAliveTime)
ScalingThreadPoolExecutor.min - Core thread pool size.max - Max number of threads allowed.keepAliveTime - Keep alive time for unused threads in milliseconds.ScalingThreadPoolExecutor.public static ScalingThreadPoolExecutor newScalingThreadPool(int min, int max, long keepAliveTime, ThreadFactory threadFactory)
ScalingThreadPoolExecutor.min - Core thread pool size.max - Max number of threads allowed.keepAliveTime - Keep alive time for unused threads in milliseconds.threadFactory - thread factory to use.ScalingThreadPoolExecutor.