java.io.Closeable, java.lang.AutoCloseableCloseableScheduledExecutorServicepublic class CloseableExecutorService
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Class | Description |
|---|---|---|
protected class |
CloseableExecutorService.InternalFutureTask<T> |
|
protected class |
CloseableExecutorService.InternalScheduledFutureTask |
| Modifier and Type | Field | Description |
|---|---|---|
protected java.util.concurrent.atomic.AtomicBoolean |
isOpen |
| Constructor | Description |
|---|---|
CloseableExecutorService(java.util.concurrent.ExecutorService executorService) |
|
CloseableExecutorService(java.util.concurrent.ExecutorService executorService,
boolean shutdownOnClose) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Closes any tasks currently in progress
|
boolean |
isShutdown() |
Returns true if this executor has been shut down.
|
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task) |
Submits a Runnable task for execution and returns a Future
representing that task.
|
<V> java.util.concurrent.Future<V> |
submit(java.util.concurrent.Callable<V> task) |
Submits a value-returning task for execution and returns a Future
representing the pending results of the task.
|
public CloseableExecutorService(java.util.concurrent.ExecutorService executorService)
executorService - the service to decoratepublic CloseableExecutorService(java.util.concurrent.ExecutorService executorService,
boolean shutdownOnClose)
executorService - the service to decorateshutdownOnClose - if true, shutdown the executor service when this is closedpublic boolean isShutdown()
public void close()
close in interface java.lang.AutoCloseableclose in interface java.io.Closeablepublic <V> java.util.concurrent.Future<V> submit(java.util.concurrent.Callable<V> task)
task - the task to submitpublic java.util.concurrent.Future<?> submit(java.lang.Runnable task)
task - the task to submitCopyright © 2011–2018 The Apache Software Foundation. All rights reserved.