Package io.grpc

Class ServiceDescriptor


  • public final class ServiceDescriptor
    extends Object
    Descriptor for a service.
    Since:
    1.0.0
    • Constructor Detail

      • ServiceDescriptor

        public ServiceDescriptor​(String name,
                                 MethodDescriptor<?,​?>... methods)
        Constructs a new Service Descriptor. Users are encouraged to use newBuilder(java.lang.String) instead.
        Parameters:
        name - The name of the service
        methods - The methods that are part of the service
        Since:
        1.0.0
      • ServiceDescriptor

        public ServiceDescriptor​(String name,
                                 Collection<MethodDescriptor<?,​?>> methods)
        Constructs a new Service Descriptor. Users are encouraged to use newBuilder(java.lang.String) instead.
        Parameters:
        name - The name of the service
        methods - The methods that are part of the service
        Since:
        1.0.0
    • Method Detail

      • getName

        public String getName()
        Simple name of the service. It is not an absolute path.
        Since:
        1.0.0
      • getSchemaDescriptor

        @Nullable
        @ExperimentalApi("https://github.com/grpc/grpc-java/issues/2222")
        public Object getSchemaDescriptor()
        Returns the schema descriptor for this service. A schema descriptor is an object that is not used by gRPC core but includes information related to the service. The type of the object is specific to the consumer, so both the code setting the schema descriptor and the code calling getSchemaDescriptor() must coordinate. For example, protobuf generated code sets this value, in order to be consumed by the server reflection service. See also: io.grpc.protobuf.ProtoFileDescriptorSupplier.
        Since:
        1.1.0