Class BinaryLogProvider.BinaryLogShim

  • All Implemented Interfaces:
    ClientInterceptor
    Enclosing class:
    BinaryLogProvider

    private final class BinaryLogProvider.BinaryLogShim
    extends java.lang.Object
    implements ClientInterceptor
    The pipeline of interceptors is hard coded when the ManagedChannel is created. This shim interceptor should always be installed as a placeholder. When a call starts, this interceptor checks with the BinaryLogProvider to see if logging should happen for this particular ClientCall's method.
    • Constructor Detail

      • BinaryLogShim

        private BinaryLogShim()
    • Method Detail

      • interceptCall

        public <ReqT,​RespT> ClientCall<ReqT,​RespT> interceptCall​(MethodDescriptor<ReqT,​RespT> method,
                                                                             CallOptions callOptions,
                                                                             Channel next)
        Description copied from interface: ClientInterceptor
        Intercept ClientCall creation by the next Channel.

        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 of next.newCall().

        next.newCall() must not be called under a different Context other than the current Context. The outcome of such usage is undefined and may cause memory leak due to unbounded chain of Contexts.

        Specified by:
        interceptCall in interface ClientInterceptor
        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.