Package org.elasticsearch.transport
Class TransportService.ContextRestoreResponseHandler<T extends TransportResponse>
java.lang.Object
org.elasticsearch.transport.TransportService.ContextRestoreResponseHandler<T>
- All Implemented Interfaces:
Writeable.Reader<T>
,TransportResponseHandler<T>
- Enclosing class:
- TransportService
public static final class TransportService.ContextRestoreResponseHandler<T extends TransportResponse> extends java.lang.Object implements TransportResponseHandler<T>
This handler wrapper ensures that the response thread executes with the correct thread context. Before any of the handle methods
are invoked we restore the context.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.transport.TransportResponseHandler
TransportResponseHandler.Empty
-
Constructor Summary
Constructors Constructor Description ContextRestoreResponseHandler(java.util.function.Supplier<ThreadContext.StoredContext> contextSupplier, TransportResponseHandler<T> delegate)
-
Method Summary
Modifier and Type Method Description java.lang.String
executor()
void
handleException(TransportException exp)
void
handleResponse(T response)
T
read(StreamInput in)
ReadV
-type value from a stream.java.lang.String
toString()
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
wrap
-
Constructor Details
-
ContextRestoreResponseHandler
public ContextRestoreResponseHandler(java.util.function.Supplier<ThreadContext.StoredContext> contextSupplier, TransportResponseHandler<T> delegate)
-
-
Method Details
-
read
Description copied from interface:Writeable.Reader
ReadV
-type value from a stream.- Specified by:
read
in interfaceWriteable.Reader<T extends TransportResponse>
- Parameters:
in
- Input to read the value from- Throws:
java.io.IOException
-
handleResponse
- Specified by:
handleResponse
in interfaceTransportResponseHandler<T extends TransportResponse>
-
handleException
- Specified by:
handleException
in interfaceTransportResponseHandler<T extends TransportResponse>
-
executor
public java.lang.String executor()- Specified by:
executor
in interfaceTransportResponseHandler<T extends TransportResponse>
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-