AutoCloseable, Executor, ExecutorServicepublic class AutoCloseableExecutorService extends ThreadPoolExecutor implements AutoCloseable
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Constructor | Description |
|---|---|
AutoCloseableExecutorService(int numThreads) |
A ThreadPoolExecutor that can be used in a try-with-resources block.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Shut down thread pool on close().
|
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitafterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, execute, 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, toStringpublic AutoCloseableExecutorService(int numThreads)
numThreads - The number of threads to allocate.public void close()
close in interface AutoCloseableCopyright © 2018. All rights reserved.