当前位置: 首页>>代码示例>>Java>>正文


Java UndertowEmbeddedServletContainerFactory.addBuilderCustomizers方法代码示例

本文整理汇总了Java中org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory.addBuilderCustomizers方法的典型用法代码示例。如果您正苦于以下问题:Java UndertowEmbeddedServletContainerFactory.addBuilderCustomizers方法的具体用法?Java UndertowEmbeddedServletContainerFactory.addBuilderCustomizers怎么用?Java UndertowEmbeddedServletContainerFactory.addBuilderCustomizers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory的用法示例。


在下文中一共展示了UndertowEmbeddedServletContainerFactory.addBuilderCustomizers方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: embeddedServletContainerFactory

import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@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;
}
 
开发者ID:openmicroscopy,项目名称:omero-ms-queue,代码行数:24,代码来源:WebWiring.java

示例2: embeddedServletContainerFactory

import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@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;
}
 
开发者ID:januslabs,项目名称:ansible-http,代码行数:15,代码来源:AnsibleHttpApplication.java

示例3: embeddedServletContainerFactory

import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@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;
}
 
开发者ID:nandana,项目名称:ld-sniffer,代码行数:14,代码来源:LDSnifferWebApplication.java

示例4: customizeConnectionTimeout

import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; //导入方法依赖的package包/类
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);
		}
	});
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:ServerProperties.java

示例5: customizeMaxHttpHeaderSize

import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; //导入方法依赖的package包/类
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);
		}

	});
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:ServerProperties.java

示例6: customizeMaxHttpPostSize

import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; //导入方法依赖的package包/类
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);
		}

	});
}
 
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:14,代码来源:ServerProperties.java

示例7: embeddedServletContainerFactory

import org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory; //导入方法依赖的package包/类
@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;
}
 
开发者ID:qmatic,项目名称:api-gateway,代码行数:15,代码来源:Application.java


注:本文中的org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory.addBuilderCustomizers方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。