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 class
The pipeline of interceptors is hard coded when theManagedChannel
is created.private static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientInterceptor
static final MethodDescriptor.Marshaller
<byte[]> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected abstract ClientInterceptor
getClientInterceptor
(String fullMethodName, CallOptions callOptions) Returns aClientInterceptor
for binary logging.protected abstract ServerInterceptor
getServerInterceptor
(String fullMethodName) Returns aServerInterceptor
for binary logging.private static MethodDescriptor
<byte[], byte[]> toByteBufferMethod
(MethodDescriptor<?, ?> method) final Channel
wrapChannel
(Channel channel) Wraps a channel to provide binary logging onClientCall
s as needed.final <ReqT,
RespT>
ServerMethodDefinition<?, ?> wrapMethodDefinition
(ServerMethodDefinition<ReqT, RespT> oMethodDef) Wraps aServerMethodDefinition
such 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 onClientCall
s as needed.- Specified by:
wrapChannel
in classBinaryLog
-
toByteBufferMethod
-
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
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(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
- Throws:
IOException
-