public interface ModelFarm
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination()
Blocks until all tasks have completed execution after a shutdown
request.
|
boolean |
awaitTermination(long timeout,
TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown
request, or the timeout occurs, whichever happens first.
|
void |
shutdown()
Initiates an orderly shutdown in which previously submitted
tasks are executed, but no new tasks will be accepted.
|
void |
shutdownAndAwaitTermination()
Shuts down and then awaits termination.
|
boolean |
shutdownAndAwaitTermination(long timeout,
TimeUnit unit)
Shuts down and then awaits termination.
|
void |
start()
Initiates execution.
|
void |
terminate()
Initiates an immediate termination of all tasks.
|
void start()
void shutdown()
This method does not wait for previously submitted tasks to
complete execution. Use awaitTermination
to do that.
void terminate()
boolean awaitTermination()
true
if this executor terminated and
false
if the timeout elapsed before terminationboolean awaitTermination(long timeout, 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 terminationvoid shutdownAndAwaitTermination()
boolean shutdownAndAwaitTermination(long timeout, 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