Java 类org.springframework.boot.web.embedded.jetty.JettyServletWebServerFactory 实例源码

项目:servlet4-demo    文件:ApplicationConfig.java   
/**
 * Create the JettyServletWebServerFactory bean.
 *
 * @return JettyServletWebServerFactory
 */
@Bean
public JettyServletWebServerFactory jettyServletWebServerFactory() {
  JettyServletWebServerFactory factory = new JettyServletWebServerFactory();
  factory.addServerCustomizers(this::configureServerForHttp2);
  return factory;
}
项目:nightclazz-spring5    文件:JettyHttp2Customizer.java   
/**
 * {@inheritDoc}
 */
@Override
public void customize(final JettyServletWebServerFactory factory) {
    if (serverProperties.getSsl() != null && serverProperties.getSsl().isEnabled()) {
        factory.addServerCustomizers(this::sslCustomizer);
    }
}
项目:joinfaces    文件:JettySpringBootAutoConfigurationIT.java   
@Test
public void customize() throws MalformedURLException {
    JettyServletWebServerFactory factory = new JettyServletWebServerFactory();

    this.jettySpringBootAutoConfiguration.customize(factory);

    Server server = ((JettyWebServer) factory.getWebServer()).getServer();

    Handler[] childHandlersByClass = server.getChildHandlersByClass(WebAppContext.class);
    WebAppContext webAppContext = (WebAppContext) childHandlersByClass[0];

    assertThat(webAppContext.getBaseResource().getResource("testJetty.txt").exists())
        .isTrue();
}
项目:joinfaces    文件:JsfJettyServerCustomizerIT.java   
@Test
public void customize() throws MalformedURLException {
    JsfJettyServerCustomizer customizer = new JsfJettyServerCustomizer(this.jettyProperties);

    Server server = ((JettyWebServer) new JettyServletWebServerFactory().getWebServer()).getServer();

    customizer.customize(server);

    Handler[] childHandlersByClass = server.getChildHandlersByClass(WebAppContext.class);
    WebAppContext webAppContext = (WebAppContext) childHandlersByClass[0];

    assertThat(webAppContext.getBaseResource().getResource("testJetty.txt").exists())
        .isTrue();
}
项目:nifi-registry    文件:IntegrationTestBase.java   
@Bean
public JettyServletWebServerFactory jettyEmbeddedServletContainerFactory() {
    JettyServletWebServerFactory jettyContainerFactory = new JettyServletWebServerFactory();
    jettyContainerFactory.setContextPath(CONTEXT_PATH);
    return jettyContainerFactory;
}
项目:joinfaces    文件:JettySpringBootAutoConfiguration.java   
@Override
public void customize(JettyServletWebServerFactory container) {
    container.addServerCustomizers(new JsfJettyServerCustomizer(this.jettyProperties));
}
项目:joinfaces    文件:JettyTestConfiguration.java   
@Bean
public JettyServletWebServerFactory jettyServletWebServerFactory() {
    return new JettyServletWebServerFactory();
}
项目:logback-access-spring-boot-starter    文件:JettyLogbackAccessInstaller.java   
/** {@inheritDoc} */
@Override
protected void installLogbackAccess(JettyServletWebServerFactory container) {
    container.addServerCustomizers(this::wrapJettyHandler);
    log.debug("Installed Logback-access: container=[{}]", container);
}