org.springframework.util.concurrent

## 类 ListenableFutureCallbackRegistry<T>

- java.lang.Object
- - org.springframework.util.concurrent.ListenableFutureCallbackRegistry<T>

-     public class ListenableFutureCallbackRegistry<T>
      extends Object

  Helper class for `ListenableFuture` implementations that maintains a of success and failure callbacks and helps to notify them.

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

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

- - ### 构造器概要

    构造器
    构造器和说明
    `ListenableFutureCallbackRegistry()`

  - ### 方法概要

    所有方法 实例方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `addCallback(ListenableFutureCallback<? super T> callback)` Add the given callback to this registry.
    `void` | `addFailureCallback(FailureCallback callback)` Add the given failure callback to this registry.
    `void` | `addSuccessCallback(SuccessCallback<? super T> callback)` Add the given success callback to this registry.
    `void` | `failure(Throwable ex)` Trigger a `FailureCallback.onFailure(Throwable)` call on all added callbacks with the given `Throwable`.
    `void` | `success(T result)` Trigger a `SuccessCallback.onSuccess(Object)` call on all added callbacks with the given result.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### ListenableFutureCallbackRegistry

          public ListenableFutureCallbackRegistry()

  - ### 方法详细资料

    - #### addCallback

          public void addCallback(ListenableFutureCallback<? super T> callback)

      Add the given callback to this registry.
      参数:
        `callback` - the callback to add

    - #### addSuccessCallback

          public void addSuccessCallback(SuccessCallback<? super T> callback)

      Add the given success callback to this registry.
      参数:
        `callback` - the success callback to add
      从以下版本开始:
        4.1

    - #### addFailureCallback

          public void addFailureCallback(FailureCallback callback)

      Add the given failure callback to this registry.
      参数:
        `callback` - the failure callback to add
      从以下版本开始:
        4.1

    - #### success

          public void success(@Nullable
                              T result)

      Trigger a `SuccessCallback.onSuccess(Object)` call on all added callbacks with the given result.
      参数:
        `result` - the result to trigger the callbacks with

    - #### failure

          public void failure(Throwable ex)

      Trigger a `FailureCallback.onFailure(Throwable)` call on all added callbacks with the given `Throwable`.
      参数:
        `ex` - the exception to trigger the callbacks with