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.AtomicLong
counter
private BinlogHelper.Factory
factory
private BinaryLogSink
sink
-
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 void
close()
ClientInterceptor
getClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)
Returns aClientInterceptor
for binary logging.ServerInterceptor
getServerInterceptor(java.lang.String fullMethodName)
Returns aServerInterceptor
for 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:BinaryLogProvider
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.- Specified by:
getServerInterceptor
in classBinaryLogProvider
-
getClientInterceptor
@Nullable public ClientInterceptor getClientInterceptor(java.lang.String fullMethodName, CallOptions callOptions)
Description copied from class:BinaryLogProvider
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.- Specified by:
getClientInterceptor
in classBinaryLogProvider
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Overrides:
close
in classBinaryLogProvider
- Throws:
java.io.IOException
-
-