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 class
BinaryLogProvider.BinaryLogShim
The pipeline of interceptors is hard coded when theManagedChannel
is created.private static class
BinaryLogProvider.ByteArrayMarshaller
private static class
BinaryLogProvider.IoUtils
-
Field Summary
Fields Modifier and Type Field Description private ClientInterceptor
binaryLogShim
static 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 void
close()
protected abstract ClientInterceptor
getClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)
Returns aClientInterceptor
for binary logging.protected abstract ServerInterceptor
getServerInterceptor(java.lang.String fullMethodName)
Returns aServerInterceptor
for binary logging.private static MethodDescriptor<byte[],byte[]>
toByteBufferMethod(MethodDescriptor<?,?> method)
Channel
wrapChannel(Channel channel)
Wraps a channel to provide binary logging onClientCall
s as needed.<ReqT,RespT>
ServerMethodDefinition<?,?>wrapMethodDefinition(ServerMethodDefinition<ReqT,RespT> oMethodDef)
Wraps aServerMethodDefinition
such 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 onClientCall
s as needed.- Specified by:
wrapChannel
in classBinaryLog
-
toByteBufferMethod
private static MethodDescriptor<byte[],byte[]> toByteBufferMethod(MethodDescriptor<?,?> method)
-
wrapMethodDefinition
public final <ReqT,RespT> ServerMethodDefinition<?,?> wrapMethodDefinition(ServerMethodDefinition<ReqT,RespT> oMethodDef)
Wraps aServerMethodDefinition
such that it performs binary logging if needed.- Specified by:
wrapMethodDefinition
in classBinaryLog
-
getServerInterceptor
@Nullable protected abstract ServerInterceptor getServerInterceptor(java.lang.String fullMethodName)
Returns aServerInterceptor
for 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>
. Returnsnull
if this method is not binary logged.
-
getClientInterceptor
@Nullable protected abstract ClientInterceptor getClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)
Returns aClientInterceptor
for 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>
. Returnsnull
if this method is not binary logged.
-
close
public void close() throws java.io.IOException
- Throws:
java.io.IOException
-
-