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)
Add the given callback to this registry.
|
void |
failure(Throwable ex)
Trigger a
ListenableFutureCallback.onFailure(Throwable) call on all
added callbacks with the given Throwable. |
void |
success(T result)
Trigger 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 result.result - the result to trigger the callbacks withpublic void failure(Throwable ex)
ListenableFutureCallback.onFailure(Throwable) call on all
added callbacks with the given Throwable.ex - the exception to trigger the callbacks with