Package io.grpc.protobuf.services
Class BinaryLogProviderImpl
- java.lang.Object
-
- io.grpc.BinaryLog
-
- io.grpc.protobuf.services.BinaryLogProvider
-
- io.grpc.protobuf.services.BinaryLogProviderImpl
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
class BinaryLogProviderImpl extends BinaryLogProvider
The default implementation of aBinaryLogProvider.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.atomic.AtomicLongcounterprivate BinlogHelper.Factoryfactoryprivate BinaryLogSinksink-
Fields inherited from class io.grpc.protobuf.services.BinaryLogProvider
BYTEARRAY_MARSHALLER
-
-
Constructor Summary
Constructors Constructor Description BinaryLogProviderImpl()BinaryLogProviderImpl(BinaryLogSink sink)Deprecated.BinaryLogProviderImpl(BinaryLogSink sink, java.lang.String configStr)Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ClientInterceptorgetClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)Returns aClientInterceptorfor binary logging.ServerInterceptorgetServerInterceptor(java.lang.String fullMethodName)Returns aServerInterceptorfor binary logging.-
Methods inherited from class io.grpc.protobuf.services.BinaryLogProvider
wrapChannel, wrapMethodDefinition
-
-
-
-
Field Detail
-
counter
private static final java.util.concurrent.atomic.AtomicLong counter
-
factory
private final BinlogHelper.Factory factory
-
sink
private final BinaryLogSink sink
-
-
Constructor Detail
-
BinaryLogProviderImpl
public BinaryLogProviderImpl() throws java.io.IOException- Throws:
java.io.IOException
-
BinaryLogProviderImpl
@Deprecated public BinaryLogProviderImpl(BinaryLogSink sink) throws java.io.IOException
Deprecated.Deprecated and will be removed in a future version of gRPC.- Throws:
java.io.IOException
-
BinaryLogProviderImpl
public BinaryLogProviderImpl(BinaryLogSink sink, java.lang.String configStr) throws java.io.IOException
Creates an instance.- Parameters:
sink- ownership is transferred to this class.configStr- config string to parse to determine logged methods and msg size limits.- Throws:
java.io.IOException- if initialization failed.
-
-
Method Detail
-
getServerInterceptor
@Nullable public ServerInterceptor getServerInterceptor(java.lang.String fullMethodName)
Description copied from class:BinaryLogProviderReturns 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.- Specified by:
getServerInterceptorin classBinaryLogProvider
-
getClientInterceptor
@Nullable public ClientInterceptor getClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)
Description copied from class:BinaryLogProviderReturns 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.- Specified by:
getClientInterceptorin classBinaryLogProvider
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classBinaryLogProvider- Throws:
java.io.IOException
-
-