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 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
ConstructorDescriptionContextRestoreResponseHandler(Supplier<ThreadContext.StoredContext> contextSupplier, TransportResponseHandler<T> delegate)
-
Method Summary
Modifier and TypeMethodDescriptionexecutor()
void
void
handleResponse(T response)
read(StreamInput in)
ReadV
-type value from a stream.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(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:
IOException
-
handleResponse
- Specified by:
handleResponse
in interfaceTransportResponseHandler<T extends TransportResponse>
-
handleException
- Specified by:
handleException
in interfaceTransportResponseHandler<T extends TransportResponse>
-
executor
- Specified by:
executor
in interfaceTransportResponseHandler<T extends TransportResponse>
-
toString
-