Search in sources :

Example 1 with WebServerApplicationLoader

use of cn.taketoday.web.framework.server.WebServerApplicationLoader in project today-framework by TAKETODAY.

the class LightWebServer method contextInitialized.

@Override
protected void contextInitialized() {
    super.contextInitialized();
    try {
        final WebServerApplicationLoader loader = new WebServerApplicationLoader(this::getMergedInitializers);
        loader.setDispatcher(httpHandler);
        loader.setApplicationContext(obtainApplicationContext());
        loader.onStartup(obtainApplicationContext());
    } catch (Throwable e) {
        throw new ConfigurationException(e);
    }
}
Also used : WebServerApplicationLoader(cn.taketoday.web.framework.server.WebServerApplicationLoader) ConfigurationException(cn.taketoday.core.ConfigurationException)

Example 2 with WebServerApplicationLoader

use of cn.taketoday.web.framework.server.WebServerApplicationLoader in project today-framework by TAKETODAY.

the class NettyWebServer method contextInitialized.

@Override
protected void contextInitialized() {
    super.contextInitialized();
    WebServerApplicationContext context = obtainApplicationContext();
    try {
        WebServerApplicationLoader loader = new WebServerApplicationLoader(this::getMergedInitializers);
        loader.setApplicationContext(context);
        loader.onStartup(context);
    } catch (Throwable e) {
        throw ExceptionUtils.sneakyThrow(e);
    }
}
Also used : WebServerApplicationLoader(cn.taketoday.web.framework.server.WebServerApplicationLoader) StandardWebServerApplicationContext(cn.taketoday.web.framework.StandardWebServerApplicationContext) WebServerApplicationContext(cn.taketoday.web.framework.WebServerApplicationContext)

Aggregations

WebServerApplicationLoader (cn.taketoday.web.framework.server.WebServerApplicationLoader)2 ConfigurationException (cn.taketoday.core.ConfigurationException)1 StandardWebServerApplicationContext (cn.taketoday.web.framework.StandardWebServerApplicationContext)1 WebServerApplicationContext (cn.taketoday.web.framework.WebServerApplicationContext)1