public class TaskExecutor<T> extends Object
| Constructor and Description |
|---|
TaskExecutor() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Shutdown all executors used by this class.
|
protected ExecutorService |
newExecutor()
The implementation uses jsr166 ForkJoinPool implementation in case it is available and can be used,
otherwise the default
ExecutorService is used. |
protected void |
onException(Exception e)
Invoked when an exception occurs during task execution.
|
protected void |
onResultAvailable(T result)
A callback invoked when a result is available.
|
void |
submit(Collection<Callable<T>> callables)
TODO rename to submitAll.
|
protected ExecutorService newExecutor()
ExecutorService is used.ExecutorService responsible for running the tasks.public void submit(Collection<Callable<T>> callables) throws Exception
callables - a Collection of Callable to execute. When the provided collection contains only one item,
the task will be executed synchronously.Exception - if an exception occurred during callable execution.protected void onException(Exception e) throws Exception
protected void onResultAvailable(T result) throws Exception
result - the available processed result.Exception - if callback execution fails.public void destroy()
Copyright © 2008-2014. All Rights Reserved.