Class ThreadPool
java.lang.Object
java.util.concurrent.AbstractExecutorService
java.util.concurrent.ThreadPoolExecutor
org.eclipse.net4j.util.concurrent.ThreadPool
- All Implemented Interfaces:
Executor,ExecutorService,RejectedExecutionHandler
- Since:
- 3.6
- Author:
- Eike Stepper
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final longstatic final intstatic final String -
Constructor Summary
ConstructorsConstructorDescriptionThreadPool(int corePoolSize, int maximumPoolSize, long keepAliveSeconds, ThreadFactory threadFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterExecute(Runnable task, Throwable ex) protected voidbeforeExecute(Thread worker, Runnable task) static ThreadPoolcreate()static ThreadPoolstatic ThreadPoolintprotected voidvoidrejectedExecution(Runnable task, ThreadPoolExecutor executor) voidMethods inherited from class java.util.concurrent.ThreadPoolExecutor
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, execute, finalize, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setThreadFactory, shutdown, shutdownNow, terminated, toStringMethods inherited from class java.util.concurrent.AbstractExecutorService
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
-
Field Details
-
DEFAULT_THREAD_GROUP_NAME
- See Also:
-
DEFAULT_CORE_POOL_SIZE
public static final int DEFAULT_CORE_POOL_SIZE- See Also:
-
DEFAULT_MAXIMUM_POOL_SIZE
public static final int DEFAULT_MAXIMUM_POOL_SIZE- See Also:
-
DEFAULT_KEEP_ALIVE_SECONDS
public static final long DEFAULT_KEEP_ALIVE_SECONDS- See Also:
-
-
Constructor Details
-
ThreadPool
public ThreadPool(int corePoolSize, int maximumPoolSize, long keepAliveSeconds, ThreadFactory threadFactory)
-
-
Method Details
-
setRejectedExecutionHandler
- Overrides:
setRejectedExecutionHandlerin classThreadPoolExecutor
-
getRejectedExecutionHandler
- Overrides:
getRejectedExecutionHandlerin classThreadPoolExecutor
-
rejectedExecution
- Specified by:
rejectedExecutionin interfaceRejectedExecutionHandler
-
getActiveCount
public int getActiveCount()- Overrides:
getActiveCountin classThreadPoolExecutor
-
beforeExecute
- Overrides:
beforeExecutein classThreadPoolExecutor
-
afterExecute
- Overrides:
afterExecutein classThreadPoolExecutor
-
potentialDeadlockDetected
protected void potentialDeadlockDetected()- Since:
- 3.9
-
create
-
create
-
create
public static ThreadPool create(String threadGroupName, int corePoolSize, int maximumPoolSize, long keepAliveSeconds)
-