/** * unloads the module from its container. * * @param context unloading context * @return */ public boolean unload(ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); // then remove the application from the container Deployer deployer = ctrInfo.getDeployer(); try { deployer.unload(appCtr, context); ctrInfo.unload(context); } catch(Exception e) { report.failure(context.getLogger(), "Exception while shutting down application container", e); return false; } appCtr=null; return true; }
/** * unloads the module from its container. * * @param context unloading context * @return */ public boolean unload(ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); // then remove the application from the container Deployer deployer = ctrInfo.getDeployer(); try { deployer.unload(appCtr, context); ctrInfo.unload(context); } catch(Exception e) { report.failure(context.getLogger(), "Exception while shutting down application container", e); return false; } appCtr=null; return true; }
public ModuleInfo doBundle(ModuleDescriptor bundle) throws Exception { ExtendedDeploymentContext sContext = subContext(application, context, bundle.getArchiveUri()); ModuleInfo info = prepareBundle(bundle, application, sContext); if (info == null) { sContext.getActionReport().setActionExitCode(ActionReport.ExitCode.WARNING); String msg = localStrings.getLocalString("skipmoduleprocessing", "Skipped processing for module {0} as its module type was not recognized", bundle.getArchiveUri()); sContext.getActionReport().setMessage(msg); deplLogger.log(Level.WARNING, UNRECOGNIZED_MODULE_TYPE, bundle.getArchiveUri()); return null; } info.addMetaData(application); BundleDescriptor bundleDesc = application.getModuleByUri( bundle.getArchiveUri()); info.addMetaData(bundleDesc); for (RootDeploymentDescriptor ext : bundleDesc.getExtensionsDescriptors()) { info.addMetaData(ext); } appInfo.addModule(info); return info; }
} else { // the application is EAR ExtendedDeploymentContext exdc = (ExtendedDeploymentContext) depc; actionReportProps = exdc.getParentContext().getActionReport().getExtraProperties();
} else { // the application is EAR ExtendedDeploymentContext exdc = (ExtendedDeploymentContext) depc; actionReportProps = exdc.getParentContext().getActionReport().getExtraProperties();
versioningService.handleDisable(appName, target, deploymentContext.getActionReport());
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; }
public void undeploy(String appName, ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); UndeployCommandParameters params = context.getCommandParameters(UndeployCommandParameters.class); ApplicationInfo info = appRegistry.get(appName); if (info==null) { report.failure(context.getLogger(), "Application " + appName + " not registered", null); events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); return; } events.send(new Event(Deployment.UNDEPLOYMENT_START, info)); // for DAS target, the undeploy should unload the application // as well if (DeploymentUtils.isDASTarget(params.target)) { unload(info, context); } if (report.getActionExitCode().equals(ActionReport.ExitCode.SUCCESS)) { events.send(new Event(Deployment.UNDEPLOYMENT_SUCCESS, context)); deploymentLifecycleProbeProvider.applicationUndeployedEvent(appName, getApplicationType(info)); } else { events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); } appRegistry.remove(appName); }
public void undeploy(String appName, ExtendedDeploymentContext context) { ActionReport report = context.getActionReport(); UndeployCommandParameters params = context.getCommandParameters(UndeployCommandParameters.class); ApplicationInfo info = appRegistry.get(appName); if (info==null) { report.failure(context.getLogger(), "Application " + appName + " not registered", null); events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); return; } events.send(new Event(Deployment.UNDEPLOYMENT_START, info)); // for DAS target, the undeploy should unload the application // as well if (DeploymentUtils.isDASTarget(params.target)) { unload(info, context); } if (report.getActionExitCode().equals(ActionReport.ExitCode.SUCCESS)) { events.send(new Event(Deployment.UNDEPLOYMENT_SUCCESS, context)); deploymentLifecycleProbeProvider.applicationUndeployedEvent(appName, getApplicationType(info)); } else { events.send(new Event(Deployment.UNDEPLOYMENT_FAILURE, context)); } appRegistry.remove(appName); }
final ActionReport report = context.getActionReport();
final ActionReport report = context.getActionReport();