接口 TaskExecutor

所有超级接口:
Executor
所有已知子接口:
AsyncListenableTaskExecutor, AsyncTaskExecutor
所有已知实现类:
SimpleAsyncTaskExecutor, SyncTaskExecutor, TaskExecutorAdapter
函数接口:
这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

@FunctionalInterface public interface TaskExecutor extends Executor
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.

从以下版本开始:
4.0
作者:
Juergen Hoeller
另请参阅:
  • 方法概要

    修饰符和类型
    方法
    说明
    void
    Execute the given task.
  • 方法详细资料

    • execute

      void execute(Runnable task)
      Execute the given task.

      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 - the Runnable to execute (never null)
      抛出:
      TaskRejectedException - if the given task was not accepted