org.elasticsearch.transport
Class PlainTransportFuture<V extends Streamable>

java.lang.Object
  extended by org.elasticsearch.common.util.concurrent.BaseFuture<V>
      extended by org.elasticsearch.transport.PlainTransportFuture<V>
All Implemented Interfaces:
Future<V>, TransportFuture<V>, TransportResponseHandler<V>

public class PlainTransportFuture<V extends Streamable>
extends BaseFuture<V>
implements TransportFuture<V>, TransportResponseHandler<V>


Constructor Summary
PlainTransportFuture(TransportResponseHandler<V> handler)
           
 
Method Summary
 String executor()
           
 void handleException(TransportException exp)
           
 void handleResponse(V response)
           
 V newInstance()
          creates a new instance of the return type from the remote call.
 String toString()
           
 V txGet()
          Waits if necessary for the computation to complete, and then retrieves its result.
 V txGet(long timeout, TimeUnit unit)
          Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
 
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, wait, wait, wait
 
Methods inherited from interface java.util.concurrent.Future
cancel, get, get, isCancelled, isDone
 

Constructor Detail

PlainTransportFuture

public PlainTransportFuture(TransportResponseHandler<V> handler)
Method Detail

txGet

public V txGet()
                           throws ElasticSearchException
Description copied from interface: TransportFuture
Waits if necessary for the computation to complete, and then retrieves its result.

Specified by:
txGet in interface TransportFuture<V extends Streamable>
Throws:
ElasticSearchException

txGet

public V txGet(long timeout,
               TimeUnit unit)
                           throws ElasticSearchException
Description copied from interface: TransportFuture
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.

Specified by:
txGet in interface TransportFuture<V extends Streamable>
Throws:
ElasticSearchException

newInstance

public V newInstance()
Description copied from interface: TransportResponseHandler
creates a new instance of the return type from the remote call. called by the infra before de-serializing the response.

Specified by:
newInstance in interface TransportResponseHandler<V extends Streamable>
Returns:
a new response copy.

executor

public String executor()
Specified by:
executor in interface TransportResponseHandler<V extends Streamable>

handleResponse

public void handleResponse(V response)
Specified by:
handleResponse in interface TransportResponseHandler<V extends Streamable>

handleException

public void handleException(TransportException exp)
Specified by:
handleException in interface TransportResponseHandler<V extends Streamable>

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009-2012. All Rights Reserved.