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

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

public abstract class AdapterActionFuture<T,L>
extends BaseFuture<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, 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(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)
           
 Throwable getRootFailure()
          The root (possibly) wrapped failure.
 void onFailure(Throwable e)
          A failure handler.
 void onResponse(L result)
          A response handler.
 
Methods inherited from class org.elasticsearch.common.util.concurrent.BaseFuture
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 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.

Note, the actual cause is unwrapped to the actual failure (for example, unwrapped from RemoteTransportException. The root failure is still accessible using ActionFuture.getRootFailure().

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

actionGet

public T actionGet(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.

Note, the actual cause is unwrapped to the actual failure (for example, unwrapped from RemoteTransportException. The root failure is still accessible using ActionFuture.getRootFailure().

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.

Note, the actual cause is unwrapped to the actual failure (for example, unwrapped from RemoteTransportException. The root failure is still accessible using ActionFuture.getRootFailure().

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.

Note, the actual cause is unwrapped to the actual failure (for example, unwrapped from RemoteTransportException. The root failure is still accessible using ActionFuture.getRootFailure().

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

actionGet

public T actionGet(long timeout,
                   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.

Note, the actual cause is unwrapped to the actual failure (for example, unwrapped from RemoteTransportException. The root failure is still accessible using ActionFuture.getRootFailure().

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(Throwable e)
Description copied from interface: ActionListener
A failure handler.

Specified by:
onFailure in interface ActionListener<L>

convert

protected abstract T convert(L listenerResponse)

getRootFailure

public Throwable getRootFailure()
Description copied from interface: ActionFuture
The root (possibly) wrapped failure.

Specified by:
getRootFailure in interface ActionFuture<T>


Copyright © 2009-2012. All Rights Reserved.