Java 类org.springframework.boot.context.embedded.EmbeddedServletContainerFactory 实例源码

项目:mxhsd    文件:MxhsdFederationApp.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();

    tomcat.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> {
        connector.setScheme("https");
        connector.setPort(cfg.getPort());
        Http11NioProtocol protocol = (Http11NioProtocol) connector.getProtocolHandler();
        protocol.setSSLEnabled(true);
        protocol.setSSLCertificateKeyFile(cfg.getKey());
        protocol.setSSLCertificateFile(cfg.getCert());
        cfg.getChain().ifPresent(protocol::setSSLCertificateChainFile);
    });

    return tomcat;
}
项目:hungrydragon    文件:TomcatConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };

    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
项目:MicroServiceDemo    文件:WebMvcConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };

    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
项目:smarti    文件:TomcatConfiguration.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {

    final TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
    if (isEnabled()) {
        final Connector ajpConnector = new Connector(getProtocol());
        ajpConnector.setPort(getPort());
        ajpConnector.setSecure(isSecure());
        ajpConnector.setAllowTrace(isAllowTrace());
        ajpConnector.setScheme(getScheme());

        tomcat.addAdditionalTomcatConnectors(ajpConnector);
    }

    return tomcat;
}
项目:tip    文件:TomcatWebConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer(SslProperties properties) {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };
    tomcat.addAdditionalTomcatConnectors(createSslConnector(properties));
    return tomcat;
}
项目:jetty-server-request-logger    文件:JettyServerCustomizer.java   
@Bean
public EmbeddedServletContainerFactory jettyConfigBean() {

    DynamicPropertyFactory propertyFactory = DynamicPropertyFactory.getInstance();
    String accessLogFilePath = propertyFactory.getStringProperty("server.accessLog.config.file", ACCESS_LOG_FILE_PATH).getValue();

    JettyEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory
            = new JettyEmbeddedServletContainerFactory();
    jettyEmbeddedServletContainerFactory.addServerCustomizers(new org.springframework.boot.context.embedded.jetty.JettyServerCustomizer() {
        public void customize(Server server) {
            HandlerCollection handlers = new HandlerCollection();
            for (Handler handler : server.getHandlers()) {
                handlers.addHandler(handler);
            }
            RequestLogHandler requestLogHandler = new RequestLogHandler();
            RequestLogImpl requestLogImpl = new RequestLogImpl();
            requestLogImpl.setFileName(accessLogFilePath);
            requestLogHandler.setRequestLog(requestLogImpl);
            handlers.addHandler(requestLogHandler);
            server.setHandler(handlers);
            LOGGER.info("Jetty Server Customized. Access Log Configuration File - {}", accessLogFilePath);
        }
    });
    return jettyEmbeddedServletContainerFactory;
}
项目:interview-preparation    文件:DispatchServletConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    final TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory();
    // tomcatFactory.setAddress(InetAddress.getLocalHost());// you can restrict localhost access
    tomcatFactory.setPort(8080);
    // ServletContainerInitializer

    final Connector connector = new Connector();
    connector.setPort(8443);
    connector.setSecure(true);
    connector.setScheme("https");
    connector.setProperty("SSLEnabled", "true");
    connector.setProperty("keystorePass", "spring");
    try {
        final ClassPathResource classPathResource = new ClassPathResource("keystore");
        System.err.println(classPathResource.getFile().getAbsolutePath());
        connector.setProperty("keystoreFile", classPathResource.getFile().getAbsolutePath());
    } catch (final Exception e) {
        System.err.println("Error while loading classpath resource " + e.getMessage());
    }

    tomcatFactory.addAdditionalTomcatConnectors(connector);
    return tomcatFactory;
}
项目:springsecuredthymeleafapp    文件:WebConfiguration.java   
/**
 * <p>servletContainer.</p>
 *
 * @return a {@link org.springframework.boot.context.embedded.EmbeddedServletContainerFactory} object.
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };

    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcAutoConfigurationTests.java   
@Test
public void onDifferentPortWithSpecificContainer() throws Exception {
    this.applicationContext.register(SpecificContainerConfig.class, RootConfig.class,
            DifferentPortConfig.class, EndpointConfig.class, BaseConfiguration.class,
            EndpointWebMvcAutoConfiguration.class, ErrorMvcAutoConfiguration.class);
    this.applicationContext.refresh();
    assertContent("/controller", ports.get().server, "controlleroutput");
    assertContent("/endpoint", ports.get().server, null);
    assertContent("/controller", ports.get().management, null);
    assertContent("/endpoint", ports.get().management, "endpointoutput");
    assertContent("/error", ports.get().management, startsWith("{"));
    ApplicationContext managementContext = this.applicationContext
            .getBean(ManagementContextResolver.class).getApplicationContext();
    List<?> interceptors = (List<?>) ReflectionTestUtils.getField(
            managementContext.getBean(EndpointHandlerMapping.class), "interceptors");
    assertThat(interceptors).hasSize(1);
    EmbeddedServletContainerFactory parentContainerFactory = this.applicationContext
            .getBean(EmbeddedServletContainerFactory.class);
    EmbeddedServletContainerFactory managementContainerFactory = managementContext
            .getBean(EmbeddedServletContainerFactory.class);
    assertThat(parentContainerFactory)
            .isInstanceOf(SpecificEmbeddedServletContainerFactory.class);
    assertThat(managementContainerFactory)
            .isInstanceOf(SpecificEmbeddedServletContainerFactory.class);
    assertThat(managementContainerFactory).isNotSameAs(parentContainerFactory);
}
项目:edge-server    文件:WebConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };
    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
项目:mdw    文件:SpringBootApplication.java   
/**
 * TODO: support Jetty as well
 */
@Bean
public EmbeddedServletContainerFactory embeddedServletContainerFactory(ApplicationContext ctx) {
    String portProp = System.getProperty("mdw.server.port");
    if (portProp == null)
        portProp = System.getProperty("server.port");
    if (portProp == null)
        portProp = "8080";
    String contextProp = System.getProperty("mdw.server.contextPath");
    if (contextProp == null)
        contextProp = System.getProperty("server.contextPath");
    if (contextProp == null)
        contextProp = "/mdw";
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory(
            contextProp, Integer.parseInt(portProp));
    factory.addContextCustomizers(tomcatContextCustomizer());
    factory.setDocumentRoot(new File(getBootDir() + "/web"));
    return factory;
}
项目:spring-boot-concourse    文件:EndpointWebMvcAutoConfiguration.java   
private void registerEmbeddedServletContainerFactory(
        AnnotationConfigEmbeddedWebApplicationContext childContext) {
    try {
        EmbeddedServletContainerFactory servletContainerFactory = this.applicationContext
                .getBean(EmbeddedServletContainerFactory.class);
        ConfigurableListableBeanFactory beanFactory = childContext.getBeanFactory();
        if (beanFactory instanceof BeanDefinitionRegistry) {
            BeanDefinitionRegistry registry = (BeanDefinitionRegistry) beanFactory;
            registry.registerBeanDefinition("embeddedServletContainerFactory",
                    new RootBeanDefinition(servletContainerFactory.getClass()));
        }
    }
    catch (NoSuchBeanDefinitionException ex) {
        // Ignore and assume auto-configuration
    }
}
项目:NFVO    文件:SystemConfiguration.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
  if (https) {
    TomcatEmbeddedServletContainerFactory tomcat =
        new TomcatEmbeddedServletContainerFactory() {
          @Override
          protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
          }
        };

    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
  }
  return new TomcatEmbeddedServletContainerFactory();
}
项目:springBoot-JHipster-AJP-Port    文件:Application.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {

   Integer ajpPortInt = Integer.parseInt(ajpPort);
   Boolean ajpEnabledBool = Boolean.valueOf(ajpEnabled);    

    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
    if (ajpEnabledBool)
    {
        Connector ajpConnector = new Connector(ajpProtocol);
        ajpConnector.setProtocol(ajpProtocol);
        ajpConnector.setPort(ajpPortInt);
        ajpConnector.setSecure(false);
        ajpConnector.setAllowTrace(false);
        ajpConnector.setScheme(ajpScheme);
        tomcat.addAdditionalTomcatConnectors(ajpConnector);
    }

    return tomcat;
}
项目:jcart    文件:WebConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer()
{
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory()
    {
        @Override
        protected void postProcessContext(Context context)
        {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };

    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
项目:jcart    文件:WebConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint securityConstraint = new SecurityConstraint();
            securityConstraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            securityConstraint.addCollection(collection);
            context.addConstraint(securityConstraint);
        }
    };

    tomcat.addAdditionalTomcatConnectors(initiateHttpConnector());
    return tomcat;
}
项目:find    文件:TomcatConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    final TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();

    if(useReverseProxy) {
        tomcat.addAdditionalTomcatConnectors(createAjpConnector());
    }

    // Set the web resources cache size (this defaults to 10MB but that is too small for Find)
    tomcat.addContextCustomizers(context -> {
        final WebResourceRoot resources = new StandardRoot(context);
        resources.setCacheMaxSize(webResourcesCacheSize);
        context.setResources(resources);
    });

    tomcat.addConnectorCustomizers(connector -> {
        connector.setMaxPostSize(connectorMaxPostSize);
    });

    return tomcat;
}
项目:grassroot-platform    文件:GrassrootWebApplicationConfig.java   
@Bean
@Profile({ "staging", "production", "localpg" })
public EmbeddedServletContainerFactory servletContainer() {

   return new TomcatEmbeddedServletContainerFactory(){
        @Override
        protected void postProcessContext(Context context) {
            if (environment.acceptsProfiles("~staging", "~production")) {
                SecurityConstraint securityConstraint = new SecurityConstraint();
                securityConstraint.setUserConstraint("CONFIDENTIAL");
                SecurityCollection collection = new SecurityCollection();
                collection.addPattern("/*");
                securityConstraint.addCollection(collection);
                context.addConstraint(securityConstraint);
            }
        }
    };

}
项目:odo    文件:HomeController.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() throws Exception {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();

    int apiPort = Utils.getSystemPort(Constants.SYS_API_PORT);
    factory.setPort(apiPort);
    factory.setSessionTimeout(10, TimeUnit.MINUTES);
    factory.setContextPath("/testproxy");
    baseDirectory = new File("./tmp");
    factory.setBaseDirectory(baseDirectory);
    List<TomcatConnectorCustomizer> cs = new ArrayList();
    cs.add(tomcatConnectorCustomizers());
    factory.setTomcatConnectorCustomizers(cs);

    if (Utils.getEnvironmentOptionValue(Constants.SYS_LOGGING_DISABLED) != null) {
        HistoryService.getInstance().disableHistory();
    }
    return factory;
}
项目:odo    文件:TestHttpProxyContainer.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    MockService config = MockService.getInstance();
    factory.setPort(config.getPort());
    factory.setSessionTimeout(10, TimeUnit.MINUTES);
    factory.addContextCustomizers(new TomcatContextCustomizer() {
        @Override
        public void customize(Context context) {
            JarScanner jarScanner = new JarScanner() {
                @Override
                public void scan(ServletContext arg0, ClassLoader arg1,
                                 JarScannerCallback arg2, Set<String> arg3) {
                }
            };
            context.setJarScanner(jarScanner);
        }
    });
    return factory;
}
项目:danyuan-application    文件:App.java   
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            SecurityConstraint constraint = new SecurityConstraint();
            constraint.setUserConstraint("CONFIDENTIAL");
            SecurityCollection collection = new SecurityCollection();
            collection.addPattern("/*");
            constraint.addCollection(collection);
            context.addConstraint(constraint);
        }
    };
    tomcat.addAdditionalTomcatConnectors(httpConnector());
    return tomcat;
}
项目:springboot-shiro-cas-mybatis    文件:CustomizationBean.java   
/**
 * 定制方法二:注入EmbeddedServletContainerFactory
 * @return
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    factory.setPort(8083);
    factory.setSessionTimeout(10, TimeUnit.MINUTES);
    //优先级高于配置在/static/error文件夹里面的404.html页面
    factory.addErrorPages(new ErrorPage(HttpStatus.NOT_FOUND, "/error/403.html"));
    return factory;
}
项目:cas-5.1.0    文件:CasEmbeddedContainerTomcatConfiguration.java   
@ConditionalOnClass(value = {Tomcat.class, Http2Protocol.class})
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    final TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();

    configureAjp(tomcat);
    configureHttp(tomcat);
    configureHttpProxy(tomcat);
    configureExtendedAccessLogValve(tomcat);
    configureRewriteValve(tomcat);
    configureSSLValve(tomcat);

    return tomcat;
}
项目:mxhsd    文件:MxhsdClientApp.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();

    tomcat.addConnectorCustomizers((TomcatConnectorCustomizer) connector -> {
        connector.setScheme("http");
        connector.setPort(cfg.getPort());
    });

    return tomcat;
}
项目:Sound.je    文件:SpringConfig.java   
/**
 * Servlet container embedded servlet container factory.
 *
 * @return the embedded servlet container factory
 * @source http://stackoverflow.com/questions/39146476/how-does-spring-boot-control-tomcat-cache
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    return new TomcatEmbeddedServletContainerFactory() {
        @Override
        protected void postProcessContext(Context context) {
            final int cacheSize = 256 * 1024;
            final StandardRoot standardRoot = new StandardRoot(context);
            standardRoot.setCacheMaxSize(cacheSize);
            context.setResources(standardRoot);

            logger.info(String.format("New cache size (KB): %d", context.getResources().getCacheMaxSize()));
        }
    };
}
项目:xq_seckill_microservice    文件:WebServerConfig.java   
@Bean
public EmbeddedServletContainerFactory createEmbeddedServletContainerFactory() {
    TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory();
    tomcatFactory.setUriEncoding(StandardCharsets.UTF_8);
    tomcatFactory.setSessionTimeout(3600, TimeUnit.SECONDS);
    tomcatFactory.addConnectorCustomizers(new MyTomcatConnectorCustomizer());
    return tomcatFactory;
}
项目:xq_seckill_microservice    文件:WebServerConfig.java   
@Bean
public EmbeddedServletContainerFactory createEmbeddedServletContainerFactory() {
    TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory();
    tomcatFactory.setUriEncoding(StandardCharsets.UTF_8);
    tomcatFactory.setSessionTimeout(3600, TimeUnit.SECONDS);
    tomcatFactory.addConnectorCustomizers(new MyTomcatConnectorCustomizer());
    return tomcatFactory;
}
项目:xq_seckill_microservice    文件:WebServerConfig.java   
@Bean
public EmbeddedServletContainerFactory createEmbeddedServletContainerFactory() {
    TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory();
    tomcatFactory.setUriEncoding(StandardCharsets.UTF_8);
    tomcatFactory.setSessionTimeout(3600, TimeUnit.SECONDS);
    tomcatFactory.addConnectorCustomizers(new MyTomcatConnectorCustomizer());
    return tomcatFactory;
}
项目:xq_seckill_microservice    文件:WebServerConfig.java   
@Bean
public EmbeddedServletContainerFactory createEmbeddedServletContainerFactory() {
    TomcatEmbeddedServletContainerFactory tomcatFactory = new TomcatEmbeddedServletContainerFactory();
    tomcatFactory.setUriEncoding(StandardCharsets.UTF_8);
    tomcatFactory.setSessionTimeout(3600, TimeUnit.SECONDS);
    tomcatFactory.addConnectorCustomizers(new MyTomcatConnectorCustomizer());
    return tomcatFactory;
}
项目:scoold    文件:ScooldServer.java   
/**
 * @return Jetty config bean
 */
@Bean
public EmbeddedServletContainerFactory jettyConfigBean() {
    JettyEmbeddedServletContainerFactory jef = new JettyEmbeddedServletContainerFactory();
    jef.setPort(getServerPort());
    logger.info("Listening on port {}...", jef.getPort());
    return jef;
}
项目:seldon-core    文件:TomcatConfig.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {

  TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
  Connector[] additionalConnectors = this.additionalConnector();
  if (additionalConnectors != null && additionalConnectors.length > 0) {
    tomcat.addAdditionalTomcatConnectors(additionalConnectors);
  }

 return tomcat;
}
项目:S3Mock    文件:S3MockApplication.java   
/**
 * @return servletContainer bean reconfigured using SSL
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
  final TomcatEmbeddedServletContainerFactory tomcat =
      new TomcatEmbeddedServletContainerFactory();
  tomcat.addAdditionalTomcatConnectors(createHttpConnector());
  return tomcat;
}
项目:ait-platform    文件:AitTomcatCustomizer.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {

    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
    if (tomcatAjpEnabled) {
        Connector ajpConnector = new Connector("AJP/1.3");
        ajpConnector.setPort(ajpPort);
        ajpConnector.setSecure(false);
        ajpConnector.setAllowTrace(false);
        ajpConnector.setScheme("http");
        tomcat.addAdditionalTomcatConnectors(ajpConnector);
    }

    return tomcat;
}
项目:NGB-master    文件:AppMVCConfiguration.java   
@Bean
@ConditionalOnClass({EmbeddedServletContainerFactory.class })
public EmbeddedServletContainerCustomizer tomcatContainerCustomizer() {
    return container -> {
        TomcatEmbeddedServletContainerFactory tomcat = (TomcatEmbeddedServletContainerFactory) container;
        tomcat.setTldSkip("*.jar");

    };
}
项目:lemcloud    文件:JerseyApplication.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    factory.setPort(80);
    factory.setContextPath("/jersey");
    factory.setSessionTimeout(60, TimeUnit.MINUTES);
    return factory;
}
项目:lemcloud    文件:LiquidApplication.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    factory.setPort(80);
    factory.setContextPath("/liquid");
    factory.setSessionTimeout(60, TimeUnit.MINUTES);
    return factory;
}
项目:ansible-http    文件:AnsibleHttpApplication.java   
@Bean
public EmbeddedServletContainerFactory embeddedServletContainerFactory() {

  UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
  factory.addBuilderCustomizers(builder -> {
    builder.setServerOption(UndertowOptions.ENABLE_HTTP2, Boolean.TRUE);
    builder.setServerOption(UndertowOptions.ENABLE_SPDY, Boolean.TRUE);
    builder.setServerOption(UndertowOptions.ENABLE_STATISTICS, Boolean.TRUE);
    builder.setServerOption(UndertowOptions.RECORD_REQUEST_START_TIME, Boolean.TRUE);
    builder.setSocketOption(Options.BACKLOG, 100000);
    builder.addHttpListener(11081, "localhost");
  });
  return factory;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:EndpointWebMvcAutoConfiguration.java   
private Class<?> determineEmbeddedServletContainerFactoryClass()
        throws NoSuchBeanDefinitionException {
    Class<?> servletContainerFactoryClass = this.applicationContext
            .getBean(EmbeddedServletContainerFactory.class).getClass();
    if (cannotBeInstantiated(servletContainerFactoryClass)) {
        throw new FatalBeanException("EmbeddedServletContainerFactory implementation "
                + servletContainerFactoryClass.getName() + " cannot be instantiated. "
                + "To allow a separate management port to be used, a top-level class "
                + "or static inner class should be used instead");
    }
    return servletContainerFactoryClass;
}
项目:haven-platform    文件:ServletContainerConfiguration.java   
/**
 * adds SSL connector to Tomcat
 *
 * @return
 */
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory tomcat = new TomcatEmbeddedServletContainerFactory();
    if (StringUtils.hasText(keystoreFile)) {
        tomcat.addAdditionalTomcatConnectors(createSslConnector());
    }
    return tomcat;
}
项目:shinyproxy    文件:ShinyProxyApplication.java   
@Bean
public EmbeddedServletContainerFactory servletContainer() {
    UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
    factory.addDeploymentInfoCustomizers(new UndertowDeploymentInfoCustomizer() {
        @Override
        public void customize(DeploymentInfo deploymentInfo) {
            deploymentInfo.addInitialHandlerChainWrapper(new RootHandlerWrapper());
        }
    });
    factory.setPort(Integer.parseInt(environment.getProperty("shiny.proxy.port", "8080")));
    return factory; 
}