Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens
first.
|
<T> Future<T> |
execute(Callable<T> callable)
Executes the provided
Callable sometime in the future. |
<T> Future<T> |
execute(Executable<T> executable)
Executes the provided
Executable sometime in the future. |
<T> List<Future<T>> |
executeAll(Callable<T>... callables)
Executes the list of provided
Callable sometime in the future. |
<T> List<Future<T>> |
executeAll(Executable<T>... executables)
Executes the list of provided
Executable sometime in the future. |
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
|
<T> Future<T> execute(Executable<T> executable)
Executable
sometime in the future.T
- The type the Future is expected to deliverexecutable
- The executable to execute<T> Future<T> execute(Callable<T> callable)
Callable
sometime in the future.T
- The type the Future is expected to delivercallable
- The callable to execute<T> List<Future<T>> executeAll(Executable<T>... executables)
Executable
sometime in the future.T
- The type the Future is expected to deliverexecutables
- The list of executables to execute<T> List<Future<T>> executeAll(Callable<T>... callables)
Callable
sometime in the future.T
- The type the Future is expected to delivercallables
- The list of callables to executevoid shutdown()
boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
timeout
- the maximum time to waitunit
- the time unit of the timeout argumentInterruptedException
- if interrupted while waitingCopyright © 2015, Peter Nerg Apache License v2.0