org.springframework.util.concurrent

## 接口 ListenableFuture<T>

- 所有超级接口:
    Future<T>
  所有已知实现类:
    CompletableToListenableFutureAdapter, ListenableFutureAdapter, ListenableFutureTask, SettableListenableFuture

      public interface ListenableFuture<T>
      extends Future<T>

  Extend `Future` with the capability to accept completion callbacks. If the future has completed when the callback is added, the callback is triggered immediately.

  Inspired by `com.google.common.util.concurrent.ListenableFuture`.

  从以下版本开始:
    4.0
  作者:
    Arjen Poutsma, Sebastien Deleuze, Juergen Hoeller

- - ### 方法概要

    所有方法 实例方法 抽象方法 默认方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addCallback(ListenableFutureCallback<? super T> callback)` Register the given `ListenableFutureCallback`.
    `void` | `addCallback(SuccessCallback<? super T> successCallback, FailureCallback failureCallback)` Java 8 lambda-friendly alternative with success and failure callbacks.
    `default CompletableFuture<T>` | `completable()` Expose this `ListenableFuture` as a JDK `CompletableFuture`.

    - ### 从接口继承的方法 java.util.concurrent.Future

      `cancel, get, get, isCancelled, isDone`

- - ### 方法详细资料

    - #### addCallback

          void addCallback(ListenableFutureCallback<? super T> callback)

      Register the given `ListenableFutureCallback`.
      参数:
        `callback` - the callback to register

    - #### addCallback

          void addCallback(SuccessCallback<? super T> successCallback,
                           FailureCallback failureCallback)

      Java 8 lambda-friendly alternative with success and failure callbacks.
      参数:
        `successCallback` - the success callback
        `failureCallback` - the failure callback
      从以下版本开始:
        4.1

    - #### completable

          default CompletableFuture<T> completable()

      Expose this `ListenableFuture` as a JDK `CompletableFuture`.
      从以下版本开始:
        5.0