Module org.elasticsearch.server
Class ListenableFuture<T>
java.lang.Object
org.elasticsearch.action.support.SubscribableListener<T>
org.elasticsearch.common.util.concurrent.ListenableFuture<T>
- All Implemented Interfaces:
ActionListener<T>
An
ActionListener which allows for the result to fan out to a (dynamic) collection of other listeners, added using SubscribableListener.addListener(org.elasticsearch.action.ActionListener<T>). Listeners added before completion are retained until completion; listeners added after completion are completed
immediately.
Similar to ListenableActionFuture and SubscribableListener except for its handling of exceptions: if this listener is
completed exceptionally with a checked exception then it wraps the exception in an UncategorizedExecutionException whose cause is
an ExecutionException, whose cause in turn is the checked exception. This matches the behaviour of FutureUtils.get(java.util.concurrent.Future<T>).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionresult()protected RuntimeExceptionwrapException(Exception exception) Methods inherited from class org.elasticsearch.action.support.SubscribableListener
addListener, addListener, isDone, onFailure, onResponse, rawResult, wrapAsExecutionExceptionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.action.ActionListener
delegateFailure, delegateResponse, map
-
Constructor Details
-
ListenableFuture
public ListenableFuture()
-
-
Method Details
-
result
-
wrapException
- Overrides:
wrapExceptionin classSubscribableListener<T>
-