Package org.springframework.core.task
Interface AsyncListenableTaskExecutor
- All Superinterfaces:
AsyncTaskExecutor
,Executor
,TaskExecutor
- All Known Implementing Classes:
ConcurrentTaskExecutor
,ConcurrentTaskScheduler
,DefaultManagedTaskExecutor
,DefaultManagedTaskScheduler
,GlassFishWorkManagerTaskExecutor
,JBossWorkManagerTaskExecutor
,SimpleAsyncTaskExecutor
,SimpleThreadPoolTaskExecutor
,TaskExecutorAdapter
,ThreadPoolTaskExecutor
,ThreadPoolTaskScheduler
,WorkManagerTaskExecutor
,WorkManagerTaskExecutor
public interface AsyncListenableTaskExecutor extends AsyncTaskExecutor
Extension of theAsyncTaskExecutor
interface, adding the capability to submit tasks forListenableFuture
s.- Since:
- 4.0
- Author:
- Arjen Poutsma
- See Also:
ListenableFuture
Field Summary
Fields inherited from interface org.springframework.core.task.AsyncTaskExecutor
TIMEOUT_IMMEDIATE, TIMEOUT_INDEFINITE
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ListenableFuture<?>
submitListenable(Runnable task)
Submit aRunnable
task for execution, receiving aListenableFuture
representing that task.<T> ListenableFuture<T>
submitListenable(Callable<T> task)
Submit aCallable
task for execution, receiving aListenableFuture
representing that task.Methods inherited from interface org.springframework.core.task.AsyncTaskExecutor
execute, submit, submit
Methods inherited from interface org.springframework.core.task.TaskExecutor
execute
Method Detail
submitListenable
ListenableFuture<?> submitListenable(Runnable task)
Submit aRunnable
task for execution, receiving aListenableFuture
representing that task. The Future will return anull
result upon completion.- Parameters:
task
- theRunnable
to execute (nevernull
)- Returns:
- a
ListenableFuture
representing pending completion of the task - Throws:
TaskRejectedException
- if the given task was not accepted
submitListenable
<T> ListenableFuture<T> submitListenable(Callable<T> task)
Submit aCallable
task for execution, receiving aListenableFuture
representing that task. The Future will return the Callable's result upon completion.- Parameters:
task
- theCallable
to execute (nevernull
)- Returns:
- a
ListenableFuture
representing pending completion of the task - Throws:
TaskRejectedException
- if the given task was not accepted