org.elasticsearch.action.support
Class AdapterActionFuture<T,L>

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

public abstract class AdapterActionFuture<T,L>
extends org.elasticsearch.common.util.concurrent.AbstractFuture<T>
implements ActionFuture<T>, ActionListener<L>


Constructor Summary
AdapterActionFuture()
           
 
Method Summary
 T actionGet()
          Similar to Future.get(), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.
 T actionGet(long timeoutMillis)
          Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.
 T actionGet(long timeout, java.util.concurrent.TimeUnit unit)
          Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.
 T actionGet(java.lang.String timeout)
          Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.
 T actionGet(TimeValue timeout)
          Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.
protected abstract  T convert(L listenerResponse)
           
 void onFailure(java.lang.Throwable e)
          A failure handler.
 void onResponse(L result)
          A response handler.
 
Methods inherited from class org.elasticsearch.common.util.concurrent.AbstractFuture
cancel, cancel, done, get, get, 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 Detail

AdapterActionFuture

public AdapterActionFuture()
Method Detail

actionGet

public T actionGet()
            throws ElasticSearchException
Description copied from interface: ActionFuture
Similar to Future.get(), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.

Specified by:
actionGet in interface ActionFuture<T>
Throws:
ElasticSearchException

actionGet

public T actionGet(java.lang.String timeout)
            throws ElasticSearchException
Description copied from interface: ActionFuture
Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.

Specified by:
actionGet in interface ActionFuture<T>
Throws:
ElasticSearchException

actionGet

public T actionGet(long timeoutMillis)
            throws ElasticSearchException
Description copied from interface: ActionFuture
Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.

Specified by:
actionGet in interface ActionFuture<T>
Parameters:
timeoutMillis - Timeout in millis
Throws:
ElasticSearchException

actionGet

public T actionGet(TimeValue timeout)
            throws ElasticSearchException
Description copied from interface: ActionFuture
Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.

Specified by:
actionGet in interface ActionFuture<T>
Throws:
ElasticSearchException

actionGet

public T actionGet(long timeout,
                   java.util.concurrent.TimeUnit unit)
            throws ElasticSearchException
Description copied from interface: ActionFuture
Similar to Future.get(long, java.util.concurrent.TimeUnit), just wrapping the InterruptedException with ElasticSearchInterruptedException, and throwing the actual cause of the ExecutionException.

Specified by:
actionGet in interface ActionFuture<T>
Throws:
ElasticSearchException

onResponse

public void onResponse(L result)
Description copied from interface: ActionListener
A response handler.

Specified by:
onResponse in interface ActionListener<L>

onFailure

public void onFailure(java.lang.Throwable e)
Description copied from interface: ActionListener
A failure handler.

Specified by:
onFailure in interface ActionListener<L>

convert

protected abstract T convert(L listenerResponse)