Package io.grpc.protobuf.services
Class BinaryLogProvider
- java.lang.Object
-
- io.grpc.BinaryLog
-
- io.grpc.protobuf.services.BinaryLogProvider
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
BinaryLogProviderImpl
@Internal public abstract class BinaryLogProvider extends BinaryLog
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classBinaryLogProvider.BinaryLogShimThe pipeline of interceptors is hard coded when theManagedChannelis created.private static classBinaryLogProvider.ByteArrayMarshallerprivate static classBinaryLogProvider.IoUtils
-
Field Summary
Fields Modifier and Type Field Description private ClientInterceptorbinaryLogShimstatic MethodDescriptor.Marshaller<byte[]>BYTEARRAY_MARSHALLER
-
Constructor Summary
Constructors Constructor Description BinaryLogProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract ClientInterceptorgetClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)Returns aClientInterceptorfor binary logging.protected abstract ServerInterceptorgetServerInterceptor(java.lang.String fullMethodName)Returns aServerInterceptorfor binary logging.private static MethodDescriptor<byte[],byte[]>toByteBufferMethod(MethodDescriptor<?,?> method)ChannelwrapChannel(Channel channel)Wraps a channel to provide binary logging onClientCalls as needed.<ReqT,RespT>
ServerMethodDefinition<?,?>wrapMethodDefinition(ServerMethodDefinition<ReqT,RespT> oMethodDef)Wraps aServerMethodDefinitionsuch that it performs binary logging if needed.
-
-
-
Field Detail
-
BYTEARRAY_MARSHALLER
public static final MethodDescriptor.Marshaller<byte[]> BYTEARRAY_MARSHALLER
-
binaryLogShim
private final ClientInterceptor binaryLogShim
-
-
Method Detail
-
wrapChannel
public final Channel wrapChannel(Channel channel)
Wraps a channel to provide binary logging onClientCalls as needed.- Specified by:
wrapChannelin classBinaryLog
-
toByteBufferMethod
private static MethodDescriptor<byte[],byte[]> toByteBufferMethod(MethodDescriptor<?,?> method)
-
wrapMethodDefinition
public final <ReqT,RespT> ServerMethodDefinition<?,?> wrapMethodDefinition(ServerMethodDefinition<ReqT,RespT> oMethodDef)
Wraps aServerMethodDefinitionsuch that it performs binary logging if needed.- Specified by:
wrapMethodDefinitionin classBinaryLog
-
getServerInterceptor
@Nullable protected abstract ServerInterceptor getServerInterceptor(java.lang.String fullMethodName)
Returns aServerInterceptorfor binary logging. gRPC is free to cache the interceptor, so the interceptor must be reusable across calls. At runtime, the request and response marshallers are alwaysMarshaller<InputStream>. Returnsnullif this method is not binary logged.
-
getClientInterceptor
@Nullable protected abstract ClientInterceptor getClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)
Returns aClientInterceptorfor binary logging. gRPC is free to cache the interceptor, so the interceptor must be reusable across calls. At runtime, the request and response marshallers are alwaysMarshaller<InputStream>. Returnsnullif this method is not binary logged.
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-
-