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

项目: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;
}
项目:haven-platform    文件:AuthConfiguration.java   
private UndertowDeploymentInfoCustomizer enableAuthUDICustomizer() {
    return (DeploymentInfo di) -> {
        if(StringUtils.isEmpty(encodedPass)) {
            return;
        }
        SecurityConstraint sc = new SecurityConstraint();
        sc.setEmptyRoleSemantic(SecurityInfo.EmptyRoleSemantic.AUTHENTICATE);
        // empty web resource interpret as default
        sc.addWebResourceCollection(new WebResourceCollection());
        di.addSecurityConstraints(sc);
        di.setSecurityDisabled(false);
        di.setAuthenticationMode(AuthenticationMode.PRO_ACTIVE);
        di.setLoginConfig(new LoginConfig(HttpServletRequest.BASIC_AUTH, "Haven Agent"));
        di.setIdentityManager(new IdentityManagerImpl(encodedPass));
    };
}
项目: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;
}
项目:syndesis    文件:Application.java   
@Bean
@Autowired
public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory(List<UndertowDeploymentInfoCustomizer> customizers) {
    UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
    for (UndertowDeploymentInfoCustomizer customizer : customizers) {
        factory.addDeploymentInfoCustomizers(customizer);
    }
    return factory;
}
项目: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; 
}
项目:syndesis-rest    文件:Application.java   
@Bean
@Autowired
public UndertowEmbeddedServletContainerFactory embeddedServletContainerFactory(List<UndertowDeploymentInfoCustomizer> customizers) {
    UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
    for (UndertowDeploymentInfoCustomizer customizer : customizers) {
        factory.addDeploymentInfoCustomizers(customizer);
    }
    return factory;
}