@Override public <U extends OpsParams> U getCommandParameters(Class<U> commandParametersType) { return context.getCommandParameters(commandParametersType); }
@Override protected void generateArtifacts(DeploymentContext dc) throws DeploymentException { DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class); if (params.precompilejsp) { //call JSPCompiler... runJSPC(dc); } }
private static String getAppNameFromDeployCmdParams(DeploymentContext dc) { final DeployCommandParameters commandParams = dc.getCommandParameters(DeployCommandParameters.class); return commandParams.name(); }
@Override public boolean isJava2DBRequired() { OpsParams params = deploymentContext.getCommandParameters(OpsParams.class); // We only do java2db while being deployed on DAS. We do not do java2DB on load of an application or being deployed on an instance of a cluster return params.origin.isDeploy() && isDas; }
private static String getAppNameFromDeployCmdParams(DeploymentContext dc) { final DeployCommandParameters commandParams = dc.getCommandParameters(DeployCommandParameters.class); return commandParams.name(); }
/** * Creates a new instance of Java2DBProcessorHelper. * Do not parse all the data until it's requested in the #init() call. * @param ctx the deployment context object. */ public Java2DBProcessorHelper(DeploymentContext ctx) { this.ctx = ctx; OpsParams params = ctx.getCommandParameters(OpsParams.class); if (logger.isLoggable(Level.FINE)) { logger.fine("---> Origin: " + params.origin); } deploy = params.origin.isDeploy(); deploymentContextProps = ctx.getModuleProps(); }
@Override public void unload(DummyApplication container, DeploymentContext context) { OpsParams params = context.getCommandParameters(OpsParams.class); cleanSecurityContext(params.name()); }
@Override public void unload(DummyApplication container, DeploymentContext context) { OpsParams params = context.getCommandParameters(OpsParams.class); cleanSecurityContext(params.name()); }
public boolean start(ApplicationContext startupContext) throws Exception { DeploymentContext dc = (DeploymentContext)startupContext; final DeployCommandParameters deployParams = dc.getCommandParameters(DeployCommandParameters.class); //during app. deployment, create resources config and load resources if(deployParams.origin == OpsParams.Origin.deploy || deployParams.origin == OpsParams.Origin.deploy_instance){ ResourcesDeployer.deployResources(applicationName, true); }else if (deployParams.origin == OpsParams.Origin.load || deployParams.origin == OpsParams.Origin.create_application_ref) { //<application> and its <resources>, <modules> are already available. //Deploy them. //during app. load (eg: server start or application/application-ref enable(), load resources asrManager.deployResources(applicationName); } return true; }
public boolean start(ApplicationContext startupContext) throws Exception { DeploymentContext dc = (DeploymentContext)startupContext; final DeployCommandParameters deployParams = dc.getCommandParameters(DeployCommandParameters.class); //during app. deployment, create resources config and load resources if(deployParams.origin == OpsParams.Origin.deploy || deployParams.origin == OpsParams.Origin.deploy_instance){ resourcesDeployer.deployResources(applicationName, true); }else if (deployParams.origin == OpsParams.Origin.load || deployParams.origin == OpsParams.Origin.create_application_ref) { //<application> and its <resources>, <modules> are already available. //Deploy them. //during app. load (eg: server start or application/application-ref enable(), load resources asrManager.deployResources(applicationName); } return true; }
/** * Get the persistenceType from domain.xml. * return null if not found */ public boolean getAsyncReplicationFromConfig(WebModule ctx) { boolean asyncReplication = true; DeploymentContext dc = ctx.getWebModuleConfig().getDeploymentContext(); if (dc != null) { DeployCommandParameters params = dc.getCommandParameters(DeployCommandParameters.class); if (params != null) { asyncReplication = params.asyncreplication; } } return asyncReplication; }
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 String getModuleClassPath (Habitat habitat, DeploymentContext context) { DeployCommandParameters params = context.getCommandParameters(DeployCommandParameters.class); return getModuleClassPath(habitat, params.name(), params.libraries()); }
public void preUndeploy(String appName, DeploymentContext dc) { PaaSDeploymentContext pc = new PaaSDeploymentContext(appName, dc); logger.log(Level.FINER, localStrings.getString("METHOD.preUndeploy")); if(!isOrchestratorInitiatedUndeploy(dc.getCommandParameters(OpsParams.class))){ orchestrateTask(PRE_UNDEPLOY_PHASE_STATES, appName, pc, false); } logger.log(Level.FINER, localStrings.getString("METHOD.preUndeploy")); }
public void postUndeploy(String appName, DeploymentContext dc) { PaaSDeploymentContext pc = new PaaSDeploymentContext(appName, dc); logger.log(Level.FINER, localStrings.getString("METHOD.postUndeploy")); if(!isOrchestratorInitiatedUndeploy(dc.getCommandParameters(OpsParams.class))){ orchestrateTask(POST_UNDEPLOY_PHASE_STATES, appName, pc, false); } logger.log(Level.FINER, localStrings.getString("METHOD.postUndeploy")); }
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); }
@Override public void clean(DeploymentContext dc) { super.clean(dc); WebServicesContainer container = habitat.getComponent(WebServicesContainer.class); WebServicesDeploymentMBean bean = container.getDeploymentBean(); UndeployCommandParameters params = dc.getCommandParameters(UndeployCommandParameters.class); if (params != null) { bean.undeploy(params.name); } }
@Override public DummyApplication load(SecurityContainer container, DeploymentContext context) { DeployCommandParameters dparams = context.getCommandParameters(DeployCommandParameters.class); Application app = context.getModuleMetaData(Application.class); handleCNonceCacheBSInit(app.getAppName(), app.getBundleDescriptors(WebBundleDescriptor.class), dparams.availabilityenabled); return new DummyApplication(); }
@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(); } } }