本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}