private void registerIfBatchJobsDirExists(ApplicationInfo applicationInfo) { if (applicationInfo != null && applicationInfo.isLoaded()) { ClassLoader appClassLoader = applicationInfo.getAppClassLoader(); if (appClassLoader != null && appClassLoader.getResource("META-INF/batch-jobs") != null) { tagNamesRequiringCleanup.add(config.getName() + ":" + applicationInfo.getName()); return; } for (ModuleInfo moduleInfo : applicationInfo.getModuleInfos()) { ClassLoader moduleClassLoader = moduleInfo.getModuleClassLoader(); if (moduleClassLoader != null && moduleClassLoader.getResource("META-INF/batch-jobs") != null) { tagNamesRequiringCleanup.add(config.getName() + ":" + applicationInfo.getName()); } } } }
if (appInfo == null || appInfo.isLoaded()) { return;
if (appInfo == null || !appInfo.isLoaded()) { return;
if (appInfo != null && appInfo.isLoaded()) { return null;
if (appInfo != null && appInfo.isLoaded()) { return null;
public ExtendedDeploymentContext disable(UndeployCommandParameters commandParams, Application app, ApplicationInfo appInfo, ActionReport report, Logger logger) throws Exception { if (appInfo == null) { return null; } // if it's not on DAS and the application is not loaded, do not unload // when it's on DAS, there is some necessary clean up we need to do if (!env.isDas() && !appInfo.isLoaded()) { return null; } if (app != null) { commandParams._type = app.archiveType(); } final ExtendedDeploymentContext deploymentContext = getBuilder(logger, commandParams, report).source(appInfo.getSource()).build(); if (app != null) { deploymentContext.getAppProps().putAll( app.getDeployProperties()); deploymentContext.setModulePropsMap( app.getModulePropertiesMap()); } if (commandParams.properties != null) { deploymentContext.getAppProps().putAll(commandParams.properties); } unload(appInfo, deploymentContext); return deploymentContext; }
/** * <p> Load the Admin Console web application.</p> */ private void load() { ApplicationRegistry appRegistry = habitat.<ApplicationRegistry>getService(ApplicationRegistry.class); ApplicationInfo appInfo = appRegistry.get(AdminConsoleAdapter.ADMIN_APP_NAME); if (appInfo != null && appInfo.isLoaded()) { // Application is already loaded adapter.setStateMsg(AdapterState.APPLICATION_LOADED); return; } // hook for Jerome Application config = adapter.getConfig(); if (config == null) { throw new IllegalStateException("Admin Console application has no system app entry!"); } // Set adapter state adapter.setStateMsg(AdapterState.APPLICATION_LOADING); // Load the Admin Console Application String sn = env.getInstanceName(); // FIXME: An exception may not be thrown... check for errors! ApplicationRef ref = domain.getApplicationRefInServer(sn, AdminConsoleAdapter.ADMIN_APP_NAME); habitat.<ApplicationLoaderService>getService(ApplicationLoaderService.class).processApplication(config, ref); // Set adapter state adapter.setStateMsg(AdapterState.APPLICATION_LOADED); }
public ExtendedDeploymentContext disable(UndeployCommandParameters commandParams, Application app, ApplicationInfo appInfo, ActionReport report, Logger logger) throws Exception { if (appInfo == null) { report.failure(logger, "Application not registered", null); return null; } // if it's not on DAS and the application is not loaded, do not unload // when it's on DAS, there is some necessary clean up we need to do if (!env.isDas() && !appInfo.isLoaded()) { return null; } if (app != null) { commandParams._type = app.archiveType(); } final ExtendedDeploymentContext deploymentContext = getBuilder(logger, commandParams, report).source(appInfo.getSource()).build(); if (app != null) { deploymentContext.getAppProps().putAll( app.getDeployProperties()); deploymentContext.setModulePropsMap( app.getModulePropertiesMap()); } if (commandParams.properties != null) { deploymentContext.getAppProps().putAll(commandParams.properties); } unload(appInfo, deploymentContext); return deploymentContext; }
public ApplicationInfo unload(ApplicationInfo info, ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); if (info==null) { report.failure(context.getLogger(), "Application not registered", null); return null; } notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.STOP, context); if (info.isLoaded()) { info.stop(context, context.getLogger()); notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.STOP, context); notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.UNLOAD, context); info.unload(context); notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.UNLOAD, context); } events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_DISABLED, info), false); try { notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.CLEAN, context); info.clean(context); notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.CLEAN, context); } catch(Exception e) { report.failure(context.getLogger(), "Exception while cleaning", e); return info; } return info; }
public ApplicationInfo unload(ApplicationInfo info, ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); if (info==null) { report.failure(context.getLogger(), "Application not registered", null); return null; } notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.STOP, context); if (info.isLoaded()) { info.stop(context, context.getLogger()); notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.STOP, context); notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.UNLOAD, context); info.unload(context); notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.UNLOAD, context); } events.send(new Event<ApplicationInfo>(Deployment.APPLICATION_DISABLED, info), false); try { notifyLifecycleInterceptorsBefore(ExtendedDeploymentContext.Phase.CLEAN, context); info.clean(context); notifyLifecycleInterceptorsAfter(ExtendedDeploymentContext.Phase.CLEAN, context); } catch(Exception e) { report.failure(context.getLogger(), "Exception while cleaning", e); return info; } return info; }