Index: server/src/main/java/org/jboss/deployment/EARContentsDeployer.java =================================================================== --- server/src/main/java/org/jboss/deployment/EARContentsDeployer.java (revision 102183) +++ server/src/main/java/org/jboss/deployment/EARContentsDeployer.java (revision ) @@ -34,24 +34,19 @@ import org.jboss.metadata.ear.jboss.JBoss50AppMetaData; import org.jboss.metadata.ear.jboss.JBossAppMetaData; import org.jboss.metadata.ear.jboss.ServiceModuleMetaData; -import org.jboss.metadata.ear.spec.AbstractModule; -import org.jboss.metadata.ear.spec.ConnectorModuleMetaData; -import org.jboss.metadata.ear.spec.EjbModuleMetaData; -import org.jboss.metadata.ear.spec.JavaModuleMetaData; -import org.jboss.metadata.ear.spec.ModuleMetaData; -import org.jboss.metadata.ear.spec.ModulesMetaData; -import org.jboss.metadata.ear.spec.WebModuleMetaData; +import org.jboss.metadata.ear.spec.*; import org.jboss.vfs.VFSUtils; import org.jboss.vfs.VirtualFile; /** * An implicit application.xml type of deployer. This deployer runs if * there is no META-INF/application.xml to identify - * {@link #scanEar(VirtualFile, JBossAppMetaData)} + * {@link #scanEar(VFSDeploymentUnit, VirtualFile, JBossAppMetaData)} * * @author Bill Burke * @author Scott.Stark@jboss.org * @author adrian@jboss.org + * @author ales.justin@jboss.org * @version $Revision: 102183 $ */ public class EARContentsDeployer extends AbstractDeployer @@ -62,15 +57,15 @@ /** * Create the EARContentsDeployer and register as a DeploymentStage.PARSE * stage deployer with JBossAppMetaData output. - * + * - * @param appParsingOrder - the AppParsingDeployer relative order - * used to ensure EARContentsDeployer runs after AppParsingDeployer. + * We need to run after AppParsingDeployer. */ - public EARContentsDeployer(int appParsingOrder) + public EARContentsDeployer() { setStage(DeploymentStages.PARSE); - setRelativeOrder(appParsingOrder+1); + setInput(EarMetaData.class); setOutput(JBossAppMetaData.class); + setTopLevelOnly(true); } public boolean isRequiresEarSuffix() @@ -84,11 +79,13 @@ public void deploy(DeploymentUnit unit) throws DeploymentException { - // Ignore non-parent deployments - if (unit.getParent() != null) + /* If there is a META-INF/application.xml we don't process this. */ + if (unit.isAttachmentPresent(EarMetaData.class)) { + log.trace("Ignoring ear with META-INF/application.xml: " + unit.getSimpleName()); return; } + // Ignore non-vfs deployments if (unit instanceof VFSDeploymentUnit == false) { @@ -102,23 +99,15 @@ return; } VFSDeploymentUnit vfsunit = VFSDeploymentUnit.class.cast(unit); - /* If there is a META-INF/application.xml we don't process this. - * This is probably unnecessary? - */ - VirtualFile appXml = vfsunit.getMetaDataFile("application.xml"); - if( appXml != null ) - { - log.trace("Ignoring ear with META-INF/application.xml: " + unit.getSimpleName()); - return; - } deploy(vfsunit); } /** - * Entry point for handling a VFSDeploymentUnit - * @param unit - * @throws DeploymentException + * Entry point for handling a VFSDeploymentUnit. + * + * @param unit the current deployment unit + * @throws DeploymentException for any error */ public void deploy(VFSDeploymentUnit unit) throws DeploymentException { Index: server/src/main/java/org/jboss/deployment/JBossAppParsingDeployer.java =================================================================== --- server/src/main/java/org/jboss/deployment/JBossAppParsingDeployer.java (revision 82920) +++ server/src/main/java/org/jboss/deployment/JBossAppParsingDeployer.java (revision ) @@ -35,6 +35,7 @@ * @author Scott.Stark@jboss.org * @author Anil.Saldhana@redhat.com * @author adrian@jboss.org + * @author ales.justin@jboss.org * @version $Revision: 82920 $ */ @JMX(name="jboss.j2ee:service=EARDeployer", exposedInterface=JBossAppParsingDeployerMBean.class) @@ -50,10 +51,17 @@ public JBossAppParsingDeployer() { super(JBossAppMetaData.class); - //setInput(JBoss50Aporg.jboss.metadata.ear.spec.EarMetaDatapMetaData.class); + setInput(EarMetaData.class); + setInput(JBossAppMetaData.class); // EarContentsDeployer can produce it setName("jboss-app.xml"); } + @Override + protected boolean allowsReparse() + { + return true; // EarContentsDeployer can produce it already + } + /** * Get the virtual file path for the application descriptor in the * DeploymentContext.getMetaDataPath. @@ -104,21 +112,29 @@ /** * Specify an unauthenticated identity - * @param unauthenticatedIdentity + * @param unauthenticatedIdentity ui flag */ public void setUnauthenticatedIdentity(String unauthenticatedIdentity) { this.unauthenticatedIdentity = unauthenticatedIdentity; } - // FIXME This should all be in a seperate deployer @Override protected void createMetaData(DeploymentUnit unit, String name, String suffix) throws DeploymentException { - super.createMetaData(unit, name, suffix); EarMetaData specMetaData = unit.getAttachment(EarMetaData.class); - JBossAppMetaData metaData = unit.getAttachment(JBossAppMetaData.class); + JBossAppMetaData metaData = unit.getAttachment(JBossAppMetaData.class); // from ear contents deployer + + // do parse + super.createMetaData(unit, name, suffix); + // new parsed metadata + JBossAppMetaData parsed = unit.getAttachment(JBossAppMetaData.class); + if (metaData == null) + metaData = parsed; + else + metaData.merge(parsed, metaData); // TODO - what's override and/or original here? + if(specMetaData == null && metaData == null) return;