Package org.elasticsearch.action.support
Class PlainListenableActionFuture<T>
java.lang.Object
org.elasticsearch.common.util.concurrent.BaseFuture<T>
org.elasticsearch.action.support.AdapterActionFuture<T,T>
org.elasticsearch.action.support.PlainListenableActionFuture<T>
- All Implemented Interfaces:
java.util.concurrent.Future<T>,ActionFuture<T>,ActionListener<T>,ListenableActionFuture<T>
public class PlainListenableActionFuture<T> extends AdapterActionFuture<T,T> implements ListenableActionFuture<T>
-
Constructor Summary
Constructors Modifier Constructor Description protectedPlainListenableActionFuture() -
Method Summary
Modifier and Type Method Description voidaddListener(ActionListener<T> listener)Add an action listener to be invoked when a response has received.protected Tconvert(T listenerResponse)protected voiddone(boolean success)Called when theBaseFutureis completed.static <T> PlainListenableActionFuture<T>newListenableFuture()This method returns a listenable future.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, wait
-
Constructor Details
-
PlainListenableActionFuture
protected PlainListenableActionFuture()
-
-
Method Details
-
newListenableFuture
This method returns a listenable future. The listeners will be called on completion of the future. The listeners will be executed by the same thread that completes the future.- Type Parameters:
T- the result of the future- Returns:
- a listenable future
-
addListener
Description copied from interface:ListenableActionFutureAdd an action listener to be invoked when a response has received.- Specified by:
addListenerin interfaceListenableActionFuture<T>
-
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>
-