-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> List<T>callAll(Collection<? extends Callable<? extends T>> tasks)Calls all of the tasks concurrently, waiting for them to all complete.voidexecute(Runnable command)voidrunAll(Collection<? extends Runnable> tasks)Runs all of the tasks concurrently, waiting for them to all complete.Future<?>submit(Runnable task)Submits to the executor.Future<?>submit(Runnable task, long delay)Submits to the executor after the provided delay.<T> Future<T>submit(Runnable task, T result)Submits to the executor, returning the provided value on success.<T> Future<T>submit(Runnable task, T result, long delay)Submits to the executor after the provided delay, returning the provided value on success.<T> Future<T>submit(Callable<? extends T> task)Submits to the executor.<T> Future<T>submit(Callable<? extends T> task, long delay)Submits to the executor after the provided delay.
-
-
-
Method Detail
-
submit
<T> Future<T> submit(Callable<? extends T> task) throws IllegalStateException
Submits to the executor.- Throws:
IllegalStateException- if already closed.- See Also:
Executors.wrap(java.util.concurrent.Callable)
-
callAll
<T> List<T> callAll(Collection<? extends Callable<? extends T>> tasks) throws IllegalStateException, InterruptedException, ExecutionException
Calls all of the tasks concurrently, waiting for them to all complete. If there is only one task, it is called on the current thread. Rather than just have the current thread waiting, the last task is called by the current thread.- Parameters:
tasks- Only iterated once in this implementation- Throws:
IllegalStateException- if already closed.InterruptedExceptionExecutionException- See Also:
Executors.wrap(java.util.concurrent.Callable)
-
submit
<T> Future<T> submit(Callable<? extends T> task, long delay) throws IllegalStateException
Submits to the executor after the provided delay.- Parameters:
delay- if less than zero, will use zero delay- Throws:
IllegalStateException- if already closed.- See Also:
Executors.wrap(java.util.concurrent.Callable)
-
submit
<T> Future<T> submit(Runnable task, T result) throws IllegalStateException
Submits to the executor, returning the provided value on success.- Throws:
IllegalStateException- if already closed.- See Also:
Executors.wrap(java.lang.Runnable)
-
submit
Future<?> submit(Runnable task) throws IllegalStateException
Submits to the executor.- Throws:
IllegalStateException- if already closed.- See Also:
Executors.wrap(java.lang.Runnable)
-
runAll
void runAll(Collection<? extends Runnable> tasks) throws IllegalStateException, InterruptedException, ExecutionException
Runs all of the tasks concurrently, waiting for them to all complete. If there is only one task, it is ran on the current thread. Rather than just have the current thread waiting, the last task is ran by the current thread.- Parameters:
tasks- Only iterated once in this implementation- Throws:
IllegalStateException- if already closed.InterruptedExceptionExecutionException- See Also:
Executors.wrap(java.lang.Runnable)
-
submit
<T> Future<T> submit(Runnable task, T result, long delay) throws IllegalStateException
Submits to the executor after the provided delay, returning the provided value on success.- Parameters:
delay- if less than zero, will use zero delay- Throws:
IllegalStateException- if already closed.- See Also:
Executors.wrap(java.lang.Runnable)
-
submit
Future<?> submit(Runnable task, long delay) throws IllegalStateException
Submits to the executor after the provided delay.- Parameters:
delay- if less than zero, will use zero delay- Throws:
IllegalStateException- if already closed.- See Also:
Executors.wrap(java.lang.Runnable)
-
-