Package io.grpc.protobuf.services
Class BinaryLogProvider
java.lang.Object
io.grpc.BinaryLog
io.grpc.protobuf.services.BinaryLogProvider
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
BinaryLogProviderImpl
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classThe pipeline of interceptors is hard coded when theManagedChannelis created.private static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientInterceptorstatic final MethodDescriptor.Marshaller<byte[]> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected abstract ClientInterceptorgetClientInterceptor(String fullMethodName, CallOptions callOptions) Returns aClientInterceptorfor binary logging.protected abstract ServerInterceptorgetServerInterceptor(String fullMethodName) Returns aServerInterceptorfor binary logging.private static MethodDescriptor<byte[], byte[]> toByteBufferMethod(MethodDescriptor<?, ?> method) final ChannelwrapChannel(Channel channel) Wraps a channel to provide binary logging onClientCalls as needed.final <ReqT,RespT>
ServerMethodDefinition<?, ?> wrapMethodDefinition(ServerMethodDefinition<ReqT, RespT> oMethodDef) Wraps aServerMethodDefinitionsuch that it performs binary logging if needed.
-
Field Details
-
BYTEARRAY_MARSHALLER
-
binaryLogShim
-
-
Constructor Details
-
BinaryLogProvider
public BinaryLogProvider()
-
-
Method Details
-
wrapChannel
Wraps a channel to provide binary logging onClientCalls as needed.- Specified by:
wrapChannelin classBinaryLog
-
toByteBufferMethod
-
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
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(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
- Throws:
IOException
-