Class ServletServerBuilder


  • @ExperimentalApi("https://github.com/grpc/grpc-java/issues/5066")
    @NotThreadSafe
    public final class ServletServerBuilder
    extends io.grpc.ForwardingServerBuilder<ServletServerBuilder>
    Builder to build a gRPC server that can run as a servlet. This is for advanced custom settings. Normally, users should consider extending the out-of-box GrpcServlet directly instead.

    The API is experimental. The authors would like to know more about the real usecases. Users are welcome to provide feedback by commenting on the tracking issue.

    • Constructor Detail

      • ServletServerBuilder

        public ServletServerBuilder()
    • Method Detail

      • build

        public io.grpc.Server build()
        Builds a gRPC server that can run as a servlet.

        The returned server will not be started or bound to a port.

        Users should not call this method directly. Instead users should call buildServletAdapter() which internally will call build() and start() appropriately.

        Overrides:
        build in class io.grpc.ForwardingServerBuilder<ServletServerBuilder>
        Throws:
        IllegalStateException - if this method is called by users directly
      • delegate

        @Internal
        protected io.grpc.ServerBuilder<?> delegate()
        Specified by:
        delegate in class io.grpc.ForwardingServerBuilder<ServletServerBuilder>
      • useTransportSecurity

        public ServletServerBuilder useTransportSecurity​(File certChain,
                                                         File privateKey)
        Throws UnsupportedOperationException. TLS should be configured by the servlet container.
        Overrides:
        useTransportSecurity in class io.grpc.ForwardingServerBuilder<ServletServerBuilder>