public interface ExecutorServices extends Service
Executors.newSingleThreadExecutor()
is
used.
This is a per-deployment service.Modifier and Type | Interface and Description |
---|---|
static interface |
ExecutorServices.TaskFactory<T>
Instead of submitting a list of tasks to be executed a caller may submit a factory object capable of creating the list of
tasks.
|
Modifier and Type | Method and Description |
---|---|
ExecutorService |
getTaskExecutor() |
<T> List<Future<T>> |
invokeAllAndCheckForExceptions(Collection<? extends Callable<T>> tasks)
Executes the given tasks and blocks until they all finish.
|
<T> List<Future<T>> |
invokeAllAndCheckForExceptions(ExecutorServices.TaskFactory<T> factory)
Executes all the tasks returned from calling
ExecutorServices.TaskFactory.createTasks(int) method. |
ExecutorService getTaskExecutor()
<T> List<Future<T>> invokeAllAndCheckForExceptions(Collection<? extends Callable<T>> tasks)
T
- the result type of taskstasks
- the collection of tasks<T> List<Future<T>> invokeAllAndCheckForExceptions(ExecutorServices.TaskFactory<T> factory)
ExecutorServices.TaskFactory.createTasks(int)
method. The method is called exactly
once.If a task throws an exception, the exception is rethrown by this method. If multiple tasks throw exceptions, there
is no guarantee about which of the exceptions is rethrown by this method.T
- the result type of tasksfactory
- factory capable of creating tasksCopyright © 2008-2015. All Rights Reserved.