org.springframework.util.concurrent

## Class ListenableFutureCallbackRegistry<T>

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

-     public class ListenableFutureCallbackRegistry<T>
      extends Object

  Registry for `ListenableFutureCallback` instances.

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

  Since:
    4.0
  Author:
    Arjen Poutsma

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ListenableFutureCallbackRegistry()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCallback(ListenableFutureCallback<? super T> callback)` Adds the given callback to this registry.
    `void` | `failure(Throwable t)` Triggers a `ListenableFutureCallback.onFailure(Throwable)` call on all added callbacks with the given `Throwable`.
    `void` | `success(T result)` Triggers a `ListenableFutureCallback.onSuccess(Object)` call on all added callbacks with the given result

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### ListenableFutureCallbackRegistry

          public ListenableFutureCallbackRegistry()

  - ### Method Detail

    - #### addCallback

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

      Adds the given callback to this registry.
      Parameters:
        `callback` - the callback to add

    - #### success

          public void success(T result)

      Triggers a `ListenableFutureCallback.onSuccess(Object)` call on all added callbacks with the given result
      Parameters:
        `result` - the result to trigger the callbacks with

    - #### failure

          public void failure(Throwable t)

      Triggers a `ListenableFutureCallback.onFailure(Throwable)` call on all added callbacks with the given `Throwable`.
      Parameters:
        `t` - the exception to trigger the callbacks with