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
Modifier and TypeFieldDescriptionstatic final int
static final long
static final int
static final String
-
Constructor Summary
ConstructorDescriptionThreadPool
(int corePoolSize, int maximumPoolSize, long keepAliveSeconds, ThreadFactory threadFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
afterExecute
(Runnable task, Throwable ex) protected void
beforeExecute
(Thread worker, Runnable task) static ThreadPool
create()
static ThreadPool
static ThreadPool
int
protected void
void
rejectedExecution
(Runnable task, ThreadPoolExecutor executor) void
Methods 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, toString
Methods 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:
setRejectedExecutionHandler
in classThreadPoolExecutor
-
getRejectedExecutionHandler
- Overrides:
getRejectedExecutionHandler
in classThreadPoolExecutor
-
rejectedExecution
- Specified by:
rejectedExecution
in interfaceRejectedExecutionHandler
-
getActiveCount
public int getActiveCount()- Overrides:
getActiveCount
in classThreadPoolExecutor
-
beforeExecute
- Overrides:
beforeExecute
in classThreadPoolExecutor
-
afterExecute
- Overrides:
afterExecute
in classThreadPoolExecutor
-
potentialDeadlockDetected
protected void potentialDeadlockDetected()- Since:
- 3.9
-
create
-
create
-
create
public static ThreadPool create(String threadGroupName, int corePoolSize, int maximumPoolSize, long keepAliveSeconds)
-