org.springframework.core.task

## 接口 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.

  Equivalent to JDK 1.5's `Executor` interface; extending it now in Spring 3.0, so that clients may declare a dependency on an Executor and receive any TaskExecutor implementation. This interface remains separate from the standard Executor interface mainly for backwards compatibility with JDK 1.4 in Spring 2.x.

  从以下版本开始:
    2.0
  作者:
    Juergen Hoeller
  另请参阅:
    `Executor`

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `execute(Runnable task)` 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