public interface Shutdownable
ExecutorService.| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs,
whichever happens first.
|
boolean |
isShutdown()
Returns
true if this service has been shut down. |
boolean |
isTerminated()
Returns
true if this service has terminated following shut down. |
void |
shutdown()
Initiates an orderly shutdown in which the service will be continue to perform its duties
as long as there is work to be done.
|
void |
shutdownNow()
Initiates an immediate shutdown in which the service will stop even if there is more work
to be done.
|
void shutdown()
perform() methods until all invocations
yield false (indicating that no work was done).
This method does not wait for for termination; use awaitTermination
to do that.
Invocation has no additional effect if already shut down.
void shutdownNow()
perform() irrespective of prior invocation results.
This method does not wait for for termination; use awaitTermination
to do that.
Invocation has no additional effect if already shut down.
boolean isShutdown()
true if this service has been shut down.true if this service has been shut downboolean isTerminated()
true if this service has terminated following shut down. Note that
isTerminated is never true unless either shutdown or
shutdownNow was called first.true if the service has terminated following shut downboolean awaitTermination(long timeout, java.util.concurrent.TimeUnit unit)
timeout - the maximum time to waitunit - the time unit of the timeout argumenttrue if this executor terminated and
false if the timeout elapsed before termination