Search in sources :

Example 1 with AbstractEmbeddedServletContainerFactory

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;
}
Also used : AbstractEmbeddedServletContainerFactory(org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactory) UndertowEmbeddedServletContainerFactory(org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory) JettyEmbeddedServletContainerFactory(org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory) TomcatEmbeddedServletContainerFactory(org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory) Bean(org.springframework.context.annotation.Bean)

Aggregations

AbstractEmbeddedServletContainerFactory (org.springframework.boot.context.embedded.AbstractEmbeddedServletContainerFactory)1 JettyEmbeddedServletContainerFactory (org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainerFactory)1 TomcatEmbeddedServletContainerFactory (org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainerFactory)1 UndertowEmbeddedServletContainerFactory (org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory)1 Bean (org.springframework.context.annotation.Bean)1