Package org.elasticsearch.action.support
Class ListenableActionFuture<T>
java.lang.Object
org.elasticsearch.common.util.concurrent.BaseFuture<T>
org.elasticsearch.action.support.AdapterActionFuture<T,T>
org.elasticsearch.action.support.ListenableActionFuture<T>
- All Implemented Interfaces:
Future<T>,ActionFuture<T>,ActionListener<T>
A
Future and ActionListener against which which other ActionListeners can be registered later, to support
fanning-out a result to a dynamic collection of listeners.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.action.ActionListener
ActionListener.Delegating<Response,DelegateResponse>, ActionListener.DelegatingActionListener<T>, ActionListener.DelegatingFailureActionListener<T,R>, ActionListener.MappedActionListener<Response,MappedResponse>, ActionListener.RunAfterActionListener<T>, ActionListener.RunBeforeActionListener<T> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(ActionListener<T> listener)Registers anActionListenerto be notified when this future is completed.protected Tprotected voiddone(boolean success)Called when theBaseFutureis completed.Methods inherited from class org.elasticsearch.action.support.AdapterActionFuture
actionGet, actionGet, actionGet, actionGet, actionGet, onFailure, onResponseMethods inherited from class org.elasticsearch.common.util.concurrent.BaseFuture
blockingAllowed, cancel, get, get, interruptTask, isCancelled, isDone, set, setExceptionMethods 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
-
ListenableActionFuture
public ListenableActionFuture()
-
-
Method Details
-
addListener
Registers anActionListenerto be notified when this future is completed. If the future is already completed then the listener is notified immediately, on the calling thread. If not, the listener is notified on the thread that completes the listener. -
done
protected void done(boolean success)Description copied from class:BaseFutureCalled when theBaseFutureis completed. Thesuccessboolean indicates if theBaseFuturewas successfully completed (the value istrue). In the cases theBaseFuturewas completed with an error or cancelled the value isfalse.- Overrides:
donein classBaseFuture<T>- Parameters:
success- indicates if theBaseFuturewas completed with success (true); in other cases it equals to false
-
convert
- Specified by:
convertin classAdapterActionFuture<T,T>
-