public class OpenFinThreadPool extends ThreadPoolExecutor
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
OpenFinThreadPool(String name,
int nThreads)
Creates a fixed size thread pool.
|
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(Runnable task,
Throwable t) |
protected void |
beforeExecute(Thread thread,
Runnable task) |
void |
execute(Runnable task) |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, 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 OpenFinThreadPool(String name, int nThreads)
name
- name of the thread poolnThreads
- number of threads in the pool.public void execute(Runnable task)
execute
in interface Executor
execute
in class ThreadPoolExecutor
protected void beforeExecute(Thread thread, Runnable task)
beforeExecute
in class ThreadPoolExecutor
protected void afterExecute(Runnable task, Throwable t)
afterExecute
in class ThreadPoolExecutor
Copyright © 2022. All rights reserved.