-
- 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 final MultipartConfig
multipartConfig
public ThreadPool
threadPool
private List<Consumer<Server>>
serverConsumers
private List<Consumer<HttpConfiguration>>
httpConfigurationConfigs
private List<Consumer<ServletContextHandler>>
servletContextHandlerConsumers
private List<Consumer<JettyWebSocketServletFactory>>
wsFactoryConfigs
private List<BiFunction<Server, HttpConfiguration, Connector>>
connectors
-
Constructor Summary
Constructors Constructor Description JettyConfig(JavalinConfig cfg)
-
Method Summary
Modifier and Type Method Description final List<Consumer<Server>>
getServerConsumers()
final Unit
setServerConsumers(List<Consumer<Server>> serverConsumers)
final List<Consumer<HttpConfiguration>>
getHttpConfigurationConfigs()
final Unit
setHttpConfigurationConfigs(List<Consumer<HttpConfiguration>> httpConfigurationConfigs)
final List<Consumer<ServletContextHandler>>
getServletContextHandlerConsumers()
final Unit
setServletContextHandlerConsumers(List<Consumer<ServletContextHandler>> servletContextHandlerConsumers)
final List<Consumer<JettyWebSocketServletFactory>>
getWsFactoryConfigs()
final Unit
setWsFactoryConfigs(List<Consumer<JettyWebSocketServletFactory>> wsFactoryConfigs)
final List<BiFunction<Server, HttpConfiguration, Connector>>
getConnectors()
final Unit
setConnectors(List<BiFunction<Server, HttpConfiguration, Connector>> connectors)
final Unit
modifyServer(Consumer<Server> server)
Configure the jetty Server. final Unit
modifyServletContextHandler(Consumer<ServletContextHandler> consumer)
Configure the jetty ServletContextHandler. final Unit
modifyJettyWebSocketServletFactory(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)
-
-
Method Detail
-
getServerConsumers
final List<Consumer<Server>> getServerConsumers()
-
setServerConsumers
final Unit setServerConsumers(List<Consumer<Server>> serverConsumers)
-
getHttpConfigurationConfigs
final List<Consumer<HttpConfiguration>> getHttpConfigurationConfigs()
-
setHttpConfigurationConfigs
final Unit setHttpConfigurationConfigs(List<Consumer<HttpConfiguration>> httpConfigurationConfigs)
-
getServletContextHandlerConsumers
final List<Consumer<ServletContextHandler>> getServletContextHandlerConsumers()
-
setServletContextHandlerConsumers
final Unit setServletContextHandlerConsumers(List<Consumer<ServletContextHandler>> servletContextHandlerConsumers)
-
getWsFactoryConfigs
final List<Consumer<JettyWebSocketServletFactory>> getWsFactoryConfigs()
-
setWsFactoryConfigs
final Unit setWsFactoryConfigs(List<Consumer<JettyWebSocketServletFactory>> wsFactoryConfigs)
-
getConnectors
final List<BiFunction<Server, HttpConfiguration, Connector>> getConnectors()
-
setConnectors
final Unit setConnectors(List<BiFunction<Server, HttpConfiguration, Connector>> connectors)
-
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.
-
modifyJettyWebSocketServletFactory
final Unit modifyJettyWebSocketServletFactory(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.
-
-
-
-