use of org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactory 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;
}
Aggregations