Search in sources :

Example 1 with SystemRedeployServlet

use of com.generallycloud.baseio.container.implementation.SystemRedeployServlet in project baseio by generallycloud.

the class ApplicationContext method doStart.

@Override
protected void doStart() throws Exception {
    if (channelContext == null) {
        throw new IllegalArgumentException("null nio context");
    }
    if (StringUtil.isNullOrBlank(rootLocalAddress)) {
        throw new IllegalArgumentException("rootLocalAddress");
    }
    if (futureAcceptorServiceFilter == null) {
        this.futureAcceptorServiceFilter = new FutureAcceptorServiceFilter();
    }
    if (appRedeployService == null) {
        appRedeployService = new SystemRedeployServlet();
    }
    if (acLoader == null) {
        acLoader = new FileSystemACLoader();
    }
    if (exceptionCaughtHandle == null) {
        exceptionCaughtHandle = new LoggerExceptionCaughtHandle();
    }
    if (ioExceptionCaughtHandle == null) {
        ioExceptionCaughtHandle = new LoggerExceptionCaughtHandle();
    }
    instance = this;
    this.rootLocalAddress = FileUtil.getPrettyPath(rootLocalAddress);
    this.encoding = channelContext.getEncoding();
    this.appLocalAddres = FileUtil.getPrettyPath(getRootLocalAddress() + "app");
    LoggerUtil.prettyLog(logger, "application path      :{ {} }", appLocalAddres);
    this.initializeApplicationContext();
}
Also used : SystemRedeployServlet(com.generallycloud.baseio.container.implementation.SystemRedeployServlet) FileSystemACLoader(com.generallycloud.baseio.container.configuration.FileSystemACLoader) FutureAcceptorServiceFilter(com.generallycloud.baseio.container.service.FutureAcceptorServiceFilter) LoggerExceptionCaughtHandle(com.generallycloud.baseio.component.LoggerExceptionCaughtHandle)

Example 2 with SystemRedeployServlet

use of com.generallycloud.baseio.container.implementation.SystemRedeployServlet in project baseio by generallycloud.

the class ApplicationContext method initializeApplicationContext.

private void initializeApplicationContext() throws Exception {
    this.classLoader = Bootstrap.newClassLoader(deployModel, true, rootLocalAddress, Bootstrap.withDefault());
    this.applicationExtLoader.loadExts(this, classLoader);
    this.configuration = acLoader.loadConfiguration(classLoader);
    if (pluginLoader == null) {
        this.pluginLoader = new PluginLoader();
    }
    if (filterLoader == null) {
        this.filterLoader = new FutureAcceptorFilterLoader(getFutureAcceptorServiceFilter());
    }
    if (configuration.isAPP_ENABLE_REDEPLOY()) {
        SystemRedeployServlet redeployServlet = new SystemRedeployServlet();
        filterLoader.getFutureAcceptorServiceLoader().getServices().put(redeployServlet.getServiceName(), redeployServlet);
    }
    if (configuration.isAPP_ENABLE_STOPSERVER()) {
        SystemStopServerServlet stopServerServlet = new SystemStopServerServlet();
        filterLoader.getFutureAcceptorServiceLoader().getServices().put(stopServerServlet.getServiceName(), stopServerServlet);
    }
    pluginLoader.initialize(this, null);
    filterLoader.initialize(this, null);
}
Also used : SystemRedeployServlet(com.generallycloud.baseio.container.implementation.SystemRedeployServlet) SystemStopServerServlet(com.generallycloud.baseio.container.implementation.SystemStopServerServlet) PluginLoader(com.generallycloud.baseio.container.service.PluginLoader) FutureAcceptorFilterLoader(com.generallycloud.baseio.container.service.FutureAcceptorFilterLoader)

Aggregations

SystemRedeployServlet (com.generallycloud.baseio.container.implementation.SystemRedeployServlet)2 LoggerExceptionCaughtHandle (com.generallycloud.baseio.component.LoggerExceptionCaughtHandle)1 FileSystemACLoader (com.generallycloud.baseio.container.configuration.FileSystemACLoader)1 SystemStopServerServlet (com.generallycloud.baseio.container.implementation.SystemStopServerServlet)1 FutureAcceptorFilterLoader (com.generallycloud.baseio.container.service.FutureAcceptorFilterLoader)1 FutureAcceptorServiceFilter (com.generallycloud.baseio.container.service.FutureAcceptorServiceFilter)1 PluginLoader (com.generallycloud.baseio.container.service.PluginLoader)1