use of cn.taketoday.framework.web.servlet.server.ServletWebServerFactory in project today-framework by TAKETODAY.
the class ServletWebServerApplicationContext method createWebServer.
private void createWebServer() {
WebServer webServer = this.webServer;
ServletContext servletContext = getServletContext();
if (webServer == null && servletContext == null) {
ServletWebServerFactory factory = getWebServerFactory();
webServer = factory.getWebServer(getSelfInitializer());
StandardBeanFactory beanFactory = getBeanFactory();
beanFactory.registerSingleton("webServerStartStop", new WebServerStartStopLifecycle(this, webServer));
beanFactory.registerSingleton("webServerGracefulShutdown", new WebServerGracefulShutdownLifecycle(webServer));
this.webServer = webServer;
} else if (servletContext != null) {
try {
getSelfInitializer().onStartup(servletContext);
} catch (ServletException ex) {
throw new ApplicationContextException("Cannot initialize servlet context", ex);
}
}
initPropertySources();
}
use of cn.taketoday.framework.web.servlet.server.ServletWebServerFactory in project today-infrastructure by TAKETODAY.
the class ServletWebServerApplicationContext method createWebServer.
private void createWebServer() {
WebServer webServer = this.webServer;
ServletContext servletContext = getServletContext();
if (webServer == null && servletContext == null) {
ServletWebServerFactory factory = getWebServerFactory();
webServer = factory.getWebServer(getSelfInitializer());
StandardBeanFactory beanFactory = getBeanFactory();
beanFactory.registerSingleton("webServerStartStop", new WebServerStartStopLifecycle(this, webServer));
beanFactory.registerSingleton("webServerGracefulShutdown", new WebServerGracefulShutdownLifecycle(webServer));
this.webServer = webServer;
} else if (servletContext != null) {
try {
getSelfInitializer().onStartup(servletContext);
} catch (ServletException ex) {
throw new ApplicationContextException("Cannot initialize servlet context", ex);
}
}
initPropertySources();
}
Aggregations