public void undeploy(OpsParams params, ExtendedDeploymentContext context) { String appName = params.name(); postUndeploy(appName, context); }
public File getAppInternalDir() { final File internalDir = new File(env.getApplicationRepositoryPath(), INTERNAL_DIR_NAME); return new File(internalDir, VersioningUtils.getRepositoryName(parameters.name())); }
@Override public void unload(DummyApplication container, DeploymentContext context) { OpsParams params = context.getCommandParameters(OpsParams.class); cleanSecurityContext(params.name()); }
/** * Returns a scratch directory that can be used to store things in. * The scratch directory will be persisted accross server restart but * not accross redeployment of the same application * * @param subDirName the sub directory name of the scratch dir * @return the scratch directory for this application based on * passed in subDirName. Returns the root scratch dir if the * passed in value is null. */ public File getScratchDir(String subDirName) { File rootScratchDir = env.getApplicationStubPath(); if (subDirName != null ) rootScratchDir = new File(rootScratchDir, subDirName); String appDirName = VersioningUtils.getRepositoryName(parameters.name()); return new File(rootScratchDir, appDirName); }
@Override public void unload(DummyApplication container, DeploymentContext context) { OpsParams params = context.getCommandParameters(OpsParams.class); cleanSecurityContext(params.name()); }
public void createApplicationClassLoader(ClassLoaderHierarchy clh, ArchiveHandler handler) throws URISyntaxException, MalformedURLException { this.addTransientAppMetaData(ExtendedDeploymentContext.IS_TEMP_CLASSLOADER, Boolean.FALSE); this.cloader = createClassLoader(clh, handler, parameters.name()); }
private static ResourceInfo getResourceInfo(DeploymentContext ctx, String dataSourceName) { ResourceInfo resourceInfo; if(dataSourceName.startsWith("java:app") /* || jndiName.startsWith("java:module") // Use of module scoped resources from JPA still needs to be speced out*/){ String applicationName = ctx.getCommandParameters(OpsParams.class).name(); resourceInfo = new ResourceInfo(dataSourceName, applicationName); }else{ resourceInfo = new ResourceInfo(dataSourceName); } return resourceInfo; } }
public static void removeRoleMapper(DeploymentContext dc) { OpsParams params = dc.getCommandParameters(OpsParams.class); if (params.origin != OpsParams.Origin.undeploy) { return; } String appName = params.name(); SecurityRoleMapperFactory factory = SecurityRoleMapperFactoryGen.getSecurityRoleMapperFactory(); if (factory == null) { throw new IllegalArgumentException("This application has no role mapper factory defined"); } factory.removeRoleMapper(appName); } }
public static void removeRoleMapper(DeploymentContext dc) { OpsParams params = dc.getCommandParameters(OpsParams.class); if (params.origin != OpsParams.Origin.undeploy) { return; } String appName = params.name(); SecurityRoleMapperFactory factory = getRoleMapperFactory(); factory.removeRoleMapper(appName); }
public void run() { if (phase.equals(ExtendedDeploymentContext.Phase.REPLICATION)) { OpsParams params = context.getCommandParameters(OpsParams.class); if (params.origin == OpsParams.Origin.deploy) { String appName = params.name(); serviceOrchestratorImpl.postDeploy(appName, context); } //make sure it is indeed undeploy and not disable. //params.origin is "undeploy" for both "undeploy" as well "disable" phase //hence using the actual command issued to confirm. if (params.origin == OpsParams.Origin.undeploy) { if (params.command == OpsParams.Command.undeploy) { serviceOrchestratorImpl.undeploy(params, context); } } //we get only after-CLEAN-unload-disable event. //we expect after-STOP-unload-disable, but since the target is not "DAS", //DAS will not receive such event. String appName = params.name(); if (params.origin == OpsParams.Origin.unload) { if (params.command == OpsParams.Command.disable) { if (isValidApplication(appName)) { serviceOrchestratorImpl.disable(appName, context); } } } } } });
/** * Clean any files and artifacts that were created during the execution * of the prepare method. * * @param context deployment context */ public void clean(DeploymentContext context) { if (undeploymentVisitor!=null) { String appName = context.getCommandParameters(OpsParams.class).name(); Application app = getApplicationFromApplicationInfo(appName); if (app != null) { context.addModuleMetaData(app); undeploymentVisitor.accept(app); } } }
@Override protected void cleanArtifacts(DeploymentContext dc) throws DeploymentException { removePolicy(dc); SecurityUtil.removeRoleMapper(dc); OpsParams params = dc.getCommandParameters(OpsParams.class); if (this.appCnonceMap != null) { CNonceCache cache = appCnonceMap.remove(params.name()); if (cache != null) { cache.destroy(); } } }
public void run() { if (phase.equals(ExtendedDeploymentContext.Phase.PREPARE)) { OpsParams params = context.getCommandParameters(OpsParams.class); String appName = params.name(); if (params.origin == OpsParams.Origin.deploy) { serviceOrchestratorImpl.preDeploy(appName, context); } else if (params.origin == OpsParams.Origin.load) { if (params.command == OpsParams.Command.startup_server) { if (isValidApplication(appName)) { serviceOrchestratorImpl.startup(appName, context); } } else { if (params.command == OpsParams.Command.enable) { if (isValidApplication(appName)) { serviceOrchestratorImpl.enable(appName, context); } } } } } else if (phase.equals(ExtendedDeploymentContext.Phase.STOP)) { OpsParams params = context.getCommandParameters(OpsParams.class); String appName = params.name(); if (params.origin == OpsParams.Origin.undeploy) { if (params.command == OpsParams.Command.disable) { serviceOrchestratorImpl.preUndeploy(appName, context); } } } } });
@Override protected void generateArtifacts(DeploymentContext dc) throws DeploymentException { OpsParams params = dc.getCommandParameters(OpsParams.class); if (params.origin != OpsParams.Origin.deploy) { return; } String appName = params.name(); try { Application app = dc.getModuleMetaData(Application.class); Set<WebBundleDescriptor> webDesc = app.getWebBundleDescriptors(); if (webDesc == null) { return; } for (WebBundleDescriptor webBD : webDesc) { loadPolicy(webBD, false); } } catch (Exception se) { String msg = "Error in generating security policy for " + appName; throw new DeploymentException(msg, se); } }
@Override protected void generateArtifacts(DeploymentContext dc) throws DeploymentException { OpsParams params = dc.getCommandParameters(OpsParams.class); if (params.origin.isArtifactsPresent()) { return; } String appName = params.name(); try { Application app = dc.getModuleMetaData(Application.class); Set<WebBundleDescriptor> webDesc = app.getBundleDescriptors(WebBundleDescriptor.class); if (webDesc == null) { return; } for (WebBundleDescriptor webBD : webDesc) { loadPolicy(webBD, false); } } catch (Exception se) { String msg = "Error in generating security policy for " + appName; throw new DeploymentException(msg, se); } }
actionReportProps.put(EjbApplication.KEEP_STATE, String.valueOf(true)); _logger.log(Level.INFO, "keepstate options resolved to true, saving appId {0} for application {1}.", new Object[]{appId, params.name()}); ApplicationInfo appInfo = appRegistry.get(params.name()); appInfo.addTransientAppMetaData(KEEP_STATE, keepState);
return; String appName = params.name();
String appName = params.name(); ApplicationInfo appInfo = applicationRegistry.get(appName); Application application = appInfo.getMetaData(Application.class);