-
- All Implemented Interfaces:
public final class JettyConfig
Configures the embedded Jetty webserver.
-
-
Field Summary
Fields Modifier and Type Field Description public String
defaultHost
public Integer
defaultPort
public MultipartConfig
multipartConfig
public ThreadPool
threadPool
-
Constructor Summary
Constructors Constructor Description JettyConfig(JavalinConfig cfg)
-
Method Summary
Modifier and Type Method Description final Unit
modifyServer(Consumer<Server> server)
Configure the jetty Server. final Unit
modifyServletContextHandler(Consumer<ServletContextHandler> consumer)
Configure the jetty ServletContextHandler. final Unit
modifyWebSocketServletFactory(Consumer<JettyWebSocketServletFactory> wsFactoryConfig)
Configure the jetty JettyWebSocketServletFactory. final Unit
modifyHttpConfiguration(Consumer<HttpConfiguration> httpConfigurationConfig)
Configure the HttpConfiguration to be used by the jetty Server. final Unit
addConnector(BiFunction<Server, HttpConfiguration, Connector> connector)
Add a Connector to the jetty Server. -
-
Constructor Detail
-
JettyConfig
JettyConfig(JavalinConfig cfg)
- Parameters:
cfg
- the parent Javalin Configuration
-
-
Method Detail
-
modifyServer
final Unit modifyServer(Consumer<Server> server)
Configure the jetty Server. This is useful if you want to configure Jetty features that are not exposed by Javalin. Consider using the other methods in this class before resorting to this one. It can be called multiple times, and the supplied consumers will be called in order.
-
modifyServletContextHandler
final Unit modifyServletContextHandler(Consumer<ServletContextHandler> consumer)
Configure the jetty ServletContextHandler. The SessionHandler can be set here. It can be called multiple times, and the supplied consumers will be called in order.
-
modifyWebSocketServletFactory
final Unit modifyWebSocketServletFactory(Consumer<JettyWebSocketServletFactory> wsFactoryConfig)
Configure the jetty JettyWebSocketServletFactory. It can be called multiple times, and the supplied consumers will be called in order.
-
modifyHttpConfiguration
final Unit modifyHttpConfiguration(Consumer<HttpConfiguration> httpConfigurationConfig)
Configure the HttpConfiguration to be used by the jetty Server. It can be called multiple times, and the supplied consumers will be called in order.
-
addConnector
final Unit addConnector(BiFunction<Server, HttpConfiguration, Connector> connector)
Add a Connector to the jetty Server. It can be called multiple times, and the supplied connectors will be added in order.
-
-
-
-