Search in sources :

Example 1 with UndertowBuilderCustomizer

use of org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer in project atlasmap by atlasmap.

the class AtlasItestsConfiguration method create.

@Bean
public UndertowEmbeddedServletContainerFactory create() throws Exception {
    UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
    factory.setPort(Integer.parseInt(properties.getProperty("http.port", "8585")));
    factory.setAddress(InetAddress.getByName(properties.getProperty("http.host", "localhost")));
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        public void customize(Builder builder) {
            try {
                builder.addHttpsListener(Integer.parseInt(properties.getProperty("https.port", "8443")), properties.getProperty("https.host", "localhost"), createSslContext());
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
    });
    return factory;
}
Also used : UndertowEmbeddedServletContainerFactory(org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory) UndertowBuilderCustomizer(org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer) Builder(io.undertow.Undertow.Builder) CertificateException(java.security.cert.CertificateException) Bean(org.springframework.context.annotation.Bean)

Example 2 with UndertowBuilderCustomizer

use of org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer in project Synergy by Meggot.

the class EmbeddedServletConfiguration method jettyEmbeddedServletContainerFactory.

@Bean
public UndertowEmbeddedServletContainerFactory jettyEmbeddedServletContainerFactory() {
    final UndertowEmbeddedServletContainerFactory factory = new UndertowEmbeddedServletContainerFactory();
    factory.addBuilderCustomizers(new UndertowBuilderCustomizer() {

        @Override
        public void customize(final Undertow.Builder builder) {
            builder.addHttpListener(port, "localhost");
        }
    });
    return factory;
}
Also used : UndertowEmbeddedServletContainerFactory(org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory) UndertowBuilderCustomizer(org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer) Undertow(io.undertow.Undertow) Bean(org.springframework.context.annotation.Bean)

Aggregations

UndertowBuilderCustomizer (org.springframework.boot.context.embedded.undertow.UndertowBuilderCustomizer)2 UndertowEmbeddedServletContainerFactory (org.springframework.boot.context.embedded.undertow.UndertowEmbeddedServletContainerFactory)2 Bean (org.springframework.context.annotation.Bean)2 Undertow (io.undertow.Undertow)1 Builder (io.undertow.Undertow.Builder)1 CertificateException (java.security.cert.CertificateException)1