@ExperimentalApi(value="https://github.com/grpc/grpc-java/issues/5066") @NotThreadSafe public final class ServletServerBuilder extends ForwardingServerBuilder<ServletServerBuilder>
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 and Description |
|---|
ServletServerBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Server |
build()
Builds a gRPC server that can run as a servlet.
|
ServletAdapter |
buildServletAdapter()
Creates a
ServletAdapter. |
protected ServerBuilder<?> |
delegate()
Returns the delegated
ServerBuilder. |
ServletServerBuilder |
maxInboundMessageSize(int bytes)
Sets the maximum message size allowed to be received on the server.
|
ServletServerBuilder |
scheduledExecutorService(ScheduledExecutorService scheduler)
Provides a custom scheduled executor service to the server builder.
|
ServletServerBuilder |
useTransportSecurity(File certChain,
File privateKey)
Throws
UnsupportedOperationException. |
addService, addService, addStreamTracerFactory, addTransportFilter, callExecutor, compressorRegistry, decompressorRegistry, directExecutor, executor, fallbackHandlerRegistry, forPort, handshakeTimeout, intercept, keepAliveTime, keepAliveTimeout, maxConnectionAge, maxConnectionAgeGrace, maxConnectionIdle, maxInboundMetadataSize, permitKeepAliveTime, permitKeepAliveWithoutCalls, setBinaryLog, toString, useTransportSecurityaddServicespublic Server build()
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.
build in class ForwardingServerBuilder<ServletServerBuilder>IllegalStateException - if this method is called by users directlypublic ServletAdapter buildServletAdapter()
ServletAdapter.@Internal protected ServerBuilder<?> delegate()
ForwardingServerBuilderServerBuilder.delegate in class ForwardingServerBuilder<ServletServerBuilder>public ServletServerBuilder useTransportSecurity(File certChain, File privateKey)
UnsupportedOperationException. TLS should be configured by the servlet
container.useTransportSecurity in class ForwardingServerBuilder<ServletServerBuilder>certChain - file containing the full certificate chainprivateKey - file containing the private keypublic ServletServerBuilder maxInboundMessageSize(int bytes)
ServerBuilderThis method is advisory, and implementations may decide to not enforce this. Currently,
the only known transport to not enforce this is InProcessServer.
maxInboundMessageSize in class ForwardingServerBuilder<ServletServerBuilder>bytes - the maximum number of bytes a single message can be.public ServletServerBuilder scheduledExecutorService(ScheduledExecutorService scheduler)