public interface PausableExecutorService extends ExecutorService
ExecutorService
that allows to pause and resume. Moreover it allows to listen for
termination of the executor.ExecutorTerminatedListener
,
pause()
,
addExecutorTerminatedListener(ExecutorTerminatedListener)
Modifier and Type | Method and Description |
---|---|
void |
addExecutorTerminatedListener(ExecutorTerminatedListener listener)
Adds the given
listener to the list of listeners that will be notified when the
executor terminates. |
void |
pause()
Pauses the executor, so that no new task will be executed until
resume() is called. |
void |
removeExecutorTerminatedListener(ExecutorTerminatedListener listener)
Removes the given
listener from the list of listeners that are notified when the
executor terminates. |
void |
resume()
Resumes the executor, so that the awaiting tasks are executed.
|
awaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow, submit, submit, submit
void pause()
resume()
is called.resume()
void resume()
The call to this method has no effect if the executor is not paused.
pause()
void addExecutorTerminatedListener(ExecutorTerminatedListener listener)
listener
to the list of listeners that will be notified when the
executor terminates.listener
- the listener for terminationExecutorService.isTerminated()
,
removeExecutorTerminatedListener(ExecutorTerminatedListener)
void removeExecutorTerminatedListener(ExecutorTerminatedListener listener)
listener
from the list of listeners that are notified when the
executor terminates.listener
- the listener for terminationExecutorService.isTerminated()
,
addExecutorTerminatedListener(ExecutorTerminatedListener)