public abstract class ExecutorProxy extends Object implements Shutdownable
| Modifier and Type | Field and Description |
|---|---|
protected ExecutorService |
executor
The executor proxied by the implementing class.
|
| Constructor and Description |
|---|
ExecutorProxy(ExecutorService executor)
Instantiate a proxy for the given executor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit)
Blocks until all the queued tasks have finished and the thread pool is empty, or the timeout is reached
(whichever first).
|
void |
shutdown()
Shuts down the executor.
|
List<Runnable> |
shutdownNow()
Shut down the executor immediately, halting running tasks and discarding waiting tasks.
|
protected final ExecutorService executor
public ExecutorProxy(ExecutorService executor)
executor - the executor to proxypublic void shutdown()
RejectedExecutionException after this method is called.shutdown in interface Shutdownablepublic List<Runnable> shutdownNow()
ExecutorService that allows tasks to
be queued, otherwise an empty list if using a blocking executor.public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
true if the executor terminated before the given timeout, false otherwise.InterruptedException - if interrupted while waitingCopyright © 2018 The International Consortium of Investigative Journalists. All rights reserved.