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.
-
-
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.Stringexecutor()voidhandleException(TransportException exp)voidhandleResponse(T response)Tread(StreamInput in)ReadV-type value from a stream.java.lang.StringtoString()-
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 Detail
-
ContextRestoreResponseHandler
public ContextRestoreResponseHandler(java.util.function.Supplier<ThreadContext.StoredContext> contextSupplier, TransportResponseHandler<T> delegate)
-
-
Method Detail
-
read
public T read(StreamInput in) throws java.io.IOException
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:
java.io.IOException
-
handleResponse
public void handleResponse(T response)
- Specified by:
handleResponsein interfaceTransportResponseHandler<T extends TransportResponse>
-
handleException
public void handleException(TransportException exp)
- Specified by:
handleExceptionin interfaceTransportResponseHandler<T extends TransportResponse>
-
executor
public java.lang.String executor()
- Specified by:
executorin interfaceTransportResponseHandler<T extends TransportResponse>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-