protected UndeployCommandParameters getUndeployParams( OSGiApplicationInfo osgiAppInfo) { UndeployCommandParameters parameters = new UndeployCommandParameters(); parameters.name = osgiAppInfo.getAppInfo().getName(); parameters.origin = DeployCommandParameters.Origin.undeploy; return parameters; }
protected UndeployCommandParameters getUndeployParams( OSGiApplicationInfo osgiAppInfo) { UndeployCommandParameters parameters = new UndeployCommandParameters(); parameters.name = osgiAppInfo.getAppInfo().getName(); parameters.origin = DeployCommandParameters.Origin.undeploy; return parameters; }
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()); } } } }
private void stopApplication(Application app, ApplicationInfo appInfo) { final ActionReport dummy = new HTMLActionReporter(); if (appInfo!=null) { UndeployCommandParameters parameters = new UndeployCommandParameters(appInfo.getName()); parameters.origin = UndeployCommandParameters.Origin.unload; parameters.command = UndeployCommandParameters.Command.shutdown_server; try { deployment.disable(parameters, app, appInfo, dummy, logger); } catch (Exception e) { logger.log(Level.SEVERE, KernelLoggerInfo.loadingApplicationErrorDisable, e); } unloadApplicationForTenants(app, dummy); appRegistry.remove(appInfo.getName()); } }
final String fAppName = appInfo.getName(); invocationManager.pushAppEnvironment(new ApplicationEnvironment() { WeldBootstrap bootstrap = appInfo.getTransientAppMetaData(WELD_BOOTSTRAP, WeldBootstrap.class); if (bootstrap != null) { final String fAppName = appInfo.getName(); invocationManager.pushAppEnvironment(new ApplicationEnvironment() { @Override
appInfo.stop(dc, logger); appInfo.unload(dc); deployer.undeploy(appInfo.getName(), dc);
appInfo.stop(dc, logger); appInfo.unload(dc); deployer.undeploy(appInfo.getName(), dc); if (!osgiAppInfo.isDirectoryDeployment())
subReport.setFailureCause(e); appRegistry.remove(appInfo.getName());
/** * Event listener to listen to </code>application undeploy validation</code> and * if <i>preserveResources</i> flag is set, cache the <resources> * config for persisting it in domain.xml */ public void event(Event event) { if (event.is(Deployment.DEPLOYMENT_BEFORE_CLASSLOADER_CREATION)) { DeploymentContext dc = (DeploymentContext) event.hook(); final DeployCommandParameters deployParams = dc.getCommandParameters(DeployCommandParameters.class); processResources(dc, deployParams); }else if(event.is(Deployment.UNDEPLOYMENT_VALIDATION)){ DeploymentContext dc = (DeploymentContext) event.hook(); final UndeployCommandParameters undeployCommandParameters = dc.getCommandParameters(UndeployCommandParameters.class); preserveResources(dc, undeployCommandParameters); }else if(Deployment.UNDEPLOYMENT_FAILURE.equals(event.type())){ DeploymentContext dc = (DeploymentContext) event.hook(); cleanupPreservedResources(dc, event); }else if(Deployment.DEPLOYMENT_FAILURE.equals(event.type())){ DeploymentContext dc = (DeploymentContext) event.hook(); String appName = getAppNameFromDeployCmdParams(dc); cleanupResources(appName, dc.getCommandParameters(DeployCommandParameters.class).origin); //TODO ASR call this only when the flag is on ? --properties preserveAppScopedResources=true cleanupPreservedResources(dc, event); }else if(Deployment.DEPLOYMENT_SUCCESS.equals(event.type())){ ApplicationInfo applicationInfo = (ApplicationInfo) event.hook(); String appName = applicationInfo.getName(); resourceConfigurations.remove(appName); } }
/** * Event listener to listen to </code>application undeploy validation</code> and * if <i>preserveResources</i> flag is set, cache the <resources> * config for persisting it in domain.xml */ public void event(Event event) { if (event.is(Deployment.DEPLOYMENT_BEFORE_CLASSLOADER_CREATION)) { DeploymentContext dc = (DeploymentContext) event.hook(); final DeployCommandParameters deployParams = dc.getCommandParameters(DeployCommandParameters.class); processResources(dc, deployParams); }else if(event.is(Deployment.UNDEPLOYMENT_VALIDATION)){ DeploymentContext dc = (DeploymentContext) event.hook(); final UndeployCommandParameters undeployCommandParameters = dc.getCommandParameters(UndeployCommandParameters.class); preserveResources(dc, undeployCommandParameters); }else if(Deployment.UNDEPLOYMENT_FAILURE.equals(event.type())){ DeploymentContext dc = (DeploymentContext) event.hook(); cleanupPreservedResources(dc, event); }else if(Deployment.DEPLOYMENT_FAILURE.equals(event.type())){ DeploymentContext dc = (DeploymentContext) event.hook(); String appName = getAppNameFromDeployCmdParams(dc); cleanupResources(appName, dc.getCommandParameters(DeployCommandParameters.class).origin); //TODO ASR call this only when the flag is on ? --properties preserveAppScopedResources=true cleanupPreservedResources(dc, event); }else if(Deployment.DEPLOYMENT_SUCCESS.equals(event.type())){ ApplicationInfo applicationInfo = (ApplicationInfo) event.hook(); String appName = applicationInfo.getName(); ResourcesRegistry.remove(appName); } }