Package org.springframework.core.task
Interface AsyncListenableTaskExecutor
- All Superinterfaces:
AsyncTaskExecutor,Executor,TaskExecutor
- All Known Implementing Classes:
ConcurrentTaskExecutor,ConcurrentTaskScheduler,DefaultManagedTaskExecutor,DefaultManagedTaskScheduler,SimpleAsyncTaskExecutor,SimpleThreadPoolTaskExecutor,TaskExecutorAdapter,ThreadPoolTaskExecutor,ThreadPoolTaskScheduler
Extension of the
AsyncTaskExecutor interface, adding the capability to submit
tasks for ListenableFutures.- Since:
- 4.0
- Author:
- Arjen Poutsma
- See Also:
-
Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE -
Method Summary
Modifier and TypeMethodDescriptionsubmitListenable(Runnable task) Submit aRunnabletask for execution, receiving aListenableFuturerepresenting that task.<T> ListenableFuture<T>submitListenable(Callable<T> task) Submit aCallabletask for execution, receiving aListenableFuturerepresenting that task.Methods inherited from interface org.springframework.core.task.AsyncTaskExecutor
execute, submit, submitMethods inherited from interface org.springframework.core.task.TaskExecutor
execute
-
Method Details
-
submitListenable
Submit aRunnabletask for execution, receiving aListenableFuturerepresenting that task. The Future will return anullresult upon completion.- Parameters:
task- theRunnableto execute (nevernull)- Returns:
- a
ListenableFuturerepresenting pending completion of the task - Throws:
TaskRejectedException- if the given task was not accepted
-
submitListenable
Submit aCallabletask for execution, receiving aListenableFuturerepresenting that task. The Future will return the Callable's result upon completion.- Parameters:
task- theCallableto execute (nevernull)- Returns:
- a
ListenableFuturerepresenting pending completion of the task - Throws:
TaskRejectedException- if the given task was not accepted
-