public class ThreadPool extends ThreadPoolExecutor implements RejectedExecutionHandler
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CORE_POOL_SIZE |
static long |
DEFAULT_KEEP_ALIVE_SECONDS |
static int |
DEFAULT_MAXIMUM_POOL_SIZE |
static String |
DEFAULT_THREAD_GROUP_NAME |
Constructor and Description |
---|
ThreadPool(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
ThreadFactory threadFactory) |
Modifier and Type | Method and Description |
---|---|
static ThreadPool |
create() |
static ThreadPool |
create(String description) |
static ThreadPool |
create(String threadGroupName,
int corePoolSize,
int maximumPoolSize,
long keepAliveSeconds) |
void |
rejectedExecution(Runnable runnable,
ThreadPoolExecutor executor) |
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, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public static final String DEFAULT_THREAD_GROUP_NAME
public static final int DEFAULT_CORE_POOL_SIZE
public static final int DEFAULT_MAXIMUM_POOL_SIZE
public static final long DEFAULT_KEEP_ALIVE_SECONDS
public ThreadPool(int corePoolSize, int maximumPoolSize, long keepAliveTime, ThreadFactory threadFactory)
public void rejectedExecution(Runnable runnable, ThreadPoolExecutor executor)
rejectedExecution
in interface RejectedExecutionHandler
public static ThreadPool create()
public static ThreadPool create(String description)
public static ThreadPool create(String threadGroupName, int corePoolSize, int maximumPoolSize, long keepAliveSeconds)
Copyright (c) 2011-2015 Eike Stepper (Berlin, Germany) and others.