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.Builder
addNamedRouting(String name, Routing routing)
Associates a dedicated routing with an additional server socket configuration.WebServer.Builder
addNamedRouting(String name, Supplier<Routing> routingBuilder)
Associates a dedicated routing with an additional server socket configuration.WebServer
build()
Builds theWebServer
instance as configured by this builder and its parameters.WebServer.Builder
config(ServerConfiguration configuration)
Set a configuration of theWebServer
.WebServer.Builder
config(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, aIllegalStateException
is 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, aIllegalStateException
is 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 theWebServer
instance as configured by this builder and its parameters.- Specified by:
build
in interfaceBuilder<WebServer>
- Returns:
- a ready to use
WebServer
- Throws:
IllegalStateException
- if there are unpaired named routings (as described ataddNamedRouting(String, Routing)
)
-
-