use of org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory in project scoold by Erudika.
the class ScooldServer method jettyConfigBean.
/**
* @return Jetty config bean
*/
@Bean
public EmbeddedServletContainerFactory jettyConfigBean() {
JettyEmbeddedServletContainerFactory jef = new JettyEmbeddedServletContainerFactory();
jef.setPort(getServerPort());
logger.info("Listening on port {}...", jef.getPort());
return jef;
}
use of org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory in project PublicCMS-preview by sanluan.
the class SprintBootApplication method servletContainer.
/**
* @return servlet container
*/
@Bean
public EmbeddedServletContainerFactory servletContainer() {
String server = System.getProperty("cms.server");
AbstractEmbeddedServletContainerFactory factory = null;
if ("jetty".equalsIgnoreCase(server)) {
factory = new JettyEmbeddedServletContainerFactory();
} else if ("undertow".equalsIgnoreCase(server)) {
factory = new UndertowEmbeddedServletContainerFactory();
} else {
factory = new TomcatEmbeddedServletContainerFactory();
}
factory.setPort(Integer.valueOf(System.getProperty("cms.port", "8080")));
factory.setContextPath(System.getProperty("cms.contextPath", ""));
factory.setDisplayName("PublicCMS");
factory.setSessionTimeout(20, TimeUnit.MINUTES);
return factory;
}
use of org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory in project nakadi by zalando.
the class JettyConfig method jettyEmbeddedServletContainerFactory.
@Bean
public JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory(@Value("${server.port:8080}") final String port, @Value("${jetty.threadPool.maxThreads:200}") final String maxThreads, @Value("${jetty.threadPool.minThreads:8}") final String minThreads, @Value("${jetty.threadPool.idleTimeout:60000}") final String idleTimeout) {
final JettyEmbeddedServletContainerFactory factory = new JettyEmbeddedServletContainerFactory(Integer.valueOf(port));
factory.addServerCustomizers((JettyServerCustomizer) server -> {
final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class);
threadPool.setMaxThreads(Integer.valueOf(maxThreads));
threadPool.setMinThreads(Integer.valueOf(minThreads));
threadPool.setIdleTimeout(Integer.valueOf(idleTimeout));
final GzipHandler gzipHandler = new GzipHandler();
gzipHandler.setHandler(server.getHandler());
gzipHandler.setSyncFlush(true);
server.setHandler(gzipHandler);
});
return factory;
}
Aggregations