public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final String deploymentUnitName = deploymentUnit.getName(); final String moduleName; if (deploymentUnitName.endsWith(".war") || deploymentUnitName.endsWith(".jar") || deploymentUnitName.endsWith(".ear") || deploymentUnitName.endsWith(".rar")) { moduleName = deploymentUnitName.substring(0, deploymentUnitName.length() - 4); } else { moduleName = deploymentUnitName; } final String appName; final String earApplicationName = deploymentUnit.getAttachment(Attachments.EAR_APPLICATION_NAME); //the ear application name takes into account the name set in application.xml //if this is non-null this is always the one we want to use if(earApplicationName != null) { appName = earApplicationName; } else { //an appname of null means use the module name appName = null; } deploymentUnit.putAttachment(Attachments.EE_MODULE_DESCRIPTION, new EEModuleDescription(appName, moduleName, earApplicationName, appClient)); }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final String deploymentUnitName = deploymentUnit.getName(); final String moduleName; if (deploymentUnitName.endsWith(".war") || deploymentUnitName.endsWith(".jar") || deploymentUnitName.endsWith(".ear") || deploymentUnitName.endsWith(".rar")) { moduleName = deploymentUnitName.substring(0, deploymentUnitName.length() - 4); } else { moduleName = deploymentUnitName; } final String appName; final String earApplicationName = deploymentUnit.getAttachment(Attachments.EAR_APPLICATION_NAME); //the ear application name takes into account the name set in application.xml //if this is non-null this is always the one we want to use if(earApplicationName != null) { appName = earApplicationName; } else { //an appname of null means use the module name appName = null; } deploymentUnit.putAttachment(Attachments.EE_MODULE_DESCRIPTION, new EEModuleDescription(appName, moduleName, earApplicationName, appClient)); }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final String deploymentUnitName = deploymentUnit.getName(); final String moduleName; if (deploymentUnitName.endsWith(".war") || deploymentUnitName.endsWith(".wab") || deploymentUnitName.endsWith(".jar") || deploymentUnitName.endsWith(".ear") || deploymentUnitName.endsWith(".rar")) { moduleName = deploymentUnitName.substring(0, deploymentUnitName.length() - 4); } else { moduleName = deploymentUnitName; } final String appName; final String earApplicationName = deploymentUnit.getAttachment(Attachments.EAR_APPLICATION_NAME); //the ear application name takes into account the name set in application.xml //if this is non-null this is always the one we want to use if(earApplicationName != null) { appName = earApplicationName; } else { //an appname of null means use the module name appName = null; } deploymentUnit.putAttachment(Attachments.EE_MODULE_DESCRIPTION, new EEModuleDescription(appName, moduleName, earApplicationName, appClient)); }
public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); final String deploymentUnitName = deploymentUnit.getName(); final String moduleName; if (deploymentUnitName.endsWith(".war") || deploymentUnitName.endsWith(".jar") || deploymentUnitName.endsWith(".ear") || deploymentUnitName.endsWith(".rar")) { moduleName = deploymentUnitName.substring(0, deploymentUnitName.length() - 4); } else { moduleName = deploymentUnitName; } final String appName; final String earApplicationName = deploymentUnit.getAttachment(Attachments.EAR_APPLICATION_NAME); //the ear application name takes into account the name set in application.xml //if this is non-null this is always the one we want to use if(earApplicationName != null) { appName = earApplicationName; } else { //an appname of null means use the module name appName = null; } deploymentUnit.putAttachment(Attachments.EE_MODULE_DESCRIPTION, new EEModuleDescription(appName, moduleName, earApplicationName, appClient)); }