예제 #1
0
 /**
  * Constructs a new {@link GrpcService} that can be bound to {@link
  * com.linecorp.armeria.server.ServerBuilder}. As GRPC services themselves are mounted at a path
  * that corresponds to their protobuf package, you will almost always want to bind to a prefix,
  * e.g. by using {@link com.linecorp.armeria.server.ServerBuilder#serviceUnder(String, Service)}.
  */
 public GrpcService build() {
   return new GrpcService(
       registryBuilder.build(),
       firstNonNull(decompressorRegistry, DecompressorRegistry.getDefaultInstance()),
       firstNonNull(compressorRegistry, CompressorRegistry.getDefaultInstance()));
 }
예제 #2
0
 /**
  * Adds a GRPC {@link ServerServiceDefinition} to this {@link GrpcServiceBuilder}, such as what's
  * returned by {@link BindableService#bindService()}.
  */
 public GrpcServiceBuilder addService(ServerServiceDefinition service) {
   registryBuilder.addService(requireNonNull(service, "service"));
   return this;
 }