[jboss-cvs] JBossAS SVN: r63728 - in trunk/server: src/etc/conf/default and 7 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 28 13:23:57 EDT 2007


Author: adrian at jboss.org
Date: 2007-06-28 13:23:56 -0400 (Thu, 28 Jun 2007)
New Revision: 63728

Modified:
   trunk/server/.classpath
   trunk/server/src/etc/conf/default/bootstrap-beans.xml
   trunk/server/src/etc/deployers/client-deployer-beans.xml
   trunk/server/src/etc/deployers/ear-deployer-beans.xml
   trunk/server/src/etc/deployers/ejb-deployer-beans.xml
   trunk/server/src/etc/deployers/security-deployer-beans.xml
   trunk/server/src/main/org/jboss/deployment/AppParsingDeployer.java
   trunk/server/src/main/org/jboss/deployment/ClientDeployer.java
   trunk/server/src/main/org/jboss/deployment/EARDeployment.java
   trunk/server/src/main/org/jboss/deployment/EARInitializingDeployer.java
   trunk/server/src/main/org/jboss/deployment/EARStructure.java
   trunk/server/src/main/org/jboss/deployment/EjbParsingDeployer.java
   trunk/server/src/main/org/jboss/deployment/JBossAppParsingDeployer.java
   trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java
   trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java
   trunk/server/src/main/org/jboss/deployment/JaccCommitDeployer.java
   trunk/server/src/main/org/jboss/deployment/JaccInitializationDeployer.java
   trunk/server/src/main/org/jboss/deployment/WebAppParsingDeployer.java
   trunk/server/src/main/org/jboss/deployment/security/JaccPolicyUtil.java
   trunk/server/src/main/org/jboss/deployment/security/SecurityDeployer.java
   trunk/server/src/main/org/jboss/ejb/Container.java
   trunk/server/src/main/org/jboss/ejb/EjbModule.java
   trunk/server/src/main/org/jboss/ejb/EjbUtil.java
   trunk/server/src/main/org/jboss/ejb/EjbUtil50.java
   trunk/server/src/main/org/jboss/ejb/deployers/EjbDeployer.java
   trunk/server/src/main/org/jboss/web/WebApplication.java
   trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
   trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java
   trunk/server/src/main/org/jboss/web/deployers/WebModule.java
Log:
Deployers reloaded

Modified: trunk/server/.classpath
===================================================================
--- trunk/server/.classpath	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/.classpath	2007-06-28 17:23:56 UTC (rev 63728)
@@ -27,17 +27,21 @@
 	<classpathentry kind="lib" path="/thirdparty/jboss/security/lib/jbosssx.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/security-spi/lib/jboss-security-spi.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/system-jmx"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-src.zip"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/transaction"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-container.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-container-src.zip"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-dependency-src.zip"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-container.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-container-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-dependency.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-dependency-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbossws/lib/jboss-jaxrpc.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbossws/lib/jboss-saaj.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jbossws-spi/lib/jbossws-spi.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs.jar" sourcepath="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs-sources.jar"/>
 	<classpathentry kind="lib" path="/thirdparty/dom4j/lib/dom4j.jar"/>
-	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-microcontainer-src.zip"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-kernel.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-kernel-sources.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/security"/>
 	<classpathentry kind="lib" path="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee.jar" sourcepath="/thirdparty/jboss/jboss-javaee/lib/jboss-javaee-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-client-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-core-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-structure-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-spi-sources.jar"/>
+	<classpathentry kind="lib" path="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi.jar" sourcepath="/thirdparty/jboss/microcontainer/lib/jboss-deployers-vfs-spi-sources.jar"/>
 	<classpathentry kind="output" path="output/eclipse-classes"/>
 </classpath>

Modified: trunk/server/src/etc/conf/default/bootstrap-beans.xml
===================================================================
--- trunk/server/src/etc/conf/default/bootstrap-beans.xml	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/etc/conf/default/bootstrap-beans.xml	2007-06-28 17:23:56 UTC (rev 63728)
@@ -69,111 +69,128 @@
    </bean>
 
    <!-- The MainDeployer -->
-   <bean name="MainDeployer" class="org.jboss.deployers.plugins.deployment.MainDeployerImpl">
-      <property name="structureDeployers">
-         <list>
-            <!-- A declared structure descriptor deployer -->
-            <bean name="DeclaredStructure" class="org.jboss.deployers.plugins.structure.vfs.explicit.DeclaredStructure">
-            </bean>
+   <bean name="MainDeployer" class="org.jboss.deployers.plugins.main.MainDeployerImpl">
+      <property name="structuralDeployers"><inject bean="StructuralDeployers"/></property>
+      <property name="deployers"><inject bean="Deployers"/></property>
+   </bean>
 
-            <!-- WAR Structure -->
-            <bean name="WARStructure" class="org.jboss.deployers.plugins.structure.vfs.war.WARStructure">
-               <property name="webInfLibFilter">
-                  <!-- We accept all .jar files in WEB-INF/lib -->
-                  <bean name="WebInfLibFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter">
-                     <constructor><parameter class="java.lang.String">.jar</parameter></constructor>
-                  </bean>
-               </property>
-            </bean>
-            <!-- JAR Structure -->
-            <bean name="JARStructure" class="org.jboss.deployers.plugins.structure.vfs.jar.JARStructure">
-                  <!-- Unless specified the default list of suffixes is .zip, .ear, .jar, ,.rar, .war, .sar, .har, .aop -->
-               <constructor>
-                  <parameter>
-                     <set elementClass="java.lang.String">
-                        <value>.zip</value>
-                        <value>.ear</value>
-                        <value>.jar</value>
-                        <value>.rar</value>
-                        <value>.war</value>
-                        <value>.sar</value>
-                        <value>.har</value>
-                        <value>.aop</value>
-                        <value>.deployer</value>
-                        <value>.beans</value>
-                     </set>
-                  </parameter>
-               </constructor>
-               <property name="candidateStructureVisitorFactory">
-                  <!-- Any file that is not an ordinary directory is a candidate -->
-                  <bean name="JARStructureCandidates" class="org.jboss.deployers.plugins.structure.vfs.jar.JARCandidateStructureVisitorFactory">
-                     <!-- A filter to exclude some obvious non-subdeployments -->
-                     <property name="filter">
-                        <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
-                           <constructor><parameter>
-                              <list elementClass="java.lang.String">
-                                 <!-- Exclude class files as subdeployments -->
-                                 <value>.class</value>
-                              </list>
-                           </parameter></constructor>
-                        </bean>
-                     </property>
-                  </bean>
-               </property>
-            </bean>
-            <!-- File Structure -->
-            <bean name="FileStructure" class="org.jboss.deployers.plugins.structure.vfs.file.FileStructure">
-                  <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
-               <constructor>
-                  <parameter>
-                     <set elementClass="java.lang.String">
-                        <value>-service.xml</value>
-                        <value>-beans.xml</value>
-                        <value>-ds.xml</value>
-                        <value>-aop.xml</value>
-                     </set>
-                  </parameter>
-               </constructor>
-            </bean>
-         </list>
+   <!-- The holder for deployers that determine structure -->
+   <bean name="StructuralDeployers" class="org.jboss.deployers.vfs.plugins.structure.VFSStructuralDeployersImpl">
+      <property name="structureBuilder">
+         <!-- The consolidator of the structure information -->
+         <bean name="StructureBuilder" class="org.jboss.deployers.vfs.plugins.structure.VFSStructureBuilder"/>
       </property>
-      <property name="deployers">
-         <list>
-            <!-- AOP deployment -->
-            <bean name="AspectDeployer" class="org.jboss.aop.deployers.AspectDeployer">
-               <property name="type">aop</property>
-               <depends>AspectManager</depends>
-            </bean>
-            <!-- POJO Deployment -->
-            <bean name="BeanDeployer" class="org.jboss.deployers.plugins.deployers.kernel.BeanDeployer">
-               <property name="type">beans</property>
-            </bean>
-            <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.plugins.deployers.kernel.KernelDeploymentDeployer">
-               <property name="type">beans</property>
-            </bean>
-            <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.plugins.deployers.kernel.BeanMetaDataDeployer">
-               <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
-               <property name="type">beans</property>
-            </bean>
-            <!-- JMX Deployment -->
-            <bean name="SARDeployer" class="org.jboss.system.deployers.SARDeployer">
-               <property name="type">sar</property>
-            </bean>
-            <bean name="ServiceClassLoaderDeployer" class="org.jboss.system.deployers.ServiceClassLoaderDeployer">
-               <constructor><parameter><inject bean="JMXKernel" property="serviceController"/></parameter></constructor>
-            </bean>
-            <bean name="ServiceDeploymentDeployer" class="org.jboss.system.deployers.ServiceDeploymentDeployer">
-               <property name="type">sar</property>
-            </bean>
-            <bean name="ServiceDeployer" class="org.jboss.system.deployers.ServiceDeployer">
-               <constructor><parameter><inject bean="JMXKernel" property="serviceController"/></parameter></constructor>
-               <property name="type">sar</property>
-            </bean>
-         </list>
-      </property>
-      <depends>AspectManager</depends>
+      <!-- Accept any implementor of structure deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
    </bean>
+      
+   <!-- The holder for deployers that do real deployment -->
+   <bean name="Deployers" class="org.jboss.deployers.plugins.deployers.DeployersImpl">
+      <constructor><parameter><inject bean="jboss.kernel:service=KernelController"/></parameter></constructor>
+      <!-- Accept any implementor of deployer -->
+      <incallback method="addDeployer"/>
+      <uncallback method="removeDeployer"/>
+   </bean>
 
+   <!-- A declared structure descriptor deployer -->
+   <bean name="DeclaredStructure" class="org.jboss.deployers.vfs.plugins.structure.explicit.DeclaredStructure"></bean>
+
+   <!-- WAR Structure -->
+   <bean name="WARStructure" class="org.jboss.deployers.vfs.plugins.structure.war.WARStructure">
+       <property name="webInfLibFilter">
+          <!-- We accept all .jar files in WEB-INF/lib -->
+          <bean name="WebInfLibFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter">
+             <constructor><parameter class="java.lang.String">.jar</parameter></constructor>
+          </bean>
+       </property>
+    </bean>
+
+    <!-- JAR Structure -->
+    <bean name="JARStructure" class="org.jboss.deployers.vfs.plugins.structure.jar.JARStructure">
+       <!-- Unless specified the default list of suffixes is .zip, .ear, .jar, ,.rar, .war, .sar, .har, .aop -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>.zip</value>
+                <value>.ear</value>
+                <value>.jar</value>
+                <value>.rar</value>
+                <value>.war</value>
+                <value>.sar</value>
+                <value>.har</value>
+                <value>.aop</value>
+                <value>.deployer</value>
+                <value>.beans</value>
+             </set>
+          </parameter>
+       </constructor>
+       <property name="candidateStructureVisitorFactory">
+          <!-- Any file that is not an ordinary directory is a candidate -->
+          <bean name="JARStructureCandidates" class="org.jboss.deployers.vfs.spi.structure.helpers.DefaultCandidateStructureVisitorFactory">
+             <!-- A filter to exclude some obvious non-subdeployments -->
+             <property name="filter">
+                <bean name="JARFilter" class="org.jboss.virtual.plugins.vfs.helpers.SuffixesExcludeFilter">
+                   <constructor><parameter>
+                      <list elementClass="java.lang.String">
+                         <!-- Exclude class files as subdeployments -->
+                         <value>.class</value>
+                      </list>
+                   </parameter></constructor>
+                </bean>
+             </property>
+          </bean>
+       </property>
+    </bean>
+
+    <!-- File Structure -->
+    <bean name="FileStructure" class="org.jboss.deployers.vfs.plugins.structure.file.FileStructure">
+       <!-- Unless specified the default list of suffixes is -service.xml, -beans.xml, -ds.xml, -aop.xml -->
+       <constructor>
+          <parameter>
+             <set elementClass="java.lang.String">
+                <value>-service.xml</value>
+                <value>-beans.xml</value>
+                <value>-ds.xml</value>
+                <value>-aop.xml</value>
+             </set>
+          </parameter>
+       </constructor>
+    </bean>
+
+    <!-- AOP deployment -->
+    <bean name="AspectDeployer" class="org.jboss.aop.deployers.temp.AspectDeployer">
+       <property name="type">aop</property>
+       <property name="aspectManager"><inject bean="AspectManager" property="aspectManager"/></property>
+   </bean>
+
+   <!-- POJO Deployment -->
+   <bean name="BeanDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="KernelDeploymentDeployer" class="org.jboss.deployers.vfs.deployer.kernel.KernelDeploymentDeployer">
+      <property name="type">beans</property>
+   </bean>
+   <bean name="BeanMetaDataDeployer" class="org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer">
+      <constructor><parameter><inject bean="jboss.kernel:service=Kernel"/></parameter></constructor>
+      <property name="type">beans</property>
+   </bean>
+
+   <!-- JMX Deployment -->
+   <bean name="SARDeployer" class="org.jboss.system.deployers.SARDeployer">
+      <property name="type">sar</property>
+   </bean>
+   <bean name="ServiceClassLoaderDeployer" class="org.jboss.system.deployers.ServiceClassLoaderDeployer">
+      <constructor><parameter><inject bean="JMXKernel" property="serviceController"/></parameter></constructor>
+   </bean>
+   <bean name="ServiceDeploymentDeployer" class="org.jboss.system.deployers.ServiceDeploymentDeployer">
+       <property name="type">sar</property>
+   </bean>
+   <bean name="ServiceDeployer" class="org.jboss.system.deployers.ServiceDeployer">
+       <constructor><parameter><inject bean="JMXKernel" property="serviceController"/></parameter></constructor>
+       <property name="type">sar</property>
+   </bean>
+
 	<!-- MBean for making sure that the underlying AspectManagerService gets registered in JMX -->
 	<bean name="AspectManagerJMXRegistrar" class="org.jboss.aop.deployers.AspectManagerJMXRegistrar">
 	   <property name="mbeanServer"><inject bean="JMXKernel" property="mbeanServer"/></property>

Modified: trunk/server/src/etc/deployers/client-deployer-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/client-deployer-beans.xml	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/etc/deployers/client-deployer-beans.xml	2007-06-28 17:23:56 UTC (rev 63728)
@@ -6,16 +6,6 @@
 <deployment xmlns="urn:jboss:bean-deployer:2.0">
 
    <bean name="AppClientDeployer" class="org.jboss.deployment.ClientDeployer">
-      <install bean="MainDeployer" method="addDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </install>
-      <uninstall bean="MainDeployer" method="removeDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </uninstall>
-      <property name="mainDeployer"><inject bean="MainDeployer" /></property>
+      <property name="mainDeployer"><inject bean="MainDeployer"/></property>
    </bean>
 </deployment>
\ No newline at end of file

Modified: trunk/server/src/etc/deployers/ear-deployer-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/ear-deployer-beans.xml	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/etc/deployers/ear-deployer-beans.xml	2007-06-28 17:23:56 UTC (rev 63728)
@@ -5,45 +5,14 @@
 -->
 <deployment xmlns="urn:jboss:bean-deployer:2.0">
 
-   <bean name="EARStructureDeployer" class="org.jboss.deployment.EARStructure">
-      <install bean="MainDeployer" method="addStructureDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </install>
-      <uninstall bean="MainDeployer" method="removeStructureDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </uninstall>
-   </bean>
+   <bean name="EARStructureDeployer" class="org.jboss.deployment.EARStructure"/>
 
    <bean name="AppParsingDeployer" class="org.jboss.deployment.AppParsingDeployer">
-      <install bean="MainDeployer" method="addDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </install>
-      <uninstall bean="MainDeployer" method="removeDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </uninstall>
       <property name="type">ear</property>
       <property name="useSchemaValidation">true</property>
-      <property name="useValidation">false</property>
+      <!-- What is this? property name="useValidation">false</property -->
    </bean>
    <bean name="JBossAppParsingDeployer" class="org.jboss.deployment.JBossAppParsingDeployer">
-      <install bean="MainDeployer" method="addDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </install>
-      <uninstall bean="MainDeployer" method="removeDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </uninstall>
       <property name="type">ear</property>
       <!-- A flag indicating if ear deployments should have their own scoped
          class loader to isolate their classes from other deployments.

Modified: trunk/server/src/etc/deployers/ejb-deployer-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/ejb-deployer-beans.xml	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/etc/deployers/ejb-deployer-beans.xml	2007-06-28 17:23:56 UTC (rev 63728)
@@ -6,38 +6,15 @@
 
    <!-- ejb-jar.xml parsing deployer -->
    <bean name="Ejb2ParsingDeployer" class="org.jboss.deployment.EjbParsingDeployer">
-      <install bean="MainDeployer" method="addDeployer">
-         <parameter><this/></parameter>
-      </install>
-      <uninstall bean="MainDeployer" method="removeDeployer">
-         <parameter><this/></parameter>
-      </uninstall>
       <property name="type">ejb2x</property>      
       <property name="relativeOrder">3000</property>
    </bean>
    <bean name="JBossEjb2ParsingDeployer" class="org.jboss.deployment.JBossEjbParsingDeployer">
-      <install bean="MainDeployer" method="addDeployer">
-         <parameter><this/></parameter>
-      </install>
-      <uninstall bean="MainDeployer" method="removeDeployer">
-         <parameter><this/></parameter>
-      </uninstall>
       <property name="type">ejb2x</property>      
       <property name="relativeOrder">3001</property>
    </bean>
 
     <bean name="EJB2xDeployer" class="org.jboss.ejb.deployers.EjbDeployer">
-        <install bean="MainDeployer" method="addDeployer">
-            <parameter>
-                <this/>
-            </parameter>
-        </install>
-        <uninstall bean="MainDeployer" method="removeDeployer">
-            <parameter>
-                <this/>
-            </parameter>
-        </uninstall>
-
         <!-- The EJBDeployer needs the JTA transaction manager service -->
         <property name="transactionManagerServiceName">jboss:service=TransactionManager</property>
        <!-- The dynamic class loading simple web server -->

Modified: trunk/server/src/etc/deployers/security-deployer-beans.xml
===================================================================
--- trunk/server/src/etc/deployers/security-deployer-beans.xml	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/etc/deployers/security-deployer-beans.xml	2007-06-28 17:23:56 UTC (rev 63728)
@@ -5,16 +5,6 @@
 -->
 <deployment xmlns="urn:jboss:bean-deployer:2.0"> 
    <bean name="SecurityDeployer" class="org.jboss.deployment.security.SecurityDeployer">
-      <install bean="MainDeployer" method="addDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </install>
-      <uninstall bean="MainDeployer" method="removeDeployer">
-         <parameter>
-            <this/>
-         </parameter>
-      </uninstall>
       <property name="type">security</property>
       <property name="ignoreSuffixes">
           <set elementClass="java.lang.String">

Modified: trunk/server/src/main/org/jboss/deployment/AppParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/AppParsingDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/AppParsingDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,10 +21,7 @@
  */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
+import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
 import org.jboss.xb.binding.ObjectModelFactory;
 
 /**
@@ -32,16 +29,15 @@
  * J2eeApplicationMetaData instances.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision:$
  */
 public class AppParsingDeployer extends ObjectModelFactoryDeployer<J2eeApplicationMetaData>
 {
-   /** The name of the application descriptor in the deployment context metadata path */
-   private String appXmlPath = "application.xml";
-
    public AppParsingDeployer()
    {
       super(J2eeApplicationMetaData.class);
+      setName("application.xml");
    }
 
    /**
@@ -52,8 +48,9 @@
     */
    public String getAppXmlPath()
    {
-      return appXmlPath;
+      return getName();
    }
+   
    /**
     * Set the virtual file path for the application descriptor in the
     * DeploymentContext.getMetaDataLocation. The standard path is application.xml
@@ -63,7 +60,7 @@
     */
    public void setAppXmlPath(String appXmlPath)
    {
-      this.appXmlPath = appXmlPath;
+      setName(appXmlPath);
    }
 
    /**
@@ -75,14 +72,4 @@
    {
       return new J2eeApplicationObjectFactory();
    }
-
-   /**
-    * Overriden to invoke createMetaData(unit, appXmlPath, null) to parse any
-    * appXmlPath descriptor into a J2eeApplicationMetaData instance.
-    */
-   @Override
-   public void deploy(DeploymentUnit unit) throws DeploymentException
-   {
-      createMetaData(unit, appXmlPath, null);
-   }
 }

Modified: trunk/server/src/main/org/jboss/deployment/ClientDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/ClientDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/ClientDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -26,22 +26,18 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
-import java.net.URLClassLoader;
 import java.util.HashMap;
 import java.util.Iterator;
 
-import javax.management.MBeanServer;
 import javax.naming.Context;
 import javax.naming.InitialContext;
 import javax.naming.LinkRef;
 import javax.naming.NamingException;
 
-import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.classloader.ClassLoaderFactory;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.ejb.EjbUtil50;
 import org.jboss.metadata.ClientMetaData;
 import org.jboss.metadata.EjbRefMetaData;
@@ -64,20 +60,29 @@
  *
  * @author Scott.Stark at jboss.org
  * @author Thomas.Diesler at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision$
  */
-public class ClientDeployer extends AbstractSimpleDeployer
+public class ClientDeployer extends AbstractVFSRealDeployer
 {
    private static final String APPLICATION_CLIENT_XML = "application-client.xml";
    private static final String JBOSS_CLIENT_XML = "jboss-client.xml";
 
-   private MainDeployer mainDeployer;
+   private MainDeployerStructure mainDeployer;
 
-   public MainDeployer getMainDeployer()
+   /**
+    * Create a new ClientDeployer.
+    */
+   public ClientDeployer()
    {
+      setOutput(ClientMetaData.class);
+   }
+   
+   public MainDeployerStructure getMainDeployer()
+   {
       return mainDeployer;
    }
-   public void setMainDeployer(MainDeployer mainDeployer)
+   public void setMainDeployer(MainDeployerStructure mainDeployer)
    {
       this.mainDeployer = mainDeployer;
    }
@@ -86,7 +91,7 @@
     * This method looks to the deployment for a META-INF/application-client.xml
     * descriptor to identify a j2ee client jar.
     */
-   private boolean accepts(DeploymentUnit unit) throws DeploymentException
+   private boolean accepts(VFSDeploymentUnit unit) throws DeploymentException
    {
       boolean accepts = false;
 
@@ -136,14 +141,10 @@
    }
 
    @Override
-   public void deploy(DeploymentUnit unit) throws org.jboss.deployers.spi.DeploymentException
+   public void deploy(VFSDeploymentUnit unit) throws org.jboss.deployers.spi.DeploymentException
    {
-      boolean isComponent = unit.getDeploymentContext().isComponent();
-      if (isComponent == false && accepts(unit))
+      if (accepts(unit))
       {
-         // Create the resource class loader
-         unit.createClassLoader(new RootURLClassLoaderFactory(unit));
-         
          // TODO: externalize in parser deployer
          ClientMetaData metaData = buildClientMetaData(unit);
          unit.addAttachment(ClientMetaData.class, metaData);
@@ -160,11 +161,10 @@
    }
 
    @Override
-   public void undeploy(DeploymentUnit unit)
+   public void undeploy(VFSDeploymentUnit unit)
    {
-      boolean isComponent = unit.getDeploymentContext().isComponent();
       ClientMetaData metaData = unit.getAttachment(ClientMetaData.class);
-      if (isComponent == false && metaData != null)
+      if (metaData != null)
       {
          // Teardown the JNDI context
          String appClientName = metaData.getJndiName();
@@ -181,7 +181,7 @@
       }
    }
 
-   private ClientMetaData buildClientMetaData(DeploymentUnit unit) throws DeploymentException
+   private ClientMetaData buildClientMetaData(VFSDeploymentUnit unit) throws DeploymentException
    {
       ClientMetaData metaData = null;
       try
@@ -219,7 +219,7 @@
       return metaData;
    }
 
-   private void setupEnvironment(DeploymentUnit unit, ClientMetaData metaData) throws Exception
+   private void setupEnvironment(VFSDeploymentUnit unit, ClientMetaData metaData) throws Exception
    {
       // Setup a JNDI context which contains
       String appClientName = metaData.getJndiName();
@@ -271,8 +271,8 @@
       }
 
       // Bind <service-ref> elements
-      ClassLoader loader = unit.getClassLoader();
-      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
+      ClassLoader loader = unit.getResourceClassLoader();
+      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getRoot());
       for (ServiceRefMetaData sref : metaData.getServiceRefs().values())
       {
          String refName = sref.getServiceRefName();
@@ -327,31 +327,4 @@
       }
       log.info("Client ENC bound under: " + appClientName);
    }
-
-   static class RootURLClassLoaderFactory implements ClassLoaderFactory
-   {
-      URL rootURL;
-      
-      RootURLClassLoaderFactory(DeploymentUnit unit)
-      {
-         try
-         {
-            rootURL = unit.getDeploymentContext().getRoot().toURL();
-         }
-         catch (Exception ex)
-         {
-            // ignore
-         }
-      }
-
-      public ClassLoader createClassLoader(DeploymentContext context) throws Exception
-      {
-         return new URLClassLoader(new URL[] {rootURL});
-      }
-
-      public void removeClassLoader(DeploymentContext context) throws Exception
-      {
-         // nothing to do
-      }
-   }
 }

Modified: trunk/server/src/main/org/jboss/deployment/EARDeployment.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/EARDeployment.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/EARDeployment.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -25,7 +25,7 @@
 
 import javax.management.ObjectName;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.mx.util.ObjectNameFactory;
 import org.jboss.system.ServiceMBeanSupport;
 
@@ -38,8 +38,6 @@
  *
  * @author <a href="mailto:adrian at jboss.com">Adrian.Brock</a>
  * @version $Revision$
- *
- * @jmx:mbean extends="org.jboss.system.ServiceMBean"
  */
 public class EARDeployment
    extends ServiceMBeanSupport

Modified: trunk/server/src/main/org/jboss/deployment/EARInitializingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/EARInitializingDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/EARInitializingDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -25,25 +25,32 @@
 import javax.security.jacc.PolicyConfigurationFactory;
 import javax.security.jacc.PolicyContextException;
 
-import org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer;
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployerWithInput;
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 
 //$Id$
 
 /**
  *  EAR Deployer that can be used for initialization
  *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
+ *  @author adrian at jboss.org
  *  @since  Dec 6, 2006 
  *  @version $Revision$
  */
 public class EARInitializingDeployer extends AbstractSimpleRealDeployer<J2eeApplicationMetaData>
 {    
+   /**
+    * Create a new EARInitializingDeployer.
+    */
    public EARInitializingDeployer()
    {
       super(J2eeApplicationMetaData.class);
+      setOutput(PolicyConfiguration.class);
    } 
 
+   @Override
    public void deploy(DeploymentUnit unit, J2eeApplicationMetaData deployment) throws DeploymentException
    { 
       //Perform JACC Policy Configuration
@@ -65,7 +72,8 @@
       }
       
    }
- 
+
+   @Override
    public void undeploy(DeploymentUnit unit, J2eeApplicationMetaData deployment)
    {  
       //Perform JACC cleanup for the EAR
@@ -77,6 +85,7 @@
     * A utility method that takes a deployment unit name and strips it down to the base ear
     * name without the .ear suffix.
     * @param name - the DeploymentUnit name.
+    * @return the short name
     */
    public static String shortNameFromDeploymentName(String name)
    {

Modified: trunk/server/src/main/org/jboss/deployment/EARStructure.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/EARStructure.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/EARStructure.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,16 +21,6 @@
  */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.structure.ContextInfoImpl;
-import org.jboss.deployers.plugins.structure.vfs.AbstractStructureDeployer;
-import org.jboss.deployers.spi.structure.vfs.StructureMetaData;
-import org.jboss.deployers.spi.structure.vfs.StructuredDeployers;
-import org.jboss.metadata.XmlFileLoader;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
-import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
-import org.w3c.dom.Element;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.Iterator;
@@ -38,11 +28,23 @@
 import java.util.jar.Attributes;
 import java.util.jar.Manifest;
 
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
+import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
+import org.jboss.metadata.XmlFileLoader;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+import org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter;
+import org.w3c.dom.Element;
+
 /**
  * Structure deployer for EARs.
  *
  * @author Bill Burke
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision: 1.1 $
  */
 public class EARStructure extends AbstractStructureDeployer
@@ -89,26 +91,18 @@
       this.earLibFilter = earLibFilter;
    }
 
-   /**
-    * Determine the structure of the ear.
-    * @param root - a candidate ear file
-    * @param metaData - the structure metadata to populate
-    * @param deployers - the deployer chain to use for subdeployment recoginition.
-    */
-   public boolean determineStructure(VirtualFile root,
-      StructureMetaData metaData, StructuredDeployers deployers)
+   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers)
    {
       boolean valid;
       try
       {
-         if( root.isLeaf() == true || root.getName().endsWith(".ear") == false)
+         if (file.isLeaf() == true || file.getName().endsWith(".ear") == false)
             return false;
 
-         ContextInfoImpl context = new ContextInfoImpl(root.getPathName());
-         context.setMetaDataPath("META-INF");
+         ContextInfo context = StructureMetaDataFactory.createContextInfo(file.getPathName(), "META-INF", null);
 
-         VirtualFile applicationXml = getMetaDataFile(root, "META-INF/application.xml");
-         VirtualFile jbossAppXml = getMetaDataFile(root, "META-INF/jboss-app.xml");
+         VirtualFile applicationXml = getMetaDataFile(file, "META-INF/application.xml");
+         VirtualFile jbossAppXml = getMetaDataFile(file, "META-INF/jboss-app.xml");
          VirtualFile lib;
          J2eeApplicationMetaData j2eeMetaData = new J2eeApplicationMetaData();
          boolean scan = true;
@@ -153,7 +147,7 @@
          {
             try
             {
-               lib = root.findChild(libDir);
+               lib = file.findChild(libDir);
                if (lib != null)
                {
                   List<VirtualFile> archives = lib.getChildren(earLibFilter);
@@ -164,11 +158,11 @@
                      if (archive.findChild("META-INF/persistence.xml") != null)
                      {
                         log.trace(archive.getName() + " in ear lib directory has persistence units");
-                        if (deployers.determineStructure(archive, metaData) == false)
+                        if (deployers.determineStructure(root, file, archive, metaData) == false)
                         {
                            throw new RuntimeException(archive.getName()
                                  + " in lib directory has persistence.xml but is not a recognized deployment, .ear: "
-                                 + root.getName());
+                                 + file.getName());
                         }
                      }
                   }
@@ -181,12 +175,12 @@
          }
 
          // Add the ear manifest locations?
-         super.addClassPath(root, root, false, true, context);
+         super.addClassPath(root, file, false, true, context);
 
          // TODO: need to scan for annotationss
          if( scan )
          {
-            scanEar(root, j2eeMetaData);
+            scanEar(file, j2eeMetaData);
          }
 
          // Create subdeployments for the ear modules
@@ -198,22 +192,22 @@
             {
                try
                {
-                  VirtualFile module = root.findChild(fileName);
+                  VirtualFile module = file.findChild(fileName);
                   if (module == null)
                   {
-                     throw new RuntimeException(fileName + " module listed in application.xml does not exist within .ear " + root.getName());
+                     throw new RuntimeException(fileName + " module listed in application.xml does not exist within .ear " + file.getName());
                   }
                   // Ask the deployers to analyze this
-                  if( deployers.determineStructure(module, metaData) == false )
+                  if( deployers.determineStructure(root, file, module, metaData) == false )
                   {
                      throw new RuntimeException(fileName
                            + " module listed in application.xml is not a recognized deployment, .ear: "
-                           + root.getName());
+                           + file.getName());
                   }
                }
                catch (IOException ignored)
                {
-                  throw new RuntimeException(fileName + " module listed in application.xml does not exist within .ear " + root.getName(), ignored);
+                  throw new RuntimeException(fileName + " module listed in application.xml does not exist within .ear " + file.getName(), ignored);
                }
             }
          }
@@ -222,7 +216,7 @@
       }
       catch(Exception e)
       {
-         throw new RuntimeException("Error determining structure: " + root.getName(), e);         
+         throw new RuntimeException("Error determining structure: " + file.getName(), e);         
       }
 
       return valid;

Modified: trunk/server/src/main/org/jboss/deployment/EjbParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/EjbParsingDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/EjbParsingDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,28 +21,27 @@
  */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
 import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.virtual.VirtualFile;
 
 /**
  * An ObjectModelFactoryDeployer for translating ejb-jar.xml descriptors into
  * ApplicationMetaData instances.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision:$
  */
 public class EjbParsingDeployer extends ObjectModelFactoryDeployer<ApplicationMetaData>
 {
-   /** The name of the ejb descriptor in the deployment context metadata path */
-   private String ejbXmlPath = "ejb-jar.xml";
-
+   /**
+    * Create a new EjbParsingDeployer.
+    */
    public EjbParsingDeployer()
    {
       super(ApplicationMetaData.class);
+      setName("ejb-jar.xml");
    }
 
    /**
@@ -53,8 +52,9 @@
     */
    public String getAppXmlPath()
    {
-      return ejbXmlPath;
+      return getName();
    }
+   
    /**
     * Set the virtual file path for the application descriptor in the
     * DeploymentContext.getMetaDataLocation. The standard path is application.xml
@@ -64,7 +64,7 @@
     */
    public void setAppXmlPath(String ejbXmlPath)
    {
-      this.ejbXmlPath = ejbXmlPath;
+      setName(ejbXmlPath);
    }
 
    /**
@@ -76,22 +76,4 @@
    {
       return new EjbJarObjectFactory();
    }
-
-   /**
-    * Overriden to invoke createMetaData(unit, ejbXmlPath, null) to parse any
-    * ejbXmlPath descriptor into a ApplicationMetaData instance.
-    */
-   @Override
-   public void deploy(DeploymentUnit unit) throws DeploymentException
-   {
-      // make sure it's there is ejb-jar.xml
-      // TODO: also make sure it's ejb2.x module
-      VirtualFile ejbjar = unit.getMetaDataFile("ejb-jar.xml");
-      if (ejbjar == null)
-      {
-         return;
-      }
-
-      createMetaData(unit, ejbXmlPath, null);
-   }
 }

Modified: trunk/server/src/main/org/jboss/deployment/JBossAppParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossAppParsingDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/JBossAppParsingDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -23,12 +23,14 @@
 
 import javax.management.ObjectName;
 
-import org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer;
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.mx.loading.LoaderRepositoryFactory;
 import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
-import org.jboss.xb.binding.ObjectModelFactory; 
+import org.jboss.virtual.VirtualFile;
+import org.jboss.xb.binding.ObjectModelFactory;
 
 /**
  * An ObjectModelFactoryDeployer for translating jboss-app.xml descriptors into
@@ -36,13 +38,11 @@
  * 
  * @author Scott.Stark at jboss.org
  * @author Anil.Saldhana at redhat.com
+ * @author adrian at jboss.org
  * @version $Revision$
  */
 public class JBossAppParsingDeployer extends ObjectModelFactoryDeployer<J2eeApplicationMetaData>
 {
-   /** The name of the application descriptor in the deployment context metadata path */
-   private String appXmlPath = "jboss-app.xml";
-
    private boolean isolated = false;
 
    private boolean callByValue = false;
@@ -50,14 +50,13 @@
    private String unauthenticatedIdentity = null;
 
    /**
-    * Set the relative order to PARSER_DEPLOYER+1 by default so
-    * that this runs after the application.xml parser.
-    *
-    */   
+    * Create a new JBossAppParsingDeployer.
+    */
    public JBossAppParsingDeployer()
    {
       super(J2eeApplicationMetaData.class);
-      setRelativeOrder(PARSER_DEPLOYER+1);
+      setInput(J2eeApplicationMetaData.class);
+      setName("jboss-app.xml");
    }
 
    /**
@@ -68,7 +67,7 @@
     */
    public String getAppXmlPath()
    {
-      return appXmlPath;
+      return getName();
    }
    /**
     * Set the virtual file path for the application descriptor in the
@@ -79,7 +78,7 @@
     */
    public void setAppXmlPath(String appXmlPath)
    {
-      this.appXmlPath = appXmlPath;
+      setName(appXmlPath);
    }
 
    /**
@@ -116,7 +115,8 @@
   
    /**
     * Obtain an unauthenticated identity
-    * @return
+    * 
+    * @return the unauthenticated identity
     */
    public String getUnauthenticatedIdentity()
    {
@@ -153,15 +153,9 @@
       return new JBossApplicationObjectFactory();
    }
 
-   /**
-    * Overriden to invoke createMetaData(unit, appXmlPath, null) to parse any
-    * appXmlPath descriptor into a J2eeApplicationMetaData instance.
-    */
    @Override
-   public void deploy(DeploymentUnit unit) throws DeploymentException
+   protected void init(VFSDeploymentUnit unit, J2eeApplicationMetaData metaData, VirtualFile file) throws Exception
    {
-      createMetaData(unit, appXmlPath, null);
-      
       // Add the loader repository config
       J2eeApplicationMetaData earMetaData = unit.getAttachment(J2eeApplicationMetaData.class);
       if (earMetaData != null)
@@ -179,15 +173,16 @@
       if (callByValue)
          unit.addAttachment("EAR.callByValue", Boolean.TRUE, Boolean.class);
       //Pass the unauthenticated identity
-      if(this.unauthenticatedIdentity != null)
+      if (this.unauthenticatedIdentity != null)
          unit.addAttachment("EAR.uauthenticatedIdentity", this.unauthenticatedIdentity, String.class);
    }
 
    /** Build the ear scoped repository
    *
    * @param metaData the deployment info passed to deploy
+   * @param unit the deployment unit
    * @return LoaderRepositoryConfig to use
-   * @throws Exception
+   * @throws DeploymentException for any error
    */
   protected LoaderRepositoryConfig initLoaderRepository(J2eeApplicationMetaData metaData, DeploymentUnit unit)
      throws DeploymentException
@@ -205,5 +200,4 @@
         throw new DeploymentException("Failed to create LoaderRepositoryConfig", e);
      }
   }
-
 }

Modified: trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/JBossEjbParsingDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,31 +21,37 @@
  */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.deployers.helpers.AttachmentLocator;
-import org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer;
+import java.net.URL;
+
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.deployer.helpers.AttachmentLocator;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.metadata.ApplicationMetaData;
+import org.jboss.system.server.ServerConfig;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
 import org.jboss.xb.binding.ObjectModelFactory;
-import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VFS;
-import org.jboss.system.server.ServerConfig;
 
 /**
  * An ObjectModelFactoryDeployer for translating jboss.xml descriptors into
  * ApplicationMetaData instances.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision:$
  */
 public class JBossEjbParsingDeployer extends ObjectModelFactoryDeployer<ApplicationMetaData>
 {
-   private String jbossXmlPath = "jboss.xml";
-
+   /**
+    * Create a new JBossEjbParsingDeployer.
+    */
    public JBossEjbParsingDeployer()
    {
       super(ApplicationMetaData.class);
-      setRelativeOrder(PARSER_DEPLOYER+1);
+      setInput(ApplicationMetaData.class);
+      setName("jboss.xml");
    }
 
    /**
@@ -56,7 +62,7 @@
     */
    public String getWebXmlPath()
    {
-      return jbossXmlPath;
+      return getName();
    }
    /**
     * Set the virtual file path for the jboss-web descriptor in the
@@ -67,10 +73,24 @@
     */
    public void setWebXmlPath(String jbossXmlPath)
    {
-      this.jbossXmlPath = jbossXmlPath;
+      setName(jbossXmlPath);
    }
 
    /**
+    * Valid the configuration
+    * 
+    * @throws Exception for any problem
+    */
+   public void create() throws Exception
+   {
+      String configPath = System.getProperty(ServerConfig.SERVER_CONFIG_URL);
+      URL configUrl = new URL(configPath);
+      VirtualFile stdJBoss = VFS.getVirtualFile(configUrl, "standardjboss.xml");
+      if (stdJBoss == null)
+         throw new DeploymentException("standardjboss.xml not found in config dir: " + configPath);
+   }
+   
+   /**
     * Overriden to indicate we expect to run the parse even if an existing
     * WebMetaData attachment is found.
     * @return true.
@@ -91,28 +111,9 @@
       return new JBossEjbObjectFactory(root);
    }
 
-   /**
-    * Overriden to invoke createMetaData(unit, jbossXmlPath, null) to parse any
-    * jbossXmlPath descriptor into a ApplicationMetaData instance.
-    */
    @Override
-   public void deploy(DeploymentUnit unit) throws DeploymentException
+   protected void init(VFSDeploymentUnit unit, ApplicationMetaData metaData, VirtualFile file) throws Exception
    {
-      // make sure it's there is ejb-jar.xml
-      // TODO: also make sure it's ejb2.x module (Wolf: added hack in parse)
-      VirtualFile ejbjar = unit.getMetaDataFile("ejb-jar.xml");
-      if (ejbjar == null)
-      {
-         return;
-      }
-
-      log.debug("deploy, unit: "+unit);
-      createMetaData(unit, jbossXmlPath, null);
-
-      ApplicationMetaData metaData = getMetaData(unit, ApplicationMetaData.class.getName());
-      if( metaData == null )
-         return;
-
       // Merge any settings from the ear level
       J2eeApplicationMetaData earMetaData = AttachmentLocator.search(unit, J2eeApplicationMetaData.class);
       if( earMetaData != null )
@@ -122,14 +123,16 @@
             metaData.setSecurityDomain(earMetaData.getSecurityDomain());
          metaData.mergeSecurityRoles(earMetaData.getSecurityRoles());
       }
-
    }
 
+   @Override
    protected ApplicationMetaData parse(DeploymentUnit unit,
                                        String name,
                                        ApplicationMetaData root)
       throws Exception
    {
+      VFSDeploymentUnit vfsDeploymentUnit = (VFSDeploymentUnit) unit;
+
       // Wolf: hack to get to EJB3 deployer
       // FIXME: unify the deployers (JBAS-4506)
       if(root.getEjbVersion() > 2)
@@ -162,15 +165,15 @@
          throw new DeploymentException("standardjboss.xml not found in config dir: " + configPath);
       }
 
-      ApplicationMetaData result = parse(unit, stdJBoss, root);
+      ApplicationMetaData result = parse(vfsDeploymentUnit, stdJBoss, root);
 
       // Try to find the metadata
-      VirtualFile file = unit.getMetaDataFile(name);
+      VirtualFile file = vfsDeploymentUnit.getMetaDataFile(name);
       if (file == null)
          return null;
 
-      result = parse(unit, file, root);
-      init(unit, result, file);
+      result = parse(vfsDeploymentUnit, file, root);
+      init(vfsDeploymentUnit, result, file);
       return result;
    }
 }

Modified: trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/JBossWebAppParsingDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,13 +21,13 @@
  */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.deployers.helpers.AttachmentLocator;
-import org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.spi.deployer.helpers.AttachmentLocator;
+import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.metadata.WebMetaData;
 import org.jboss.metadata.web.JBossWebMetaDataObjectFactory;
 import org.jboss.mx.loading.LoaderRepositoryFactory.LoaderRepositoryConfig;
+import org.jboss.virtual.VirtualFile;
 import org.jboss.xb.binding.ObjectModelFactory;
 
 /**
@@ -35,16 +35,19 @@
  * WebMetaData instances.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision:$
  */
 public class JBossWebAppParsingDeployer extends ObjectModelFactoryDeployer<WebMetaData>
 {
-   private String webXmlPath = "jboss-web.xml";
-
+   /**
+    * Create a new JBossWebAppParsingDeployer.
+    */
    public JBossWebAppParsingDeployer()
    {
       super(WebMetaData.class);
-      setRelativeOrder(PARSER_DEPLOYER+1);
+      setInput(WebMetaData.class);
+      setName("jboss-web.xml");
    }
 
    /**
@@ -55,7 +58,7 @@
     */
    public String getWebXmlPath()
    {
-      return webXmlPath;
+      return getName();
    }
    /**
     * Set the virtual file path for the jboss-web descriptor in the
@@ -66,7 +69,7 @@
     */
    public void setWebXmlPath(String webXmlPath)
    {
-      this.webXmlPath = webXmlPath;
+      setName(webXmlPath);
    }
 
    /**
@@ -90,18 +93,9 @@
       return new JBossWebMetaDataObjectFactory(root);
    }
 
-   /**
-    * Overriden to invoke createMetaData(unit, webXmlPath, null) to parse any
-    * webXmlPath descriptor into a WebMetaData instance.
-    */
    @Override
-   public void deploy(DeploymentUnit unit) throws DeploymentException
+   protected void init(VFSDeploymentUnit unit, WebMetaData metaData, VirtualFile file) throws Exception
    {
-      log.debug("deploy, unit: "+unit);
-      createMetaData(unit, webXmlPath, null);
-      WebMetaData metaData = getMetaData(unit, WebMetaData.class.getName());
-      if( metaData == null )
-         return;
 
       // Add the loader repository config
       LoaderRepositoryConfig loaderConfig = metaData.getLoaderConfig();

Modified: trunk/server/src/main/org/jboss/deployment/JaccCommitDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JaccCommitDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/JaccCommitDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,32 +21,40 @@
 */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
-
 import javax.security.jacc.PolicyConfiguration;
-import javax.security.jacc.PolicyConfigurationFactory;
 import javax.security.jacc.PolicyContextException;
-import java.util.Set;
 
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
 /**
  * Second phase of JACC Policy deployment.  If the DU has a policy attachment
  * link it to any parent PC and then commit it.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author adrian at jboss.org
  * @version $Revision: 57082 $
  */
-public class JaccCommitDeployer extends AbstractSimpleDeployer
+public class JaccCommitDeployer extends AbstractRealDeployer
 {
-   private static final Logger log = Logger.getLogger(JaccCommitDeployer.class);
-
+   /**
+    * Create a new JaccCommitDeployer.
+    */
+   public JaccCommitDeployer()
+   {
+      setInput(PolicyConfiguration.class);
+   }
+   
    public void deploy(DeploymentUnit unit) throws org.jboss.deployers.spi.DeploymentException
    {
-      PolicyConfiguration pc = unit.getDeploymentContext().getTransientAttachments().getAttachment("javax.security.jacc.PolicyConfiguration", PolicyConfiguration.class);
-      if (pc == null) return;
+      PolicyConfiguration pc = unit.getAttachment(PolicyConfiguration.class);
+      if (pc == null)
+         return;
 
-      PolicyConfiguration parentPc = unit.getDeploymentContext().getParent().getDeploymentUnit().getAttachment("javax.security.jacc.PolicyConfiguration", PolicyConfiguration.class);
+      DeploymentUnit parent = unit.getParent();
+      if (parent == null)
+         throw new IllegalStateException("Unit has not parent: " + unit);
+      PolicyConfiguration parentPc = parent.getAttachment(PolicyConfiguration.class);
       try
       {
          if (parentPc != null && pc != parentPc)

Modified: trunk/server/src/main/org/jboss/deployment/JaccInitializationDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/JaccInitializationDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/JaccInitializationDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,26 +21,32 @@
 */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.logging.Logger;
+import java.util.Set;
 
+import javax.security.jacc.PolicyConfiguration;
 import javax.security.jacc.PolicyConfigurationFactory;
-import javax.security.jacc.PolicyConfiguration;
-import javax.security.jacc.PolicyContextException;
-import java.util.Set;
 
+import org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+
 /**
  * Create a JACC policy if the DeploymentUnit contains a named attachment
  * for example, if it contains J2EEApplicationMetaData.
  *
  * @author <a href="mailto:bill at jboss.org">Bill Burke</a>
+ * @author adrian at jboss.org 
  * @version $Revision: 57082 $
  */
-public class JaccInitializationDeployer extends AbstractSimpleDeployer
+public class JaccInitializationDeployer extends AbstractRealDeployer
 {
-   private static final Logger log = Logger.getLogger(JaccInitializationDeployer.class);
-
+   /**
+    * Create a new JaccInitializationDeployer.
+    */
+   public JaccInitializationDeployer()
+   {
+      setOutput(PolicyConfiguration.class);
+   }
+   
    private Set<String> acceptedAttachments;
 
    public Set<String> getAcceptedAttachments()
@@ -58,13 +64,14 @@
       boolean accepted = false;
       for (String accept : acceptedAttachments)
       {
-         if (unit.getDeploymentContext().getTransientAttachments().isAttachmentPresent(accept))
+         if (unit.isAttachmentPresent(accept))
          {
             accepted = true;
             break;
          }
       }
-      if (accepted == false) return;
+      if (accepted == false)
+         return;
 
       String contextID = unit.getName();
       PolicyConfiguration pc = null;
@@ -77,8 +84,6 @@
       {
          throw new RuntimeException("failed to initialize JACC for unit: " + unit.getName(), e);
       }
-      unit.getAttachment("");
-      unit.getDeploymentContext().getTransientAttachments().addAttachment("javax.security.jacc.PolicyConfiguration", pc);
+      unit.addAttachment(PolicyConfiguration.class, pc);
    }
-
 }

Modified: trunk/server/src/main/org/jboss/deployment/WebAppParsingDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/WebAppParsingDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/WebAppParsingDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,9 +21,7 @@
  */
 package org.jboss.deployment;
 
-import org.jboss.deployers.plugins.deployers.helpers.ObjectModelFactoryDeployer;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.ObjectModelFactoryDeployer;
 import org.jboss.metadata.WebMetaData;
 import org.jboss.metadata.web.WebMetaDataObjectFactory;
 import org.jboss.xb.binding.ObjectModelFactory;
@@ -33,16 +31,15 @@
  * WebMetaData instances.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision:$
  */
 public class WebAppParsingDeployer extends ObjectModelFactoryDeployer<WebMetaData>
 {
-   /** The name of the web-app descriptor in the deployment context metadata path */
-   private String webXmlPath = "web.xml";
-
    public WebAppParsingDeployer()
    {
       super(WebMetaData.class);
+      setName("web.xml");
    }
 
    /**
@@ -53,7 +50,7 @@
     */
    public String getWebXmlPath()
    {
-      return webXmlPath;
+      return getName();
    }
    /**
     * Set the virtual file path for the web-app descriptor in the
@@ -64,7 +61,7 @@
     */
    public void setWebXmlPath(String webXmlPath)
    {
-      this.webXmlPath = webXmlPath;
+      setName(webXmlPath);
    }
 
    /**
@@ -76,15 +73,4 @@
    {
       return new WebMetaDataObjectFactory();
    }
-
-   /**
-    * Overriden to invoke createMetaData(unit, webXmlPath, null) to parse any
-    * webXmlPath descriptor into a WebMetaData instance.
-    */
-   @Override
-   public void deploy(DeploymentUnit unit) throws DeploymentException
-   {
-      createMetaData(unit, webXmlPath, null);
-   }
-
 }

Modified: trunk/server/src/main/org/jboss/deployment/security/JaccPolicyUtil.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/security/JaccPolicyUtil.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/security/JaccPolicyUtil.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -25,13 +25,11 @@
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Set;
 
 import javax.security.jacc.PolicyConfiguration;
 import javax.security.jacc.PolicyContextException;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.ejb.EJBPermissionMapping;
 import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.metadata.BeanMetaData;
@@ -43,8 +41,10 @@
 
 /**
  *  Static class with common methods used for jacc deployment processing
+ *  
  *  TODO: Remove this class when the MC has the util methods
  *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
+ *  @author adrian at jboss.org
  *  @since  Dec 11, 2006 
  *  @version $Revision$
  */
@@ -58,18 +58,17 @@
     * @param ignoreSuffix (ignore "xml","beans", "deployer" etc)
     * @return
     */
-   public static List<String> getJaccDeployments(DeploymentUnit unit, 
+   public static List<String> getJaccDeployments(VFSDeploymentUnit unit, 
          Collection<String> ignoreSuffix)
    {
       ArrayList<String> list = new ArrayList<String>();
-      DeploymentContext dc = unit.getDeploymentContext();
-      Set<DeploymentContext> dcset = dc.getChildren();
-      for(DeploymentContext childDC: dcset)
+      List<VFSDeploymentUnit> children = unit.getVFSChildren(); 
+      for (VFSDeploymentUnit child: children)
       {
-         String childName = childDC.getSimpleName();
+         String childName = child.getSimpleName();
          boolean tobeIgnored = false;
          //Go through the ignore list
-         if( ignoreSuffix != null )
+         if (ignoreSuffix != null)
          {
             for(String ignoreStr: ignoreSuffix)
             {
@@ -81,10 +80,9 @@
                } 
             }
          }
-
          //Check if it is a "jar" file, then it must be ejb deployment to consider
          if(childName.endsWith("jar")  && !tobeIgnored  
-               && !isEJBDeployment(childDC.getDeploymentUnit()))
+               && !isEJBDeployment(child))
             continue;
          if(!tobeIgnored)  
            list.add(childName);  
@@ -93,7 +91,7 @@
    } 
    
    //TODO:Replace with ejb3 deployment logic
-   public static boolean isEJBDeployment(DeploymentUnit du)
+   public static boolean isEJBDeployment(VFSDeploymentUnit du)
    {
       // TODO: this is temporary EJB3 logic
       Boolean ignoreMe = du.getAttachment("org.jboss.deployment.security.ignoreMe", Boolean.class);

Modified: trunk/server/src/main/org/jboss/deployment/security/SecurityDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/deployment/security/SecurityDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/deployment/security/SecurityDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -22,24 +22,23 @@
 package org.jboss.deployment.security;
   
 import java.util.ArrayList;
-import java.util.HashSet; 
+import java.util.HashSet;
 import java.util.List;
-import java.util.Set;
 
-import javax.management.ObjectName; 
+import javax.management.ObjectName;
 
 import org.jboss.dependency.spi.ControllerState;
-import org.jboss.deployers.plugins.deployer.AbstractSimpleDeployer; 
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit; 
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.deployer.AbstractVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.metadata.BeanMetaData;
-import org.jboss.metadata.MetaData; 
+import org.jboss.metadata.MetaData;
 import org.jboss.metadata.WebMetaData;
 import org.jboss.system.metadata.ServiceAttributeMetaData;
 import org.jboss.system.metadata.ServiceConstructorMetaData;
-import org.jboss.system.metadata.ServiceDependencyMetaData; 
+import org.jboss.system.metadata.ServiceDependencyMetaData;
 import org.jboss.system.metadata.ServiceDeployment;
 import org.jboss.system.metadata.ServiceInjectionValueMetaData;
 import org.jboss.system.metadata.ServiceMetaData;
@@ -48,12 +47,14 @@
 
 /**
  *  Security Deployer that does Jacc initialization
+ *
  *  @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
  *  @author Scott.Stark at jboss.org
+ *  @author adrian at jboss.org
  *  @since  Dec 11, 2006 
  *  @version $Revision$
  */
-public class SecurityDeployer extends AbstractSimpleDeployer 
+public class SecurityDeployer extends AbstractVFSRealDeployer 
 {   
    private HashSet<String> ignoreSuffixes = null;
    
@@ -61,7 +62,8 @@
    
    public SecurityDeployer()
    { 
-      this.setRelativeOrder(COMPONENT_DEPLOYER - 1);
+      setTopLevelOnly(true);
+      setOutputs("jboss.jacc");
    }
    
    public void setIgnoreSuffixes(HashSet<String> suffixSet)
@@ -69,13 +71,8 @@
       this.ignoreSuffixes = suffixSet;
    }  
    
-   @Override
-   public void deploy(DeploymentUnit unit) throws DeploymentException
+   public void deploy(VFSDeploymentUnit unit) throws DeploymentException
    { 
-      
-      if(unit.getParent() != null)
-         return;  //deal with top level deployments only
-      
       //Ignore some of the extensions
       String contextId = unit.getSimpleName(); 
       
@@ -170,7 +167,7 @@
    
 
    @Override
-   public void undeploy(DeploymentUnit unit )
+   public void undeploy(VFSDeploymentUnit unit)
    {
       unit.removeAttachment("jboss.jaccpolicy", ServiceDeployment.class); 
       List<String> jaccDeployments = JaccPolicyUtil.getJaccDeployments(unit, ignoreSuffixes);
@@ -187,13 +184,11 @@
    
    private DeploymentUnit getChildDeployment(DeploymentUnit parent, String id)
    {
-      DeploymentContext dc = parent.getDeploymentContext();
-      Set<DeploymentContext> childSet = dc.getChildren();
-      for(DeploymentContext childDC: childSet)
+      List<DeploymentUnit> children = parent.getChildren();
+      for(DeploymentUnit child: children)
       {
-         DeploymentUnit du = childDC.getDeploymentUnit();
-         if(id.equals(du.getSimpleName()))
-            return du; 
+         if (id.equals(child.getSimpleName()))
+            return child; 
       }
       
       return null;

Modified: trunk/server/src/main/org/jboss/ejb/Container.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/Container.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/ejb/Container.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -54,7 +54,7 @@
 import javax.transaction.TransactionManager;
 import javax.xml.soap.SOAPMessage;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.deployment.DeploymentException;
 import org.jboss.deployment.DeploymentInfo;
 import org.jboss.ejb.plugins.local.BaseLocalProxyFactory;
@@ -116,6 +116,7 @@
  * @author <a href="mailto:d_jencks at users.sourceforge.net">David Jencks</a>
  * @author <a href="mailto:christoph.jung at infor.de">Christoph G. Jung</a>
  * @author <a href="mailto:dimitris at jboss.org">Dimitris Andreadis</a>
+ * @author adrian at jboss.org
  * @version $Revision$
  *
  * @jmx.mbean extends="org.jboss.system.ServiceMBean"
@@ -149,7 +150,7 @@
    /**
     * Externally supplied configuration data
     */
-   private DeploymentUnit unit;
+   private VFSDeploymentUnit unit;
 
    /**
     * This is the new metadata. it includes information from both ejb-jar and
@@ -418,12 +419,12 @@
    {
    }
 
-   public final DeploymentUnit getDeploymentUnit()
+   public final VFSDeploymentUnit getDeploymentUnit()
    {
       return unit;
    }
 
-   public final void setDeploymentUnit(DeploymentUnit di)
+   public final void setDeploymentUnit(VFSDeploymentUnit di)
    {
       this.unit = di;
    }
@@ -1237,7 +1238,7 @@
 
       // Bind service references
       ClassLoader loader = unit.getClassLoader();
-      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
+      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getRoot());
       for (ServiceRefMetaData sref : metaData.getServiceRefs().values())
       {
          String refName = sref.getServiceRefName();

Modified: trunk/server/src/main/org/jboss/ejb/EjbModule.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/EjbModule.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/ejb/EjbModule.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -44,9 +44,10 @@
 import javax.security.jacc.PolicyContextException;
 import javax.transaction.TransactionManager;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo; 
+import org.jboss.deployment.DeploymentInfo;
 import org.jboss.ejb.plugins.SecurityProxyInterceptor;
 import org.jboss.ejb.plugins.StatefulSessionInstancePool;
 import org.jboss.invocation.InvocationType;
@@ -95,8 +96,6 @@
  * @author <a href="mailto:Scott.Stark at jboss.org">Scott Stark</a>
  * @author <a href="mailto:Anil.Saldhana at jboss.org">Anil Saldhana</a>
  * @version $Revision$
- *
- * @jmx:mbean extends="org.jboss.system.ServiceMBean"
  */
 public class EjbModule
    extends ServiceMBeanSupport
@@ -141,7 +140,7 @@
    /** Name of this deployment unit, url it was deployed from */
    final String name;
 
-   private DeploymentUnit deploymentUnit;
+   private VFSDeploymentUnit deploymentUnit;
 
    private ServiceControllerMBean serviceController;
 
@@ -156,7 +155,7 @@
    private boolean callByValue;
    private ApplicationMetaData appMetaData; 
 
-   public EjbModule(final DeploymentUnit unit, ApplicationMetaData metaData)
+   public EjbModule(final VFSDeploymentUnit unit, ApplicationMetaData metaData)
    {
       this.appMetaData = metaData;
       this.deploymentUnit = unit;
@@ -584,7 +583,7 @@
    // Container Creation
    // ******************
 
-   private Container createContainer(BeanMetaData bean, DeploymentUnit unit)
+   private Container createContainer(BeanMetaData bean, VFSDeploymentUnit unit)
       throws Exception
    {
       Container container = null;

Modified: trunk/server/src/main/org/jboss/ejb/EjbUtil.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/EjbUtil.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/ejb/EjbUtil.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,16 +21,14 @@
 */
 package org.jboss.ejb;
 
-import java.net.URL;
 import java.net.MalformedURLException;
-
+import java.net.URL;
 import java.util.Iterator;
 import java.util.StringTokenizer;
 
 import javax.management.MBeanServer;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.structure.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployment.DeploymentInfo;
 import org.jboss.deployment.MainDeployerMBean;
 import org.jboss.logging.Logger;
@@ -45,6 +43,7 @@
  *
  * @author <a href="mailto:criege at riege.com">Christian Riege</a>
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  *
  * @version $Revision$
  */
@@ -170,12 +169,7 @@
       else
       {
          // <ejb-link> contains a Bean Name, scan the DeploymentInfo tree
-         DeploymentContext top = unit.getDeploymentContext();
-         while (top.getParent() != null)
-         {
-            top = top.getParent();
-         }
-
+         DeploymentUnit top = unit.getTopLevel();
          return resolveAbsoluteLink(top, link, isLocal);
       }      
    }
@@ -387,13 +381,8 @@
       else
       {
          // link contains a Bean Name, scan the DeploymentInfo tree
-         DeploymentContext top = unit.getDeploymentContext();
-         while (top.getParent() != null)
-         {
-            top = top.getParent();
-         }
-
-         return resolveAbsoluteMessageDestination(top.getDeploymentUnit(), link);
+         DeploymentUnit top = unit.getTopLevel();
+         return resolveAbsoluteMessageDestination(top, link);
       }
    }
 
@@ -610,16 +599,12 @@
       }
 
       // Search each subcontext
-      Iterator<DeploymentContext> it = unit.getDeploymentContext().getChildren().iterator();
-      while (it.hasNext())
+      for (DeploymentUnit child : unit.getChildren())
       {
-         DeploymentContext child = it.next();
-         MessageDestinationMetaData mdMD = resolveAbsoluteMessageDestination(child.getDeploymentUnit(), link);
+         MessageDestinationMetaData mdMD = resolveAbsoluteMessageDestination(child, link);
          if (mdMD != null)
             return mdMD;
       }
-
-      // Not found
       return null;
    }
 
@@ -714,19 +699,19 @@
       return linkTarget;
    }
 
-   private static String resolveAbsoluteLink(DeploymentContext ctx, String link, boolean isLocal)
+   private static String resolveAbsoluteLink(DeploymentUnit unit, String link, boolean isLocal)
    {
-      if(ctx == null)
-         throw new IllegalArgumentException("deployment context passed is null");
+      if (unit == null)
+         throw new IllegalArgumentException("deployment unit passed is null");
       
       if (log.isTraceEnabled())
       {
-         log.trace("Resolving absolute link, ctx: " + ctx);
+         log.trace("Resolving absolute link, unit: " + unit);
       }
 
       String ejbName = null;
   
-      ApplicationMetaData appMD = ctx.getDeploymentUnit().getAttachment(ApplicationMetaData.class);
+      ApplicationMetaData appMD = unit.getAttachment(ApplicationMetaData.class);
       if (appMD != null)
       {
          // Look in the ejb module for a match
@@ -756,10 +741,10 @@
       }
 
       // Search each subcontext
-      Iterator it = ctx.getChildren().iterator();
+      Iterator<DeploymentUnit> it = unit.getChildren().iterator();
       while (it.hasNext() && ejbName == null)
       {
-         DeploymentContext child = (DeploymentContext)it.next();
+         DeploymentUnit child = it.next();
          ejbName = resolveAbsoluteLink(child, link, isLocal);
       }
 

Modified: trunk/server/src/main/org/jboss/ejb/EjbUtil50.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/EjbUtil50.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/ejb/EjbUtil50.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -26,10 +26,9 @@
 import java.util.Iterator;
 import java.util.StringTokenizer;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.structure.DeploymentContext;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployment.MainDeployerMBean;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.metadata.BeanMetaData;
@@ -54,13 +53,14 @@
     * Resolves an &lt;ejb-link&gt; target for an &lt;ejb-ref&gt; entry and
     * returns the name of the target in the JNDI tree.
     *
+    * @param server the main deployer
     * @param unit DeploymentUnit
     * @param link Content of the &lt;ejb-link&gt; entry.
     *
     * @return The JNDI Entry of the target bean; <code>null</code> if
     *         no appropriate target could be found.
     */
-   public static String findEjbLink(MainDeployer server, DeploymentUnit unit, String link)
+   public static String findEjbLink(MainDeployerStructure server, DeploymentUnit unit, String link)
    {
       return resolveLink(server, unit, link, false);
    }
@@ -69,13 +69,14 @@
     * Resolves an &lt;ejb-link&gt; target for an &lt;ejb-local-ref&gt; entry
     * and returns the name of the target in the JNDI tree.
     *
+    * @param server the main deployer
     * @param unit DeploymentUnit
     * @param link Content of the &lt;ejb-link&gt; entry.
     *
     * @return The JNDI Entry of the target bean; <code>null</code> if
     *         no appropriate target could be found.
     */
-   public static String findLocalEjbLink(MainDeployer server, DeploymentUnit unit, String link)
+   public static String findLocalEjbLink(MainDeployerStructure server, DeploymentUnit unit, String link)
    {
       return resolveLink(server, unit, link, true);
    }
@@ -84,18 +85,19 @@
     * Resolves a &lt;message-destination&gt; target for a &lt;message-destination-link&gt; 
     * entry and returns the name of the target in the JNDI tree.
     *
+    * @param server the main deployer
     * @param di DeploymentUnit
     * @param link Content of the &lt;message-driven-link&gt; entry.
     *
     * @return The JNDI Entry of the target; <code>null</code> if
     *         no appropriate target could be found.
     */
-   public static MessageDestinationMetaData findMessageDestination(MainDeployer server, DeploymentUnit di, String link)
+   public static MessageDestinationMetaData findMessageDestination(MainDeployerStructure server, DeploymentUnit di, String link)
    {
       return resolveMessageDestination(server, di, link);
    }
 
-   private static String resolveLink(MainDeployer server, DeploymentUnit di, String link, boolean isLocal)
+   private static String resolveLink(MainDeployerStructure server, DeploymentUnit di, String link, boolean isLocal)
    {
       if (link == null)
       {
@@ -121,17 +123,12 @@
       else
       {
          // <ejb-link> contains a Bean Name, scan the DeploymentUnit tree
-         DeploymentUnit top = di;
-         while (top.getDeploymentContext().getParent() != null)
-         {
-            top = top.getDeploymentContext().getParent().getDeploymentUnit();
-         }
-
+         DeploymentUnit top = di.getTopLevel();
          return resolveAbsoluteLink(top, link, isLocal);
       }
    }
 
-   private static String resolveRelativeLink(MainDeployer server, DeploymentUnit unit, String link, boolean isLocal)
+   private static String resolveRelativeLink(MainDeployerStructure server, DeploymentUnit unit, String link, boolean isLocal)
    {
 
       String path = link.substring(0, link.indexOf('#'));
@@ -260,10 +257,10 @@
       }
 
       // Search each subcontext
-      Iterator it = unit.getDeploymentContext().getChildren().iterator();
+      Iterator<DeploymentUnit> it = unit.getChildren().iterator();
       while (it.hasNext() && ejbName == null)
       {
-         DeploymentUnit child = ((DeploymentContext)it.next()).getDeploymentUnit();
+         DeploymentUnit child = it.next();
          ejbName = resolveAbsoluteLink(child, link, isLocal);
       }
 
@@ -291,7 +288,7 @@
       return jndiName;
    }
 
-   private static MessageDestinationMetaData resolveMessageDestination(MainDeployer server, DeploymentUnit di, String link)
+   private static MessageDestinationMetaData resolveMessageDestination(MainDeployerStructure server, DeploymentUnit di, String link)
    {
       if (link == null)
          return null;
@@ -309,15 +306,12 @@
       else
       {
          // link contains a Bean Name, scan the DeploymentUnit tree
-         DeploymentUnit top = di;
-         while (top.getDeploymentContext().getParent() != null)
-            top = top.getDeploymentContext().getParent().getDeploymentUnit();
-
+         DeploymentUnit top = di.getTopLevel();
          return resolveAbsoluteMessageDestination(top, link);
       }
    }
 
-   private static MessageDestinationMetaData resolveRelativeMessageDestination(MainDeployer server, DeploymentUnit unit, String link)
+   private static MessageDestinationMetaData resolveRelativeMessageDestination(MainDeployerStructure server, DeploymentUnit unit, String link)
    {
       String path = link.substring(0, link.indexOf('#'));
       String destinationName = link.substring(link.indexOf('#') + 1);
@@ -412,10 +406,10 @@
       }
 
       // Search each subcontext
-      Iterator it = unit.getDeploymentContext().getChildren().iterator();
+      Iterator<DeploymentUnit> it = unit.getChildren().iterator();
       while (it.hasNext())
       {
-         DeploymentUnit child = ((DeploymentContext)it.next()).getDeploymentUnit();
+         DeploymentUnit child = it.next();
          MessageDestinationMetaData mdMD = resolveAbsoluteMessageDestination(child, link);
          if (mdMD != null)
             return mdMD;

Modified: trunk/server/src/main/org/jboss/ejb/deployers/EjbDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/ejb/deployers/EjbDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/ejb/deployers/EjbDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -30,9 +30,10 @@
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
-import org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer;
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;  
+import org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.ejb.EjbModule;
 import org.jboss.metadata.ApplicationMetaData;
 import org.jboss.metadata.BeanMetaData;
@@ -41,7 +42,7 @@
 import org.jboss.system.metadata.ServiceAttributeMetaData;
 import org.jboss.system.metadata.ServiceConstructorMetaData;
 import org.jboss.system.metadata.ServiceDependencyMetaData;
-import org.jboss.system.metadata.ServiceDependencyValueMetaData; 
+import org.jboss.system.metadata.ServiceDependencyValueMetaData;
 import org.jboss.system.metadata.ServiceMetaData;
 
 /**
@@ -49,9 +50,10 @@
  * the ejb module service mbeans.
  * 
  * @author Scott.Stark at jboss.org
+ * @author adrian at jboss.org
  * @version $Revision$
  */
-public class EjbDeployer extends AbstractSimpleRealDeployer<ApplicationMetaData>
+public class EjbDeployer extends AbstractSimpleVFSRealDeployer<ApplicationMetaData>
 {
    /** */
    private String transactionManagerServiceName;
@@ -66,9 +68,13 @@
 
    private String unauthenticatedIdentity = null;
    
+   /**
+    * Create a new EjbDeployer.
+    */
    public EjbDeployer()
    {
       super(ApplicationMetaData.class);
+      setOutput(ServiceMetaData.class);
    }
 
    public String getTransactionManagerServiceName()
@@ -125,7 +131,8 @@
 
    /**
     * Obtain an unauthenticated identity
-    * @return
+    * 
+    * @return the unauthenticated identity
     */
    public String getUnauthenticatedIdentity()
    {
@@ -142,15 +149,13 @@
    }
 
    @Override
-   public void deploy(DeploymentUnit unit, ApplicationMetaData deployment)
+   public void deploy(VFSDeploymentUnit unit, ApplicationMetaData deployment)
       throws DeploymentException
    {
       // TODO: use BeanVerifier to validate the metadata in the DDs
       if (deployment.getEjbVersion() > 2) return; // let EJB3 deployer handle this
-      
-      /**
-       * Ignore the jacc policy service bean 
-       */
+
+      // TODO What is this hack?
       if(unit.getName().startsWith("jboss:") && unit.getName().contains("id="))
          return;
 
@@ -174,7 +179,7 @@
 
       ServiceConstructorMetaData ctor = new ServiceConstructorMetaData();
       ctor.setSignature(
-         new String[]{DeploymentUnit.class.getName(), ApplicationMetaData.class.getName()}
+         new String[]{VFSDeploymentUnit.class.getName(), ApplicationMetaData.class.getName()}
       );
       ctor.setParameters(new Object[]{unit, deployment});
       ejbModule.setConstructor(ctor);
@@ -267,7 +272,7 @@
    }
 
    @Override
-   public void undeploy(DeploymentUnit unit, ApplicationMetaData deployment)
+   public void undeploy(VFSDeploymentUnit unit, ApplicationMetaData deployment)
    { 
    }
 
@@ -275,12 +280,13 @@
     * Get the object name of the ServiceMetaData instance associated with
     * the EjbModule. This uses the pattern:
     * "jboss.j2ee:service=EjbModule,module="+unit.getSimpleName()
-    * 
+    *
+    * @param unit the deployment unit
     * @param metaData - the ejb jar metaData
     * @return "jboss.j2ee:service=EjbModule,module="+unit.getSimpleName()
     * @throws MalformedObjectNameException 
     */
-   protected ObjectName getObjectName(DeploymentUnit unit, ApplicationMetaData metaData)
+   protected ObjectName getObjectName(VFSDeploymentUnit unit, ApplicationMetaData metaData)
       throws MalformedObjectNameException
    {
       String name = metaData.getJmxName();
@@ -305,5 +311,4 @@
 
       return new ObjectName(name);
    }
-
 }

Modified: trunk/server/src/main/org/jboss/web/WebApplication.java
===================================================================
--- trunk/server/src/main/org/jboss/web/WebApplication.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/web/WebApplication.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -24,23 +24,22 @@
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.metadata.WebMetaData;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployment.DeploymentInfo;
 
 /** A WebApplication represents the information for a war deployment.
 
  @see AbstractWebContainer
 
  @author Scott.Stark at jboss.org
+ @author adrian at jboss.org
  @version $Revision$
  */
 public class WebApplication
 {
    /** */
-   private DeploymentUnit unit;
+   private VFSDeploymentUnit unit;
    /** Class loader of this application */
    protected ClassLoader classLoader = null;
    /** name of this application */
@@ -103,11 +102,11 @@
       this.classLoader = classLoader;
    }
 
-   public DeploymentUnit getDeploymentUnit()
+   public VFSDeploymentUnit getDeploymentUnit()
    {
       return unit;
    }
-   public void setDeploymentUnit(DeploymentUnit unit)
+   public void setDeploymentUnit(VFSDeploymentUnit unit)
    {
       this.unit = unit;
    }

Modified: trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java
===================================================================
--- trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployer.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -33,16 +33,15 @@
 
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
- 
-import org.jboss.deployers.plugins.deployers.helpers.AbstractSimpleRealDeployer; 
+
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.deployment.MainDeployer;
-import org.jboss.deployers.spi.structure.DeploymentContext;  
+import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
+import org.jboss.deployers.vfs.spi.deployer.AbstractSimpleVFSRealDeployer;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.metadata.WebMetaData;
-import org.jboss.mx.util.MBeanServerLocator; 
+import org.jboss.mx.util.MBeanServerLocator;
 import org.jboss.system.metadata.ServiceConstructorMetaData;
-import org.jboss.system.metadata.ServiceDependencyMetaData;  
+import org.jboss.system.metadata.ServiceDependencyMetaData;
 import org.jboss.system.metadata.ServiceMetaData;
 import org.jboss.system.server.ServerConfig;
 import org.jboss.system.server.ServerConfigLocator;
@@ -71,9 +70,10 @@
  @author  Scott.Stark at jboss.org
  @author  Christoph.Jung at infor.de
  @author  Thomas.Diesler at arcor.de
+ @author  adrian at jboss.org
  @version $Revision: 55985 $
  */
-public abstract class AbstractWarDeployer extends AbstractSimpleRealDeployer<WebMetaData>
+public abstract class AbstractWarDeployer extends AbstractSimpleVFSRealDeployer<WebMetaData>
 {
    public static final String DEPLOYER = "org.jboss.web.AbstractWebContainer.deployer";
    public static final String WEB_APP = "org.jboss.web.AbstractWebContainer.webApp";
@@ -99,15 +99,15 @@
    private String subjectAttributeName = null;
    /** Legacy support for MBeanServer */
    private MBeanServer server; 
-   private MainDeployer mainDeployer;
+   private MainDeployerStructure mainDeployer;
 
    /**
-    * Set the relative order to COMPONENT_DEPLOYER+1 by default
+    * Create a new AbstractWarDeployer.
     */
    public AbstractWarDeployer()
    {
       super(WebMetaData.class);
-      setRelativeOrder(COMPONENT_DEPLOYER+1);
+      setOutput(ServiceMetaData.class);
    }
 
    /** Get the flag indicating if the normal Java2 parent first class loading
@@ -256,26 +256,26 @@
     * @return the AbstractWarDeployment for the input WebMetaData
     * @throws Exception - thrown on any failure
     */
-   public abstract AbstractWarDeployment getDeployment(DeploymentUnit unit, WebMetaData metaData)
+   public abstract AbstractWarDeployment getDeployment(VFSDeploymentUnit unit, WebMetaData metaData)
       throws Exception;
 
    /**
     * Deploy a web app based on the WebMetaData. This calls
-    * {@link #getDeployment(DeploymentUnit, WebMetaData)} to obtain an
+    * {@link #getDeployment(VFSDeploymentUnit, WebMetaData)} to obtain an
     * AbstractWarDeployment bean that is wrapped in a ServiceMetaData by
     * deployWebModule.
     * 
     * This will set the WebMetaData.contextRoot if it has not been set based
     * on the war deployment name.
     * 
-    * @see #deployWebModule(DeploymentUnit, WebMetaData, AbstractWarDeployment)
-    * @see #buildWebContext(DeploymentUnit, String, String, WebMetaData)
+    * @see #deployWebModule(VFSDeploymentUnit, WebMetaData, AbstractWarDeployment)
+    * @see #buildWebContext(VFSDeploymentUnit, String, String, WebMetaData)
     * 
     * @param unit - the war for the deployment
     * @param metaData - the metadata for the deployment
     */
    @Override
-   public void deploy(DeploymentUnit unit, WebMetaData metaData) throws DeploymentException
+   public void deploy(VFSDeploymentUnit unit, WebMetaData metaData) throws DeploymentException
    {
       log.debug("Begin deploy, " + metaData);
 
@@ -294,7 +294,7 @@
          if(warName.startsWith("jboss:") && warName.contains("id="))
             return;
          
-         URL expWarUrl = unit.getDeploymentContext().getRoot().toURL();
+         URL expWarUrl = unit.getRoot().toURL();
          if (warName.endsWith("/") == false
          // Hack for jar urls being exposed
                || warName.endsWith("!/") == true)
@@ -321,19 +321,18 @@
             if (expWarFile.mkdir() == false)
                throw new DeploymentException("Was unable to mkdir: " + expWarFile);
             log.debug("Unpacking war to: " + expWarFile);
-            VirtualFile root = unit.getDeploymentContext().getRoot();
+            VirtualFile root = unit.getRoot();
             InputStream is = root.openStream();
             JarUtils.unjar(is, expWarFile);
             is.close();
             expWarUrl = expWarFile.toURL();
 
             // Map
-            DeploymentContext ctx = unit.getDeploymentContext();
-            VirtualFile warVF = ctx.getRoot();
+            VirtualFile warVF = unit.getRoot();
             String warPathName = warVF.getPathName();
             if( warPathName.endsWith("/") == false )
                warPathName += "/";
-            List<VirtualFile> classpathVFs = ctx.getClassPath();
+            List<VirtualFile> classpathVFs = unit.getClassPath();
             if( classpathVFs != null )
             {
                ArrayList<URL> classpath = new ArrayList<URL>();
@@ -371,7 +370,7 @@
                if (!file.exists() || !file.isAbsolute())
                {
                   // Should be an relative to the top deployment
-                  DeploymentUnit topUnit = unit.getDeploymentContext().getTopLevel().getDeploymentUnit();
+                  VFSDeploymentUnit topUnit = unit.getTopLevel();
                   if( topUnit == unit )
                      throw new DeploymentException("Unable to resolve "+altDDPath+" as WEB-INF path");
                   altDD = topUnit.getFile(altDDPath);
@@ -408,7 +407,7 @@
     * Cleanup war deployer specifics.
     */
    @Override
-   public void undeploy(DeploymentUnit unit, WebMetaData metaData)
+   public void undeploy(VFSDeploymentUnit unit, WebMetaData metaData)
    {
       try
       {
@@ -502,7 +501,7 @@
    @param warName - 
    */
    protected String buildWebContext(String ctxPath, String warName,
-         WebMetaData metaData, DeploymentUnit unit)
+         WebMetaData metaData, VFSDeploymentUnit unit)
    {
       // Build a war root context from the war name if one was not specified
       String webContext = ctxPath;
@@ -551,12 +550,12 @@
       return server;
    }
 
-   public MainDeployer getMainDeployer()
+   public MainDeployerStructure getMainDeployer()
    {
       return mainDeployer;
    }
 
-   public void setMainDeployer(MainDeployer mainDeployer)
+   public void setMainDeployer(MainDeployerStructure mainDeployer)
    {
       this.mainDeployer = mainDeployer;
    }
@@ -588,7 +587,7 @@
     * @param deployment - the web app deployment bean created by getDeployment
     * @throws Exception
     */
-   protected void deployWebModule(DeploymentUnit unit, WebMetaData metaData,
+   protected void deployWebModule(VFSDeploymentUnit unit, WebMetaData metaData,
          AbstractWarDeployment deployment)
       throws Exception
    {
@@ -602,7 +601,7 @@
          webModule.setCode(WebModule.class.getName());
          // WebModule(DeploymentUnit, AbstractWarDeployer, AbstractWarDeployment)
          ServiceConstructorMetaData constructor = new ServiceConstructorMetaData();
-         constructor.setSignature(new String[] { DeploymentUnit.class.getName(),
+         constructor.setSignature(new String[] { VFSDeploymentUnit.class.getName(),
                AbstractWarDeployer.class.getName(), AbstractWarDeployment.class.getName()});
          constructor.setParameters(new Object[] {unit, this, deployment});
          webModule.setConstructor(constructor);

Modified: trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java
===================================================================
--- trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/web/deployers/AbstractWarDeployment.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -37,8 +37,9 @@
 import javax.naming.LinkRef;
 import javax.naming.NamingException;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
-import org.jboss.deployers.spi.deployment.MainDeployer;
+import org.jboss.deployers.structure.spi.DeploymentUnit;
+import org.jboss.deployers.structure.spi.main.MainDeployerStructure;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.ejb.EjbUtil50;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.EjbLocalRefMetaData;
@@ -86,6 +87,7 @@
 
 @author  Scott.Stark at jboss.org
 @author Anil.Saldhana at redhat.com
+ at author adrian at jboss.org
 @version $Revision: 57455 $
 */
 public abstract class AbstractWarDeployment
@@ -94,7 +96,7 @@
    protected Logger log;
 
    protected MBeanServer server;
-   protected MainDeployer mainDeployer;
+   protected MainDeployerStructure mainDeployer;
 
    /**
     * The parent class loader first model flag
@@ -157,12 +159,12 @@
       this.server = server;
    }
 
-   public MainDeployer getMainDeployer()
+   public MainDeployerStructure getMainDeployer()
    {
       return mainDeployer;
    }
 
-   public void setMainDeployer(MainDeployer mainDeployer)
+   public void setMainDeployer(MainDeployerStructure mainDeployer)
    {
       this.mainDeployer = mainDeployer;
    }
@@ -291,7 +293,7 @@
     * be null if war was is not being deployed as part of an enterprise
     * application. It also contains the URL of the web application war.
     */
-   public synchronized WebApplication start(DeploymentUnit unit, WebMetaData metaData)
+   public synchronized WebApplication start(VFSDeploymentUnit unit, WebMetaData metaData)
       throws Exception
    {
       Thread thread = Thread.currentThread();
@@ -311,7 +313,7 @@
          if( warURL == null )
             warURL = unit.getAttachment("jbossws.expanded.war.url", URL.class);
          if (warURL == null)
-            warURL = unit.getDeploymentContext().getRoot().toURL();
+            warURL = unit.getRoot().toURL();
 
          // Strip any jar: url syntax. This should be be handled by the vfs
          String warURLString = warURL.toString();
@@ -460,7 +462,7 @@
    protected void processEncReferences(WebApplication webApp, Context envCtx)
            throws ClassNotFoundException, NamingException
    {
-      DeploymentUnit unit = webApp.getDeploymentUnit();
+      VFSDeploymentUnit unit = webApp.getDeploymentUnit();
       WebMetaData metaData = webApp.getMetaData();
       Iterator envEntries = metaData.getEnvironmentEntries();
       log.debug("addEnvEntries");
@@ -483,10 +485,10 @@
       linkServiceRefs(unit, metaData.getServiceRefs(), envCtx);
    }
 
-   private void linkServiceRefs(DeploymentUnit unit, Map<String, ServiceRefMetaData> serviceRefs, Context envCtx) throws NamingException
+   private void linkServiceRefs(VFSDeploymentUnit unit, Map<String, ServiceRefMetaData> serviceRefs, Context envCtx) throws NamingException
    {
       ClassLoader loader = unit.getClassLoader();
-      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getDeploymentContext().getRoot());
+      UnifiedVirtualFile vfsRoot = new VirtualFileAdaptor(unit.getRoot());
       for (ServiceRefMetaData sref : serviceRefs.values())
       {
          String refName = sref.getServiceRefName();

Modified: trunk/server/src/main/org/jboss/web/deployers/WebModule.java
===================================================================
--- trunk/server/src/main/org/jboss/web/deployers/WebModule.java	2007-06-28 17:23:38 UTC (rev 63727)
+++ trunk/server/src/main/org/jboss/web/deployers/WebModule.java	2007-06-28 17:23:56 UTC (rev 63728)
@@ -21,7 +21,7 @@
  */
 package org.jboss.web.deployers;
 
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentUnit;
 import org.jboss.deployment.DeploymentException;
 import org.jboss.logging.Logger;
 import org.jboss.metadata.WebMetaData;
@@ -39,17 +39,18 @@
  @see AbstractWarDeployer
  
  @author Scott.Stark at jboss.org
+ @author adrian at jboss.org
  @version $Revison:$
  */
 public class WebModule
    implements WebModuleMBean
 {
    private static Logger log = Logger.getLogger(WebModule.class);
-   private DeploymentUnit di;
+   private VFSDeploymentUnit di;
    private AbstractWarDeployer container;
    private AbstractWarDeployment deployment; 
 
-   public WebModule(DeploymentUnit di, AbstractWarDeployer container,
+   public WebModule(VFSDeploymentUnit di, AbstractWarDeployer container,
          AbstractWarDeployment deployment)
    {
       this.di = di;




More information about the jboss-cvs-commits mailing list