Package io.grpc.stub
Class MetadataUtils.MetadataCapturingClientInterceptor
- java.lang.Object
-
- io.grpc.stub.MetadataUtils.MetadataCapturingClientInterceptor
-
- All Implemented Interfaces:
ClientInterceptor
- Enclosing class:
- MetadataUtils
private static final class MetadataUtils.MetadataCapturingClientInterceptor extends java.lang.Object implements ClientInterceptor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classMetadataUtils.MetadataCapturingClientInterceptor.MetadataCapturingClientCall<ReqT,RespT>
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.concurrent.atomic.AtomicReference<Metadata>headersCapture(package private) java.util.concurrent.atomic.AtomicReference<Metadata>trailersCapture
-
Constructor Summary
Constructors Constructor Description MetadataCapturingClientInterceptor(java.util.concurrent.atomic.AtomicReference<Metadata> headersCapture, java.util.concurrent.atomic.AtomicReference<Metadata> trailersCapture)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <ReqT,RespT>
ClientCall<ReqT,RespT>interceptCall(MethodDescriptor<ReqT,RespT> method, CallOptions callOptions, Channel next)
-
-
-
Method Detail
-
interceptCall
public <ReqT,RespT> ClientCall<ReqT,RespT> interceptCall(MethodDescriptor<ReqT,RespT> method, CallOptions callOptions, Channel next)
Description copied from interface:ClientInterceptorInterceptClientCallcreation by thenextChannel.Many variations of interception are possible. Complex implementations may return a wrapper around the result of
next.newCall(), whereas a simpler implementation may just modify the header metadata prior to returning the result ofnext.newCall().next.newCall()must not be called under a differentContextother than the currentContext. The outcome of such usage is undefined and may cause memory leak due to unbounded chain ofContexts.- Specified by:
interceptCallin interfaceClientInterceptor- Parameters:
method- the remote method to be called.callOptions- the runtime options to be applied to this call.next- the channel which is being intercepted.- Returns:
- the call object for the remote operation, never
null.
-
-