[jboss-cvs] JBossAS SVN: r60708 - in projects/microcontainer/trunk/deployers/src: resources/tests and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Feb 20 01:56:01 EST 2007


Author: scott.stark at jboss.org
Date: 2007-02-20 01:56:01 -0500 (Tue, 20 Feb 2007)
New Revision: 60708

Added:
   projects/microcontainer/trunk/deployers/src/resources/tests/jaxp/
   projects/microcontainer/trunk/deployers/src/tests/org/jboss/test/deployers/jaxp/
Modified:
   projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/JAXPDeployer.java
Log:
JBMICROCONT-144, check for a Document attachment to allow for management overrides.

Modified: projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/JAXPDeployer.java
===================================================================
--- projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/JAXPDeployer.java	2007-02-20 06:44:19 UTC (rev 60707)
+++ projects/microcontainer/trunk/deployers/src/main/org/jboss/deployers/plugins/deployers/helpers/JAXPDeployer.java	2007-02-20 06:56:01 UTC (rev 60708)
@@ -33,11 +33,17 @@
 import org.xml.sax.InputSource;
 
 /**
- * SchemaResolverDeployer.
+ * JAXPDeployer is an abstract deployer that overrides parse to run a jaxp
+ * parse of the VirtualFile passed to parse.
  * 
+ * 
+ * @see #parse(DeploymentUnit, VirtualFile, T)
+ * @see #doParse(DeploymentUnit, VirtualFile)
+ * 
  * @param <T> the expected type 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision: 1.1 $
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 60707 $
  */
 public abstract class JAXPDeployer<T> extends AbstractParsingDeployer<T>
 {
@@ -145,7 +151,15 @@
     */
    protected T parse(DeploymentUnit unit, VirtualFile file, T root) throws Exception
    {
-      Document document = doParse(unit, file);
+      // First look for an existing Document attachment 
+      Document document = unit.getAttachment(Document.class);
+      if( document == null )
+      {
+         // Next parse the metadata file
+         document = doParse(unit, file);
+      }
+
+      // Transform the document into a T instance
       return parse(unit, file, document);
    }
    

Copied: projects/microcontainer/trunk/deployers/src/resources/tests/jaxp (from rev 60707, projects/microcontainer/branches/2_0/deployers/src/resources/tests/jaxp)

Copied: projects/microcontainer/trunk/deployers/src/tests/org/jboss/test/deployers/jaxp (from rev 60707, projects/microcontainer/branches/2_0/deployers/src/tests/org/jboss/test/deployers/jaxp)




More information about the jboss-cvs-commits mailing list