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
ConstructorsConstructorDescriptionContextRestoreResponseHandler(Supplier<ThreadContext.StoredContext> contextSupplier, TransportResponseHandler<T> delegate) -
Method Summary
Modifier and TypeMethodDescriptionexecutor()voidvoidhandleResponse(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, waitMethods 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.ReaderReadV-type value from a stream.- Specified by:
readin interfaceWriteable.Reader<T extends TransportResponse>- Parameters:
in- Input to read the value from- Throws:
IOException
-
handleResponse
- Specified by:
handleResponsein interfaceTransportResponseHandler<T extends TransportResponse>
-
handleException
- Specified by:
handleExceptionin interfaceTransportResponseHandler<T extends TransportResponse>
-
executor
- Specified by:
executorin interfaceTransportResponseHandler<T extends TransportResponse>
-
toString
-