public class AutoCloseableExecutorService extends ThreadPoolExecutor implements AutoCloseable
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy
Constructor and Description |
---|
AutoCloseableExecutorService(int numThreads)
A ThreadPoolExecutor that can be used in a try-with-resources block.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Shut down thread pool on close().
|
afterExecute, 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, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
public AutoCloseableExecutorService(int numThreads)
public void close()
close
in interface AutoCloseable
Copyright © 2016. All rights reserved.