Class AdapterActionFuture<T,​L>

java.lang.Object
org.elasticsearch.common.util.concurrent.BaseFuture<T>
org.elasticsearch.action.support.AdapterActionFuture<T,​L>
All Implemented Interfaces:
java.util.concurrent.Future<T>, ActionFuture<T>, ActionListener<L>
Direct Known Subclasses:
PlainActionFuture, PlainListenableActionFuture

public abstract class AdapterActionFuture<T,​L>
extends BaseFuture<T>
implements ActionFuture<T>, ActionListener<L>
  • Constructor Summary

    Constructors 
    Constructor Description
    AdapterActionFuture()  
  • Method Summary

    Modifier and Type Method Description
    T actionGet()
    Similar to Future.get(), just catching the InterruptedException and throwing an IllegalStateException instead.
    T actionGet​(long timeoutMillis)
    Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead.
    T actionGet​(long timeout, java.util.concurrent.TimeUnit unit)
    Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead.
    T actionGet​(java.lang.String timeout)
    Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead.
    T actionGet​(TimeValue timeout)
    Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead.
    protected abstract T convert​(L listenerResponse)  
    void onFailure​(java.lang.Exception e)
    A failure caused by an exception at some phase of the task.
    void onResponse​(L result)
    Handle action response.

    Methods inherited from class org.elasticsearch.common.util.concurrent.BaseFuture

    blockingAllowed, cancel, done, get, get, interruptTask, isCancelled, isDone, set, setException

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.concurrent.Future

    cancel, get, get, isCancelled, isDone
  • Constructor Details

  • Method Details

    • actionGet

      public T actionGet()
      Description copied from interface: ActionFuture
      Similar to Future.get(), just catching the InterruptedException and throwing an IllegalStateException instead. Also catches ExecutionException and throws the actual cause instead.
      Specified by:
      actionGet in interface ActionFuture<T>
    • actionGet

      public T actionGet​(java.lang.String timeout)
      Description copied from interface: ActionFuture
      Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead. Also catches ExecutionException and throws the actual cause instead.
      Specified by:
      actionGet in interface ActionFuture<T>
    • actionGet

      public T actionGet​(long timeoutMillis)
      Description copied from interface: ActionFuture
      Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead. Also catches ExecutionException and throws the actual cause instead.
      Specified by:
      actionGet in interface ActionFuture<T>
      Parameters:
      timeoutMillis - Timeout in millis
    • actionGet

      public T actionGet​(TimeValue timeout)
      Description copied from interface: ActionFuture
      Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead. Also catches ExecutionException and throws the actual cause instead.
      Specified by:
      actionGet in interface ActionFuture<T>
    • actionGet

      public T actionGet​(long timeout, java.util.concurrent.TimeUnit unit)
      Description copied from interface: ActionFuture
      Similar to Future.get(long, java.util.concurrent.TimeUnit), just catching the InterruptedException and throwing an IllegalStateException instead. Also catches ExecutionException and throws the actual cause instead.
      Specified by:
      actionGet in interface ActionFuture<T>
    • onResponse

      public void onResponse​(L result)
      Description copied from interface: ActionListener
      Handle action response. This response may constitute a failure or a success but it is up to the listener to make that decision.
      Specified by:
      onResponse in interface ActionListener<T>
    • onFailure

      public void onFailure​(java.lang.Exception e)
      Description copied from interface: ActionListener
      A failure caused by an exception at some phase of the task.
      Specified by:
      onFailure in interface ActionListener<T>
    • convert

      protected abstract T convert​(L listenerResponse)