org.springframework.core.task

## 接口 TaskDecorator

- 函数接口:
    这是一个函数接口, 因此可用作 lambda 表达式或方法引用的赋值目标。

      @FunctionalInterface
      public interface TaskDecorator

  A callback interface for a decorator to be applied to any `Runnable` about to be executed.

  Note that such a decorator is not necessarily being applied to the user-supplied `Runnable`/`Callable` but rather to the actual execution callback (which may be a wrapper around the user-supplied task).

  The primary use case is to set some execution context around the task's invocation, or to provide some monitoring/statistics for task execution.

  从以下版本开始:
    4.3
  作者:
    Juergen Hoeller
  另请参阅:
    `TaskExecutor.execute(Runnable)`, `SimpleAsyncTaskExecutor.setTaskDecorator(org.springframework.core.task.TaskDecorator)`

- - ### 方法概要

    所有方法 实例方法 抽象方法
    限定符和类型 | 方法和说明
    --- | ---
    `Runnable` | `decorate(Runnable runnable)` Decorate the given `Runnable`, returning a potentially wrapped `Runnable` for actual execution.

- - ### 方法详细资料

    - #### decorate

          Runnable decorate(Runnable runnable)

      Decorate the given `Runnable`, returning a potentially wrapped `Runnable` for actual execution.
      参数:
        `runnable` - the original `Runnable`
      返回:
        the decorated `Runnable`