/** * Create the EARContentsDeployer and register as a DeploymentStage.PARSE * stage deployer with JBossAppMetaData output. * * We need to run after AppParsingDeployer. */ public EARContentsDeployer() { setStage(DeploymentStages.PARSE); addInput(EarMetaData.class); addOutput(JBossAppMetaData.class); setTopLevelOnly(true); }
String filename = earRelativePath(earPath, vfArchive.getPathName()); int type = typeFromSuffix(unit, filename, vfArchive); if (type >= 0 && moduleMetaData == null)
/** * Entry point for handling a VFSDeploymentUnit. * * @param unit the current deployment unit * @throws DeploymentException for any error */ public void deploy(VFSDeploymentUnit unit) throws DeploymentException { VirtualFile root = unit.getRoot(); String relativePath = unit.getRelativePath(); VirtualFile ear = unit.getFile(relativePath); if (ear == null) throw new DeploymentException("No such ear file, relative path: '" + relativePath + "', root: " + root); deploy(unit, root, ear); }
/** * Process the ear VFSDeploymentUnit. * * @param unit - the parent VFSDeploymentUnit for the ear * @param root - the deployment VFS root * @param file - the deployment ear VF */ protected void deploy(VFSDeploymentUnit unit, VirtualFile root, VirtualFile file) { try { JBossAppMetaData j2eeMetaData = new JBoss50AppMetaData(); // TODO: need to scan for annotationss scanEar(unit, file, j2eeMetaData); unit.addAttachment(JBossAppMetaData.class, j2eeMetaData); } catch(Exception e) { throw new RuntimeException("Error determining ear contents: " + file.getName(), e); } }
public void deploy(DeploymentUnit unit) throws DeploymentException { /* If there is a META-INF/application.xml we don't process this. */ if (unit.isAttachmentPresent(EarMetaData.class)) { log.tracef("Ignoring ear with META-INF/application.xml: %1s", unit.getSimpleName()); return; } // Ignore non-vfs deployments if (unit instanceof VFSDeploymentUnit == false) { log.tracef("Not a vfs deployment: %1s", unit.getName()); return; } // See if the suffix matches the .ear requirement if (requiresEarSuffix && unit.getSimpleName().endsWith(".ear") == false) { log.tracef("Unit name does not end in .ear: %1s", unit.getSimpleName()); return; } VFSDeploymentUnit vfsunit = VFSDeploymentUnit.class.cast(unit); deploy(vfsunit); }