Package io.helidon.webserver
Class WebServer.Builder
- java.lang.Object
-
- io.helidon.webserver.WebServer.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebServer.BuilderaddNamedRouting(String name, Routing routing)Associates a dedicated routing with an additional server socket configuration.WebServer.BuilderaddNamedRouting(String name, Supplier<Routing> routingBuilder)Associates a dedicated routing with an additional server socket configuration.WebServerbuild()Builds theWebServerinstance as configured by this builder and its parameters.WebServer.Builderconfig(ServerConfiguration configuration)Set a configuration of theWebServer.WebServer.Builderconfig(Supplier<ServerConfiguration> configurationBuilder)Set a configuration of theWebServer.
-
-
-
Method Detail
-
config
public WebServer.Builder config(ServerConfiguration configuration)
Set a configuration of theWebServer.- Parameters:
configuration- the configuration- Returns:
- an updated builder
-
config
public WebServer.Builder config(Supplier<ServerConfiguration> configurationBuilder)
Set a configuration of theWebServer.- Parameters:
configurationBuilder- the configuration builder- Returns:
- an updated builder
-
addNamedRouting
public WebServer.Builder addNamedRouting(String name, Routing routing)
Associates a dedicated routing with an additional server socket configuration.The additional server socket configuration must be set as per
ServerConfiguration.Builder.addSocket(String, SocketConfiguration). If there is no such named server socket configuration, aIllegalStateExceptionis thrown by thebuild()method.- Parameters:
name- the named server socket configuration to associate the provided routing withrouting- the routing to associate with the provided name of a named server socket configuration- Returns:
- an updated builder
-
addNamedRouting
public WebServer.Builder addNamedRouting(String name, Supplier<Routing> routingBuilder)
Associates a dedicated routing with an additional server socket configuration.The additional server socket configuration must be set as per
ServerConfiguration.Builder.addSocket(String, SocketConfiguration). If there is no such named server socket configuration, aIllegalStateExceptionis thrown by thebuild()method.- Parameters:
name- the named server socket configuration to associate the provided routing withroutingBuilder- the routing builder to associate with the provided name of a named server socket configuration; will be built as a first step of this method execution- Returns:
- an updated builder
-
build
public WebServer build()
Builds theWebServerinstance as configured by this builder and its parameters.- Specified by:
buildin interfaceBuilder<WebServer>- Returns:
- a ready to use
WebServer - Throws:
IllegalStateException- if there are unpaired named routings (as described ataddNamedRouting(String, Routing))
-
-