[jboss-cvs] JBossAS SVN: r96033 - in trunk/server/src/main/java/org/jboss: web/deployers and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Nov 5 00:10:01 EST 2009


Author: remy.maucherat at jboss.com
Date: 2009-11-05 00:09:58 -0500 (Thu, 05 Nov 2009)
New Revision: 96033

Modified:
   trunk/server/src/main/java/org/jboss/deployment/AnnotationMetaDataDeployer.java
   trunk/server/src/main/java/org/jboss/deployment/JBossWebAppParsingDeployer.java
   trunk/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java
Log:
- The new processing needs the real raw meta data. Overall, I don't understand the purpose
  or the merging (twice in most cases) which occurs in JBossWebAppParsingDeployer.
- Skip annotations for WARs to avoid processing twice.

Modified: trunk/server/src/main/java/org/jboss/deployment/AnnotationMetaDataDeployer.java
===================================================================
--- trunk/server/src/main/java/org/jboss/deployment/AnnotationMetaDataDeployer.java	2009-11-05 04:59:12 UTC (rev 96032)
+++ trunk/server/src/main/java/org/jboss/deployment/AnnotationMetaDataDeployer.java	2009-11-05 05:09:58 UTC (rev 96033)
@@ -90,7 +90,12 @@
    {
       if (unit instanceof VFSDeploymentUnit == false)
          return;
-      
+
+      if (unit.getSimpleName().endsWith(".war"))
+      {
+         return;
+      }
+
       VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
       deploy(vfsDeploymentUnit);
    }

Modified: trunk/server/src/main/java/org/jboss/deployment/JBossWebAppParsingDeployer.java
===================================================================
--- trunk/server/src/main/java/org/jboss/deployment/JBossWebAppParsingDeployer.java	2009-11-05 04:59:12 UTC (rev 96032)
+++ trunk/server/src/main/java/org/jboss/deployment/JBossWebAppParsingDeployer.java	2009-11-05 05:09:58 UTC (rev 96033)
@@ -90,7 +90,10 @@
       // Set the merged as the output
       unit.getTransientManagedObjects().addAttachment(JBossWebMetaData.class, mergedMetaData);
       // Keep the raw parsed metadata as well
-      unit.addAttachment("Raw"+JBossWebMetaData.class.getName(), metaData, JBossWebMetaData.class);
+      if (unit.getAttachment("Raw"+JBossWebMetaData.class.getName()) == null)
+      {
+         unit.addAttachment("Raw"+JBossWebMetaData.class.getName(), metaData, JBossWebMetaData.class);
+      }
    }
 
    /**
@@ -102,12 +105,14 @@
    {
       super.createMetaData(unit, name, suffix, key);
       
-      WebMetaData wmd = unit.getTransientManagedObjects().getAttachment(WebMetaData.class);
       JBossWebMetaData result = unit.getTransientManagedObjects().getAttachment(getOutput());
-      if (result == null && wmd != null)
+      if (result != null && unit.getAttachment("Raw"+JBossWebMetaData.class.getName()) == null)
       {
+         unit.addAttachment("Raw"+JBossWebMetaData.class.getName(), result, JBossWebMetaData.class);
+      }
+      if (result == null)
+      {
          result = new JBossWebMetaData();
-         result.merge(null, wmd);
          unit.getTransientManagedObjects().addAttachment(key, result, getOutput());
       }
    }

Modified: trunk/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java
===================================================================
--- trunk/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java	2009-11-05 04:59:12 UTC (rev 96032)
+++ trunk/server/src/main/java/org/jboss/web/deployers/MergedJBossWebMetaDataDeployer.java	2009-11-05 05:09:58 UTC (rev 96033)
@@ -98,7 +98,7 @@
    public void deploy(DeploymentUnit unit) throws DeploymentException
    {
       WebMetaData specMetaData = unit.getAttachment(WebMetaData.class);
-      JBossWebMetaData metaData = unit.getAttachment(JBossWebMetaData.class);
+      JBossWebMetaData metaData = (JBossWebMetaData) unit.getAttachment("Raw"+JBossWebMetaData.class.getName());
       if(specMetaData == null && metaData == null)
          return;
 




More information about the jboss-cvs-commits mailing list