Search in sources :

Example 1 with ReactiveWebServerFactory

use of org.springframework.boot.web.reactive.server.ReactiveWebServerFactory in project spring-boot by spring-projects.

the class ReactiveWebServerApplicationContext method createWebServer.

private void createWebServer() {
    WebServerManager serverManager = this.serverManager;
    if (serverManager == null) {
        StartupStep createWebServer = this.getApplicationStartup().start("spring.boot.webserver.create");
        String webServerFactoryBeanName = getWebServerFactoryBeanName();
        ReactiveWebServerFactory webServerFactory = getWebServerFactory(webServerFactoryBeanName);
        createWebServer.tag("factory", webServerFactory.getClass().toString());
        boolean lazyInit = getBeanFactory().getBeanDefinition(webServerFactoryBeanName).isLazyInit();
        this.serverManager = new WebServerManager(this, webServerFactory, this::getHttpHandler, lazyInit);
        getBeanFactory().registerSingleton("webServerGracefulShutdown", new WebServerGracefulShutdownLifecycle(this.serverManager.getWebServer()));
        getBeanFactory().registerSingleton("webServerStartStop", new WebServerStartStopLifecycle(this.serverManager));
        createWebServer.end();
    }
    initPropertySources();
}
Also used : StartupStep(org.springframework.core.metrics.StartupStep) WebServerGracefulShutdownLifecycle(org.springframework.boot.web.context.WebServerGracefulShutdownLifecycle) ReactiveWebServerFactory(org.springframework.boot.web.reactive.server.ReactiveWebServerFactory)

Aggregations

WebServerGracefulShutdownLifecycle (org.springframework.boot.web.context.WebServerGracefulShutdownLifecycle)1 ReactiveWebServerFactory (org.springframework.boot.web.reactive.server.ReactiveWebServerFactory)1 StartupStep (org.springframework.core.metrics.StartupStep)1