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

项目:omero-ms-queue    文件:WebWiring.java   
@Bean
public UndertowEmbeddedServletContainerFactory 
            embeddedServletContainerFactory(
                    ConfigProvider<UndertowConfig> cfg) {

    int port = cfg.defaultReadConfig().findFirst().get().getPort();

    UndertowEmbeddedServletContainerFactory factory = 
            new UndertowEmbeddedServletContainerFactory(port);

    factory.addBuilderCustomizers((UndertowBuilderCustomizer) builder -> {  // (*)
        builder.setServerOption(UndertowOptions.DECODE_URL, true);
        builder.setServerOption(UndertowOptions.URL_CHARSET,
                                StandardCharsets.UTF_8.name());
    });

    factory.addDeploymentInfoCustomizers(
            (UndertowDeploymentInfoCustomizer) deployment -> {  // (*)
        deployment.setDefaultEncoding(StandardCharsets.UTF_8.name());
    });

    return factory;
}
项目:ome-smuggler    文件:WebWiring.java   
@Bean
public UndertowEmbeddedServletContainerFactory 
            embeddedServletContainerFactory(
                    ConfigProvider<UndertowConfig> cfg) {

    int port = cfg.defaultReadConfig().findFirst().get().getPort();

    UndertowEmbeddedServletContainerFactory factory = 
            new UndertowEmbeddedServletContainerFactory(port);

    factory.addBuilderCustomizers((UndertowBuilderCustomizer) builder -> {  // (*)
        builder.setServerOption(UndertowOptions.DECODE_URL, true);
        builder.setServerOption(UndertowOptions.URL_CHARSET,
                                StandardCharsets.UTF_8.name());
    });

    factory.addDeploymentInfoCustomizers(
            (UndertowDeploymentInfoCustomizer) deployment -> {  // (*)
        deployment.setDefaultEncoding(StandardCharsets.UTF_8.name());
    });

    return factory;
}
项目:ld-sniffer    文件:LDSnifferWebApplication.java   
@Bean
public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        @Override
        public void customize(Undertow.Builder builder) {
            builder.addHttpListener(8080, "0.0.0.0");
        }

    });
    return factory;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ServerProperties.java   
private void customizeConnectionTimeout(
        UndertowEmbeddedServletContainerFactory factory,
        final int connectionTimeout) {
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {
        @Override
        public void customize(Builder builder) {
            builder.setSocketOption(UndertowOptions.NO_REQUEST_TIMEOUT,
                    connectionTimeout);
        }
    });
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ServerProperties.java   
private void customizeMaxHttpHeaderSize(
        UndertowEmbeddedServletContainerFactory factory,
        final int maxHttpHeaderSize) {
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        @Override
        public void customize(Builder builder) {
            builder.setServerOption(UndertowOptions.MAX_HEADER_SIZE,
                    maxHttpHeaderSize);
        }

    });
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ServerProperties.java   
private void customizeMaxHttpPostSize(
        UndertowEmbeddedServletContainerFactory factory,
        final int maxHttpPostSize) {
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        @Override
        public void customize(Builder builder) {
            builder.setServerOption(UndertowOptions.MAX_ENTITY_SIZE,
                    (long) maxHttpPostSize);
        }

    });
}
项目:api-gateway    文件:Application.java   
@Bean
UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory() {
    UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();

    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        @Override
        public void customize(Builder builder) {
            builder.setIoThreads(Runtime.getRuntime().availableProcessors() * 2);
        }
    });

    return factory;
}
项目:spring-boot-concourse    文件:ServerProperties.java   
private void customizeMaxHttpHeaderSize(
        UndertowEmbeddedServletContainerFactory factory,
        final int maxHttpHeaderSize) {
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        @Override
        public void customize(Builder builder) {
            builder.setServerOption(UndertowOptions.MAX_HEADER_SIZE,
                    maxHttpHeaderSize);
        }

    });
}
项目:spring-boot-concourse    文件:ServerProperties.java   
private void customizeMaxHttpPostSize(
        UndertowEmbeddedServletContainerFactory factory,
        final int maxHttpPostSize) {
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        @Override
        public void customize(Builder builder) {
            builder.setServerOption(UndertowOptions.MAX_ENTITY_SIZE,
                    (long) maxHttpPostSize);
        }

    });
}