接口 TaskExecutor
- 所有超级接口:
Executor
- 所有已知子接口:
AsyncListenableTaskExecutor,AsyncTaskExecutor
- 函数接口:
- 这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。
Simple task executor interface that abstracts the execution
of a
Runnable.
Implementations can use all sorts of different execution strategies, such as: synchronous, asynchronous, using a thread pool, and more.
Equivalent to Java's Executor interface,
so that clients may declare a dependency on an Executor and receive
any TaskExecutor implementation. This interface remains separate from
the standard Executor interface primarily for backwards compatibility
with older APIs that depend on the TaskExecutor interface.
- 从以下版本开始:
- 4.0
- 作者:
- Juergen Hoeller, Harry Yang
- 另请参阅:
-
方法概要
-
方法详细资料
-
execute
Execute the giventask.The call might return immediately if the implementation uses an asynchronous execution strategy, or might block in the case of synchronous execution.
- 指定者:
execute在接口中Executor- 参数:
task- theRunnableto execute (nevernull)- 抛出:
TaskRejectedException- if the given task was not accepted
-