Package org.elasticsearch.transport
Class PlainTransportFuture<V extends TransportResponse>
- java.lang.Object
-
- org.elasticsearch.common.util.concurrent.BaseFuture<V>
-
- org.elasticsearch.transport.PlainTransportFuture<V>
-
- All Implemented Interfaces:
java.util.concurrent.Future<V>
,Writeable.Reader<V>
,TransportFuture<V>
,TransportResponseHandler<V>
public class PlainTransportFuture<V extends TransportResponse> extends BaseFuture<V> implements TransportFuture<V>, TransportResponseHandler<V>
-
-
Constructor Summary
Constructors Constructor Description PlainTransportFuture(TransportResponseHandler<V> handler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
executor()
void
handleException(TransportException exp)
void
handleResponse(V response)
V
read(StreamInput in)
deserializes a new instance of the return type from the stream.java.lang.String
toString()
V
txGet()
Waits if necessary for the computation to complete, and then retrieves its result.V
txGet(long timeout, java.util.concurrent.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 org.elasticsearch.transport.TransportResponseHandler
newInstance
-
-
-
-
Constructor Detail
-
PlainTransportFuture
public PlainTransportFuture(TransportResponseHandler<V> handler)
-
-
Method Detail
-
txGet
public V txGet()
Description copied from interface:TransportFuture
Waits if necessary for the computation to complete, and then retrieves its result.- Specified by:
txGet
in interfaceTransportFuture<V extends TransportResponse>
-
txGet
public V txGet(long timeout, java.util.concurrent.TimeUnit unit)
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 interfaceTransportFuture<V extends TransportResponse>
-
read
public V read(StreamInput in) throws java.io.IOException
Description copied from interface:TransportResponseHandler
deserializes a new instance of the return type from the stream. called by the infra when de-serializing the response.- Specified by:
read
in interfaceTransportResponseHandler<V extends TransportResponse>
- Specified by:
read
in interfaceWriteable.Reader<V extends TransportResponse>
- Parameters:
in
- Input to read the value from- Returns:
- the deserialized response.
- Throws:
java.io.IOException
-
executor
public java.lang.String executor()
- Specified by:
executor
in interfaceTransportResponseHandler<V extends TransportResponse>
-
handleResponse
public void handleResponse(V response)
- Specified by:
handleResponse
in interfaceTransportResponseHandler<V extends TransportResponse>
-
handleException
public void handleException(TransportException exp)
- Specified by:
handleException
in interfaceTransportResponseHandler<V extends TransportResponse>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-