Example usage for Java java.util.concurrent ThreadPoolExecutor fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | allowCoreThreadTimeOut If false (default), core threads stay alive even when idle. |
boolean | awaitTermination(long timeout, TimeUnit unit) |
void | execute(Runnable command) Executes the given task sometime in the future. |
int | getActiveCount() Returns the approximate number of threads that are actively executing tasks. |
long | getCompletedTaskCount() Returns the approximate total number of tasks that have completed execution. |
int | getCorePoolSize() Returns the core number of threads. |
long | getKeepAliveTime(TimeUnit unit) Returns the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated. |
int | getLargestPoolSize() Returns the largest number of threads that have ever simultaneously been in the pool. |
int | getMaximumPoolSize() Returns the maximum allowed number of threads. |
int | getPoolSize() Returns the current number of threads in the pool. |
BlockingQueue | getQueue() Returns the task queue used by this executor. |
long | getTaskCount() Returns the approximate total number of tasks that have ever been scheduled for execution. |
ThreadFactory | getThreadFactory() Returns the thread factory used to create new threads. |
List | invokeAll(Collection extends Callable |
boolean | isShutdown() |
boolean | isTerminated() |
boolean | isTerminating() Returns true if this executor is in the process of terminating after #shutdown or #shutdownNow but has not completely terminated. |
int | prestartAllCoreThreads() Starts all core threads, causing them to idly wait for work. |
boolean | prestartCoreThread() Starts a core thread, causing it to idly wait for work. |
void | purge() Tries to remove from the work queue all Future tasks that have been cancelled. |
void | setCorePoolSize(int corePoolSize) Sets the core number of threads. |
void | setKeepAliveTime(long time, TimeUnit unit) Sets the thread keep-alive time, which is the amount of time that threads may remain idle before being terminated. |
void | setMaximumPoolSize(int maximumPoolSize) Sets the maximum allowed number of threads. |
void | setRejectedExecutionHandler(RejectedExecutionHandler handler) Sets a new handler for unexecutable tasks. |
void | setThreadFactory(ThreadFactory threadFactory) Sets the thread factory used to create new threads. |
List | shutdownNow() Attempts to stop all actively executing tasks, halts the processing of waiting tasks, and returns a list of the tasks that were awaiting execution. |
Future> | submit(Runnable task) |
String | toString() Returns a string identifying this pool, as well as its state, including indications of run state and estimated worker and task counts. |