Module io.helidon.webserver
Package io.helidon.webserver
Class WebServerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends WebServerConfig>
java.lang.Object
io.helidon.webserver.ListenerConfig.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.webserver.WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,,PROTOTYPE> ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
WebServerConfig.Builder
- Enclosing interface:
WebServerConfig
public abstract static class WebServerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends WebServerConfig>
extends ListenerConfig.BuilderBase<BUILDER,PROTOTYPE>
implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
WebServerConfig.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class io.helidon.webserver.ListenerConfig.BuilderBase
ListenerConfig.BuilderBase.ListenerConfigImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddFeature(ServerFeature feature) Server features allow customization of the server, listeners, or routings.addFeatures(List<? extends ServerFeature> features) Server features allow customization of the server, listeners, or routings.addSockets(Map<String, ? extends ListenerConfig> sockets) Socket configurations.Clear all features.Clear existing value of serverContext.booleanService discovery flag forListenerConfig.BuilderBase.concurrencyLimit().concurrencyLimitDiscoverServices(boolean concurrencyLimitDiscoverServices) Service discovery flag forListenerConfig.BuilderBase.concurrencyLimit().Deprecated.Update builder from configuration (node of this type).features()Server features allow customization of the server, listeners, or routings.features(List<? extends ServerFeature> features) Server features allow customization of the server, listeners, or routings.booleanService discovery flag forfeatures().featuresDiscoverServices(boolean featuresDiscoverServices) Service discovery flag forfeatures().from(WebServerConfig prototype) Update this builder from an existing prototype instance.from(WebServerConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.protected voidHandles providers and decorators.booleanService discovery flag forListenerConfig.BuilderBase.protocols().protocolsDiscoverServices(boolean protocolsDiscoverServices) Service discovery flag forListenerConfig.BuilderBase.protocols().putSocket(String key, ListenerConfig socket) Socket configurations.putSocket(String key, Consumer<ListenerConfig.Builder> consumer) Socket configurations.routing(String socket, HttpRouting.Builder routing) Add Http routing for an additional socket.routing(String socket, Consumer<HttpRouting.Builder> consumer) Add Http routing for an additional socket.Context for the WebServer, if none defined, a new one will be created with global context as the root.serverContext(Context serverContext) Context for the WebServer, if none defined, a new one will be created with global context as the root.serverContext(Consumer<Context.Builder> consumer) Context for the WebServer, if none defined, a new one will be created with global context as the root.serverContext(Supplier<? extends Context> supplier) 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.shutdownHook(boolean shutdownHook) When true the webserver registers a shutdown hook with the JVM Runtime.sockets()Socket configurations.sockets(Map<String, ? extends ListenerConfig> sockets) Socket configurations.toString()protected voidValidates required properties.Methods inherited from class io.helidon.webserver.ListenerConfig.BuilderBase
addConnectionSelector, addConnectionSelectors, addListenerSocketOptions, addProtocol, addProtocols, address, address, addRouting, addRoutings, backlog, backlog, bindAddress, bindAddress, clearBindAddress, clearConcurrencyLimit, clearConnectionConfig, clearConnectionSelectors, clearContentEncoding, clearDirectHandlers, clearListenerContext, clearMediaContext, clearProtocols, clearReceiveBufferSize, clearRequestedUriDiscoveryContext, clearRouting, clearRoutings, clearTls, concurrencyLimit, concurrencyLimit, config, connectionConfig, connectionConfig, connectionConfig, connectionConfig, connectionOptions, connectionOptions, connectionOptions, connectionOptions, connectionSelectors, connectionSelectors, contentEncoding, contentEncoding, contentEncoding, contentEncoding, contentEncoding, directHandlers, directHandlers, directHandlers, directHandlers, enableProxyProtocol, enableProxyProtocol, errorHandling, errorHandling, errorHandling, errorHandling, from, from, host, host, idleConnectionPeriod, idleConnectionPeriod, idleConnectionTimeout, idleConnectionTimeout, ignoreInvalidNamedRouting, ignoreInvalidNamedRouting, listenerContext, listenerContext, listenerContext, listenerContext, listenerSocketOptions, listenerSocketOptions, maxConcurrentRequests, maxConcurrentRequests, maxInMemoryEntity, maxInMemoryEntity, maxPayloadSize, maxPayloadSize, maxTcpConnections, maxTcpConnections, mediaContext, mediaContext, mediaContext, mediaContext, mediaContext, name, name, port, port, protocols, protocols, putListenerSocketOption, receiveBufferSize, receiveBufferSize, requestedUriDiscoveryContext, requestedUriDiscoveryContext, requestedUriDiscoveryContext, requestedUriDiscoveryContext, restoreResponseHeaders, restoreResponseHeaders, routing, routing, routing, routings, routings, shutdownGracePeriod, shutdownGracePeriod, smartAsyncWrites, smartAsyncWrites, tls, tls, tls, tls, tls, useNio, useNio, writeBufferSize, writeBufferSize, writeQueueLength, writeQueueLengthMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance. This method disables automatic service discovery.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
routing
Add Http routing for an additional socket.- Parameters:
socket- name of the socketconsumer- HTTP Routing for the given socket name- Returns:
- updated builder instance
-
routing
Add Http routing for an additional socket.- Parameters:
socket- name of the socketrouting- HTTP Routing for the given socket name- Returns:
- updated builder instance
-
config
Deprecated.Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Overrides:
configin classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfaceConfigBuilderSupport.ConfiguredBuilder<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Overrides:
configin classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
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.
- Parameters:
shutdownHook- whether to register a shutdown hook- Returns:
- updated builder instance
- See Also:
-
sockets
Socket configurations. Note that socket named "@default" cannot be used, configure the values on the server directly. This method replaces all values with the new ones.- Parameters:
sockets- map of listener configurations, except for the default one- Returns:
- updated builder instance
- See Also:
-
addSockets
Socket configurations. Note that socket named "@default" cannot be used, configure the values on the server directly. This method keeps existing values, then puts all new values into the map.- Parameters:
sockets- map of listener configurations, except for the default one- Returns:
- updated builder instance
- See Also:
-
putSocket
Socket configurations. Note that socket named "@default" cannot be used, configure the values on the server directly. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key- key to add or replacesocket- new value for the key- Returns:
- updated builder instance
- See Also:
-
putSocket
Socket configurations. Note that socket named "@default" cannot be used, configure the values on the server directly. This method adds a new value to the map, or replaces it if the key already exists.- Parameters:
key- key to add or replaceconsumer- consumer of builder for new value- Returns:
- updated builder instance
- See Also:
-
clearFeatures
Clear all features.- Returns:
- updated builder instance
- See Also:
-
features
Server features allow customization of the server, listeners, or routings.- Parameters:
features- server features- Returns:
- updated builder instance
- See Also:
-
addFeatures
Server features allow customization of the server, listeners, or routings.- Parameters:
features- server features- Returns:
- updated builder instance
- See Also:
-
addFeature
Server features allow customization of the server, listeners, or routings.- Parameters:
feature- add single server features- Returns:
- updated builder instance
- See Also:
-
clearServerContext
Clear existing value of serverContext.- Returns:
- updated builder instance
- See Also:
-
serverContext
Context for the WebServer, if none defined, a new one will be created with global context as the root.- Parameters:
serverContext- server context- Returns:
- updated builder instance
- See Also:
-
serverContext
Context for the WebServer, if none defined, a new one will be created with global context as the root.- Parameters:
consumer- consumer of builder of server context- Returns:
- updated builder instance
- See Also:
-
serverContext
Context for the WebServer, if none defined, a new one will be created with global context as the root.- Parameters:
supplier- supplier of server context- Returns:
- updated builder instance
- See Also:
-
featuresDiscoverServices
Service discovery flag forfeatures(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Parameters:
featuresDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
protocolsDiscoverServices
Service discovery flag forListenerConfig.BuilderBase.protocols(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Overrides:
protocolsDiscoverServicesin classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Parameters:
protocolsDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
concurrencyLimitDiscoverServices
Service discovery flag forListenerConfig.BuilderBase.concurrencyLimit(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Overrides:
concurrencyLimitDiscoverServicesin classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Parameters:
concurrencyLimitDiscoverServices- whether to enable automatic service discovery- Returns:
- updated builder instance
- See Also:
-
shutdownHook
public 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
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
-
features
Server features allow customization of the server, listeners, or routings.- Returns:
- server features
-
serverContext
Context for the WebServer, if none defined, a new one will be created with global context as the root.- Returns:
- server context
-
featuresDiscoverServices
public boolean featuresDiscoverServices()Service discovery flag forfeatures(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Returns:
- whether to enable automatic service discovery
-
protocolsDiscoverServices
public boolean protocolsDiscoverServices()Service discovery flag forListenerConfig.BuilderBase.protocols(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Overrides:
protocolsDiscoverServicesin classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Returns:
- whether to enable automatic service discovery
-
concurrencyLimitDiscoverServices
public boolean concurrencyLimitDiscoverServices()Service discovery flag forListenerConfig.BuilderBase.concurrencyLimit(). If set totrue, services will be discovered from Java service loader, or Helidon ServiceRegistry.- Overrides:
concurrencyLimitDiscoverServicesin classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig> - Returns:
- whether to enable automatic service discovery
-
toString
- Overrides:
toStringin classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classListenerConfig.BuilderBase<BUILDER extends WebServerConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends WebServerConfig>
-
config(io.helidon.config.Config)