Interface WebServerConfig
- All Superinterfaces:
ListenerConfig, Prototype.Api, Prototype.Factory<WebServer>
- All Known Implementing Classes:
WebServerConfig.BuilderBase.WebServerConfigImpl
WebServer configuration bean.
See
WebServer.create(java.util.function.Consumer).- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classFluent API builder forWebServer.static classWebServerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER, PROTOTYPE>, PROTOTYPE extends WebServerConfig>Fluent API builder base forWebServerConfig. -
Method Summary
Modifier and TypeMethodDescriptionstatic WebServerConfig.Builderbuilder()Create a new fluent API builder to customize configuration.static WebServerConfig.Builderbuilder(WebServerConfig instance) Create a new fluent API builder from an existing instance.static WebServerConfigcreate()Create a new instance with default values.static WebServerConfigCreate a new instance from configuration.features()Server features allow customization of the server, listeners, or routings.Routing for additional sockets.Context for the WebServer, if none defined, a new one will be created with global context as the root.booleanWhen true the webserver registers a shutdown hook with the JVM Runtime.sockets()Socket configurations.Methods inherited from interface ListenerConfig
address, backlog, bindAddress, bindings, concurrencyLimit, configureSocket, configureSocket, connectionOptions, connectionSelectorProviders, connectionSelectors, contentEncoding, directHandlers, enableProxyProtocol, errorHandling, host, idleConnectionPeriod, idleConnectionTimeout, ignoreInvalidNamedRouting, listenerContext, listenerSocketOptions, maxConcurrentRequests, maxConnections, maxInMemoryEntity, maxPayloadSize, maxTcpConnections, mediaContext, name, port, protocols, proxyProtocol, requestedUriDiscoveryContext, restoreResponseHeaders, routing, routings, shutdownGracePeriod, smartAsyncWrites, sni, tls, useNio, virtualHosts, writeBufferSize, writeQueueLengthModifier and TypeMethodDescriptionaddress()Address to use.intbacklog()Accept backlog.The TCP address to bind to (<host>:<port>); Unix domain addresses are rejected and must instead usebindings.uds.socket.default List<TransportBindingFactory> bindings()Transport bindings that serve this listener are configured as one object keyed by binding type; list form and nestednameortypeare invalid, and built-in TCP remains enabled unlessbindings.tcp.enabled=false.Concurrency limit to use to limit concurrent execution of incoming requests.default voidconfigureSocket(ServerSocket socket) Update the server socket with configured socket options.default voidconfigureSocket(ServerSocketChannel socket) Update the server socket with configured socket options.Options for connections accepted by this listener.Providers of connection selectors discovered for this listener.Explicitly defined connection selectors to be used with this socket.Configure the listener specificContentEncodingContext.Direct handlers specific for this listener.booleanDeprecated, for removal: This API element is subject to removal in a future version.Configuration for this listener's error handling.host()Host of the default socket.How often should we check forListenerConfig.idleConnectionTimeout().How long should we wait before closing a connection that has no traffic on it.booleanIf set totrue, any named routing configured that does not have an associated named listener will NOT cause an exception to be thrown (default behavior is to throw an exception).Listener scoped context to be used as a parent for webserver request contexts (if used).Map<SocketOption<?>, Object> Server listener socket options.intLimits the number of requests that can be executed at the same time (the number of active virtual threads of requests).intLimits listener-wide connection admission shared by all connection-oriented bindings.intIf the entity is expected to be smaller that this number of bytes, it would be buffered in memory to optimize performance when writing it.longMaximal number of bytes an entity may have.intDeprecated, for removal: This API element is subject to removal in a future version.This option is deprecated, useListenerConfig.maxConnections()insteadConfigure the listener specificMediaContext.name()Name of this socket.intport()Port of the default socket.Configuration of protocols.default Optional<ProxyProtocolConfig> PROXY protocol configuration.Requested URI discovery context.booleanCopy and restore response headers before and after passing a request to Jersey for processing.routing()Http routing.routings()List of all routings (possibly for multiple protocols).Grace period in ISO 8601 duration format to allow running tasks to complete before listener's shutdown.booleanIf enabled andListenerConfig.writeQueueLength()is greater than 1, then start with async writes but possibly switch to sync writes if async queue size is always below a certain threshold.sni()Listener-scoped server TLS SNI policy.tls()Listener TLS configuration.booleanuseNio()Whether to use an NIO socket channel instead of a socket; Unix domain socket bindings always use NIO and ignore this setting, while listener TLS virtual hosts require it to betrue.Listener TLS virtual hosts selected by SNI; requires listener TLS and NIO socket-channel transport (use-nio=true).intInitial buffer size in bytes ofBufferedOutputStreamcreated internally to write data to a socket connection.intNumber of buffers queued for write operations.Methods inherited from interface Prototype.Factory
build
-
Method Details
-
builder
Create a new fluent API builder to customize configuration.- Returns:
- a new builder
-
builder
Create a new fluent API builder from an existing instance.- Parameters:
instance- an existing instance used as a base for the builder- Returns:
- a builder based on an instance
-
create
Create a new instance from configuration.- Parameters:
config- used to configure the new instance- Returns:
- a new instance configured from configuration
-
create
-
shutdownHook
boolean shutdownHook()When true the webserver registers a shutdown hook with the JVM Runtime.Defaults to true. Set this to false such that a shutdown hook is not registered.
- Returns:
- whether to register a shutdown hook
-
sockets
Map<String, ListenerConfig> sockets()Socket configurations. Note that socket named "@default" cannot be used, configure the values on the server directly.- Returns:
- map of listener configurations, except for the default one
-
namedRoutings
-
features
List<ServerFeature> features()Server features allow customization of the server, listeners, or routings.- Returns:
- server features
-
serverContext
-
ListenerConfig.proxyProtocol()instead