final ServiceModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
if(deploymentUnit.getParent() != null) {
//if the parent has already attached parsed data for this sub deployment we need to process it
if(deploymentRoot.hasAttachment(SUB_DEPLOYMENT_STRUCTURE)) {
final ModuleSpecification subModuleSpec = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
handleDeployment(deploymentUnit, subModuleSpec, deploymentRoot.getAttachment(SUB_DEPLOYMENT_STRUCTURE));
}
}
VirtualFile deploymentFile = null;
for (final String loc : DEPLOYMENT_STRUCTURE_DESCRIPTOR_LOCATIONS) {
final VirtualFile file = deploymentRoot.getRoot().getChild(loc);
if (file.exists()) {
deploymentFile = file;
break;
}
}
if (deploymentFile == null) {
return;
}
if (deploymentUnit.getParent() != null) {
ServerLogger.DEPLOYMENT_LOGGER.jbossDeploymentStructureIgnored(deploymentFile.getPathName());
return;
}
try {
final ParseResult result = parse(deploymentFile.getPhysicalFile(), deploymentUnit, moduleLoader);
final ModuleSpecification moduleSpec = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
if (result.getEarSubDeploymentsIsolated() != null) {
// set the ear subdeployment isolation value overridden via the jboss-deployment-structure.xml
moduleSpec.setSubDeploymentModulesIsolated(result.getEarSubDeploymentsIsolated());
}
// handle the the root deployment
final ModuleStructureSpec rootDeploymentSpecification = result.getRootDeploymentSpecification();
if (rootDeploymentSpecification != null) {
handleDeployment(deploymentUnit, moduleSpec, rootDeploymentSpecification);