Package io.grpc.protobuf.services
Class ProtoReflectionServiceV1
- java.lang.Object
-
- io.grpc.reflection.v1.ServerReflectionGrpc.ServerReflectionImplBase
-
- io.grpc.protobuf.services.ProtoReflectionServiceV1
-
- All Implemented Interfaces:
BindableService
,ServerReflectionGrpc.AsyncService
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/2222") public final class ProtoReflectionServiceV1 extends ServerReflectionGrpc.ServerReflectionImplBase
Provides a reflection service for Protobuf services (including the reflection service itself).Separately tracks mutable and immutable services. Throws an exception if either group of services contains multiple Protobuf files with declarations of the same service, method, type, or extension.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
ProtoReflectionServiceV1.FileDescriptorIndex
Provides a set of methods for answering reflection queries for the file descriptors underlying a set of services.private static class
ProtoReflectionServiceV1.ProtoReflectionStreamObserver
private static class
ProtoReflectionServiceV1.ServerReflectionIndex
Indexes the server's services and allows lookups of file descriptors by filename, symbol, type, and extension number.
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object
lock
private java.util.Map<Server,ProtoReflectionServiceV1.ServerReflectionIndex>
serverReflectionIndexes
-
Constructor Summary
Constructors Modifier Constructor Description private
ProtoReflectionServiceV1()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private ProtoReflectionServiceV1.ServerReflectionIndex
getRefreshedIndex()
Retrieves the index for services of the server that dispatches the current call.static BindableService
newInstance()
Creates a instance ofProtoReflectionServiceV1
.StreamObserver<ServerReflectionRequest>
serverReflectionInfo(StreamObserver<ServerReflectionResponse> responseObserver)
The reflection service is structured as a bidirectional stream, ensuring all related requests go to a single server.-
Methods inherited from class io.grpc.reflection.v1.ServerReflectionGrpc.ServerReflectionImplBase
bindService
-
-
-
-
Field Detail
-
lock
private final java.lang.Object lock
-
serverReflectionIndexes
private final java.util.Map<Server,ProtoReflectionServiceV1.ServerReflectionIndex> serverReflectionIndexes
-
-
Method Detail
-
newInstance
public static BindableService newInstance()
Creates a instance ofProtoReflectionServiceV1
.
-
getRefreshedIndex
private ProtoReflectionServiceV1.ServerReflectionIndex getRefreshedIndex()
Retrieves the index for services of the server that dispatches the current call. Computes one if not exist. The index is updated if any changes to the server's mutable services are detected. A change is any addition or removal in the set of file descriptors attached to the mutable services or a change in the service names.
-
serverReflectionInfo
public StreamObserver<ServerReflectionRequest> serverReflectionInfo(StreamObserver<ServerReflectionResponse> responseObserver)
Description copied from interface:ServerReflectionGrpc.AsyncService
The reflection service is structured as a bidirectional stream, ensuring all related requests go to a single server.
-
-