private static final class MoreExecutors.DirectExecutorService extends AbstractListeningExecutorService
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
lock
Lock used whenever accessing the state variables (runningTasks, shutdown) of the executor
|
private int |
runningTasks |
private boolean |
shutdown |
Modifier | Constructor and Description |
---|---|
private |
DirectExecutorService() |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
private void |
endTask()
Decrements the running task count.
|
void |
execute(java.lang.Runnable command) |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
private void |
startTask()
Checks if the executor has been shut down and increments the running task count.
|
newTaskFor, newTaskFor, submit, submit, submit
invokeAll, invokeAll, invokeAny, invokeAny
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
invokeAll, invokeAll
private final java.lang.Object lock
private int runningTasks
private boolean shutdown
public void execute(java.lang.Runnable command)
public boolean isShutdown()
public void shutdown()
public java.util.List<java.lang.Runnable> shutdownNow()
public boolean isTerminated()
public boolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
java.lang.InterruptedException
private void startTask()
java.util.concurrent.RejectedExecutionException
- if the executor has been previously shutdownprivate void endTask()