Package io.grpc.servlet
Class ServletServerBuilder
- java.lang.Object
-
- io.grpc.ServerBuilder<T>
-
- io.grpc.ForwardingServerBuilder<ServletServerBuilder>
-
- io.grpc.servlet.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-boxGrpcServletdirectly 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 Summary
Constructors Constructor Description ServletServerBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.grpc.Serverbuild()Builds a gRPC server that can run as a servlet.ServletAdapterbuildServletAdapter()Creates aServletAdapter.protected io.grpc.ServerBuilder<?>delegate()ServletServerBuildermaxInboundMessageSize(int bytes)ServletServerBuilderscheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduler)Provides a custom scheduled executor service to the server builder.ServletServerBuilderuseTransportSecurity(java.io.File certChain, java.io.File privateKey)ThrowsUnsupportedOperationException.-
Methods inherited from class io.grpc.ForwardingServerBuilder
addService, addService, addStreamTracerFactory, addTransportFilter, callExecutor, compressorRegistry, decompressorRegistry, directExecutor, executor, fallbackHandlerRegistry, forPort, handshakeTimeout, intercept, keepAliveTime, keepAliveTimeout, maxConnectionAge, maxConnectionAgeGrace, maxConnectionIdle, maxInboundMetadataSize, permitKeepAliveTime, permitKeepAliveWithoutCalls, setBinaryLog, toString, useTransportSecurity
-
-
-
-
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 callbuild()andstart()appropriately.- Overrides:
buildin classio.grpc.ForwardingServerBuilder<ServletServerBuilder>- Throws:
java.lang.IllegalStateException- if this method is called by users directly
-
buildServletAdapter
public ServletAdapter buildServletAdapter()
Creates aServletAdapter.
-
delegate
@Internal protected io.grpc.ServerBuilder<?> delegate()
- Specified by:
delegatein classio.grpc.ForwardingServerBuilder<ServletServerBuilder>
-
useTransportSecurity
public ServletServerBuilder useTransportSecurity(java.io.File certChain, java.io.File privateKey)
ThrowsUnsupportedOperationException. TLS should be configured by the servlet container.- Overrides:
useTransportSecurityin classio.grpc.ForwardingServerBuilder<ServletServerBuilder>
-
maxInboundMessageSize
public ServletServerBuilder maxInboundMessageSize(int bytes)
- Overrides:
maxInboundMessageSizein classio.grpc.ForwardingServerBuilder<ServletServerBuilder>
-
scheduledExecutorService
public ServletServerBuilder scheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduler)
Provides a custom scheduled executor service to the server builder.- Returns:
- this
-
-