Interface ServiceBuilder


public interface ServiceBuilder
A builder for creating and configuring a Service. This interface allows you to bind service methods to their respective handlers, which define how requests to those methods are processed.
  • Method Summary

    Modifier and Type
    Method
    Description
    <Req,Resp> ServiceBuilder
    bind(ServiceMethod<Req,Resp> serviceMethod, Handler<GrpcServerRequest<Req,Resp>> handler)
    Bind a service method call handler that handles any call made to the server for the fullMethodName method.
    Constructs and returns a Service instance based on the current configuration of the builder.
  • Method Details

    • bind

      <Req,Resp> ServiceBuilder bind(ServiceMethod<Req,Resp> serviceMethod, Handler<GrpcServerRequest<Req,Resp>> handler)
      Bind a service method call handler that handles any call made to the server for the fullMethodName method.
      Parameters:
      serviceMethod - the service method
      handler - the service method call handler
      Returns:
      a reference to this, so the API can be used fluently
    • build

      Service build()
      Constructs and returns a Service instance based on the current configuration of the builder.
      Returns:
      a configured Service instance