public class ListenableFutureCallbackRegistry<T> extends Object
ListenableFutureCallback instances.
Inspired by com.google.common.util.concurrent.ExecutionList.
| Constructor and Description |
|---|
ListenableFutureCallbackRegistry() |
| 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 |
public void addCallback(ListenableFutureCallback<? super T> callback)
callback - the callback to addpublic void success(T result)
ListenableFutureCallback.onSuccess(Object) call on all added
callbacks with the given resultresult - the result to trigger the callbacks withpublic void failure(Throwable t)
ListenableFutureCallback.onFailure(Throwable) call on all added
callbacks with the given Throwable.t - the exception to trigger the callbacks with