public class ThreadPool extends ThreadPoolExecutor
ThreadPoolExecutor that adds queue state accessors.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Method and Description |
|---|---|
static Optional<ThreadPool> |
asThreadPool(ExecutorService executor)
Returns the given executor as a
ThreadPool if possible. |
void |
execute(Runnable command) |
String |
getName()
Returns the name of this pool.
|
int |
getPeakQueueSize()
Returns the peak queue size.
|
int |
getQueueCapacity()
Returns the queue capacity.
|
String |
toString() |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, 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, terminatedinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic static Optional<ThreadPool> asThreadPool(ExecutorService executor)
ThreadPool if possible.executor - The executor.ThreadPool.public void execute(Runnable command)
execute in interface Executorexecute in class ThreadPoolExecutorpublic String getName()
public int getQueueCapacity()
public int getPeakQueueSize()
public String toString()
toString in class ThreadPoolExecutorCopyright © 2018–2019 Oracle and/or its affiliates. All rights reserved. Use is subject to license terms.