[jboss-cvs] JBossAS SVN: r83487 - in projects/jboss-deployers/branches/Branch_2_0: deployers-core/src/main/java/org/jboss/deployers/plugins/structure and 39 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Jan 27 08:38:45 EST 2009


Author: alesj
Date: 2009-01-27 08:38:45 -0500 (Tue, 27 Jan 2009)
New Revision: 83487

Added:
   projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/support/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF/child.xml
Removed:
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/support/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF/
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF/child.xml
Modified:
   projects/jboss-deployers/branches/Branch_2_0/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java
   projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
   projects/jboss-deployers/branches/Branch_2_0/pom.xml
Log:
Merge with trunk.

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/ContextInfoImpl.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -267,6 +267,8 @@
          builder.append(" relativeOrder=").append(getRelativeOrder());
       if (comparatorClassName != null)
          builder.append(" comparator=").append(getComparatorClassName());
+      if (modificationType != null)
+         builder.append(" modification=").append(modificationType);
    }
    
    @Override

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/classloading/AbstractDeploymentClassLoaderPolicyModule.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -33,7 +33,7 @@
 
 /**
  * AbstractDeploymentClassLoaderPolicyModule.
- *
+ * 
  * @author <a href="adrian at jboss.com">Adrian Brock</a>
  * @author <a href="ales.justin at jboss.com">Ales Justin</a>
  * @version $Revision: 1.1 $
@@ -45,13 +45,13 @@
 
    /** The classloader state for deployments */
    private static ControllerState CLASSLOADER_STATE = new ControllerState(DeploymentStages.CLASSLOADER.getName());
-
+   
    /** The deployment unit */
    private DeploymentUnit unit;
-
+   
    /**
-    * Determine the classloading metadata for the deployment unit
-    *
+    * Determine the classloading metadata for the deployment unit 
+    * 
     * @param unit the deployment unit
     * @return the classloading metadata
     */
@@ -63,8 +63,8 @@
    }
 
    /**
-    * Determine the classloading metadata for the deployment unit
-    *
+    * Determine the classloading metadata for the deployment unit 
+    * 
     * @param unit the deployment unit
     * @param addAlias should we add alias or remove
     * @return the classloading metadata
@@ -77,7 +77,7 @@
       ControllerContext context = unit.getTopLevel().getAttachment(ControllerContext.class);
       if (context == null)
          throw new IllegalStateException("Deployment has no controller context");
-
+      
       // We use the deployment name
       String contextName = unit.getName();
 
@@ -105,13 +105,13 @@
             }
          }
       }
-
+      
       return contextName;
    }
-
+   
    /**
     * Create a new AbstractDeploymentClassLoaderPolicyModule.
-    *
+    * 
     * @param unit the deployment unit
     * @throws IllegalArgumentException for a null unit
     */
@@ -125,7 +125,7 @@
 
    /**
     * Get the unit.
-    *
+    * 
     * @return the unit.
     */
    public DeploymentUnit getDeploymentUnit()

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/main/MainDeployerImpl.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -75,7 +75,7 @@
    private StructuralDeployers structuralDeployers;
 
    /** The ManagedDeploymentCreator plugin */
-   private ManagedDeploymentCreator mgtDeploymentCreator = null;
+   private ManagedDeploymentCreator mgtDeploymentCreator;
 
    /** The deployments by name */
    private Map<String, DeploymentContext> topLevelDeployments = new ConcurrentHashMap<String, DeploymentContext>();
@@ -161,11 +161,21 @@
       structuralDeployers = deployers;
    }
 
+   /**
+    * Get managed deployment creator.
+    *
+    * @return the managed deployment creator
+    */
    public ManagedDeploymentCreator getMgtDeploymentCreator()
    {
       return mgtDeploymentCreator;
    }
 
+   /**
+    * Set managed deployment creator.
+    *
+    * @param mgtDeploymentCreator the managed deployment creator
+    */
    public void setMgtDeploymentCreator(ManagedDeploymentCreator mgtDeploymentCreator)
    {
       this.mgtDeploymentCreator = mgtDeploymentCreator;
@@ -226,16 +236,33 @@
       return topLevelDeployments.get(name);
    }
 
+   // TODO - introduce some interface or push to MDStructure
+
+   /**
+    * Get all deployments.
+    *
+    * @return all deployments
+    */
    public Collection<DeploymentContext> getAll()
    {
       return Collections.unmodifiableCollection(allDeployments.values());
    }
 
+   /**
+    * Get errors.
+    *
+    * @return the errors
+    */
    public Collection<DeploymentContext> getErrors()
    {
       return Collections.unmodifiableCollection(errorDeployments.values());
    }
 
+   /**
+    * Get missing deployers deployments.
+    *
+    * @return the missing deployer deployments
+    */
    public Collection<Deployment> getMissingDeployer()
    {
       return Collections.unmodifiableCollection(missingDeployers.values());
@@ -757,6 +784,9 @@
 
    public ManagedDeployment getManagedDeployment(String name) throws DeploymentException
    {
+      if (mgtDeploymentCreator == null)
+         throw new IllegalArgumentException("Null managed deployment creator.");
+
       DeploymentContext context = getDeploymentContext(name, true);
       Map<String, ManagedObject> rootMOs = getManagedObjects(context);
       ManagedDeployment root = mgtDeploymentCreator.build(context.getDeploymentUnit(), rootMOs, null);
@@ -829,6 +859,9 @@
    protected void processManagedDeployment(DeploymentContext context, ManagedDeployment parent)
       throws DeploymentException
    {
+      if (mgtDeploymentCreator == null)
+         throw new IllegalArgumentException("Null managed deployment creator.");
+
       DeploymentUnit unit = context.getDeploymentUnit();
       Map<String, ManagedObject> MOs = getManagedObjects(context);
       ManagedDeployment md = mgtDeploymentCreator.build(unit, MOs, parent);

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DeployerDomino.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -45,6 +45,11 @@
       this.tail = new SetDots<String>(deployer.getOutputs());
    }
 
+   /**
+    * Get the underlying deployer.
+    *
+    * @return the deployer
+    */
    public Deployer getDeployer()
    {
       return deployer;

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/main/java/org/jboss/deployers/plugins/sort/DominoOrdering.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -47,6 +47,12 @@
       this.message = message;
    }
 
+   /**
+    * Initialize transitions.
+    *
+    * @param dominoes all dominoes
+    * @param cause the possible cycle cause
+    */
    @SuppressWarnings("unchecked")
    protected void init(List<T> dominoes, Object cause)
    {
@@ -90,6 +96,13 @@
       }
    }
 
+   /**
+    * Order dominoes.
+    *
+    * @param dominoes all dominoes
+    * @param cause the possible cycle cause
+    * @return ordered dominoes list
+    */
    public List<T> orderDominoes(List<T> dominoes, Object cause)
    {
       // prepare initial transitions
@@ -158,6 +171,9 @@
       return -1;
    }
 
+   /**
+    * Fill transitions with name compare.
+    */
    protected void fillCompareNames()
    {
       for (int i = 0; i < size - 1; i++)
@@ -182,6 +198,11 @@
       }
    }
 
+   /**
+    * Throw the cycle exception.
+    *
+    * @param cause the cycle cause
+    */
    protected void throwCycleException(Object cause)
    {
       StringBuilder builder = new StringBuilder();
@@ -191,6 +212,9 @@
       throw new IllegalStateException(builder.toString());
    }
 
+   /**
+    * The index comparator.
+    */
    protected class IndexComparator implements Comparator<Integer>
    {
       public int compare(Integer i1, Integer i2)

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/classloading/test/ModuleRemoveUnitTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -76,7 +76,7 @@
       }
       finally
       {
-         mainDeployer.undeploy(ad);
+         mainDeployer.undeploy(ad);        
          assertAlias(false, "A");
       }
    }
@@ -164,4 +164,4 @@
       controller = super.getController();
       return controller;
    }
-}
+}
\ No newline at end of file

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-impl/src/test/java/org/jboss/test/deployers/deployer/test/DeployerFlowUnitTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -797,4 +797,49 @@
       assertEquals(6, deployer3.getUndeployOrder());
       assertEquals(5, deployer4.getUndeployOrder());
    }
+
+   public void testWebBeansOrder() throws Exception
+   {
+      DeployerClient main = createMainDeployer();
+
+      TestFlowDeployer mcfcld = new TestFlowDeployer("ManagedConnectionFactory");
+      mcfcld.setInputs("ManagedConnectionFactoryDeploymentGroup");
+      mcfcld.setOutputs("CLMD");
+      addDeployer(main, mcfcld);
+
+      TestFlowDeployer postJBWMD = new TestFlowDeployer("PostJBossWebMetadataDeployer");
+      postJBWMD.setInputs("JBWMD", "CLMD");
+      postJBWMD.setOutputs("JBWMD", "CLMD");
+      addDeployer(main, postJBWMD);
+
+      TestFlowDeployer postEJB = new TestFlowDeployer("PostEjbJar");
+      postEJB.setInputs("EJB");
+      postEJB.setOutputs("EJB");
+      addDeployer(main, postEJB);
+
+      TestFlowDeployer warCL = new TestFlowDeployer("WarClassLoaderDeployer");
+      warCL.setInputs("JBWMD", "CLMD");
+      warCL.setOutputs("CLMD");
+      addDeployer(main, warCL);
+
+      TestFlowDeployer service = new TestFlowDeployer("ServiceCL");
+      service.setInputs("ServiceDeployment");
+      service.setOutputs("CLMD");
+      addDeployer(main, service);
+
+      TestFlowDeployer legacy = new TestFlowDeployer("Legacy");
+      legacy.setInputs("JBWMD", "WMD");
+      legacy.setOutputs("JBWMD");
+      addDeployer(main, legacy);
+
+      TestFlowDeployer cluster = new TestFlowDeployer("Cluster");
+      cluster.setInputs("JBWMD");
+      cluster.setOutputs("JBWMD");
+      addDeployer(main, cluster);
+
+      TestFlowDeployer postWMD = new TestFlowDeployer("PostWebMetadataDeployer");
+      postWMD.setInputs("JBWMD");
+      postWMD.setOutputs("JBWMD");
+      addDeployer(main, postWMD);
+   }
 }

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-spi/src/main/java/org/jboss/deployers/spi/deployer/helpers/AbstractDeploymentVisitor.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -50,6 +50,7 @@
     * @param deployment the deployment
     * @return list of components
     */
+   // TODO - change to Iterable - JBDEPLOY-134  
    protected abstract List<? extends C> getComponents(T deployment);
 
    /**

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java (from rev 83469, projects/jboss-deployers/trunk/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/StructureProcessor.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.structure.spi;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+
+/**
+ * Pre and post structure metadata processor.
+ *
+ * @author ales.justin at jboss.org
+ */
+public interface StructureProcessor
+{
+   /**
+    * Prepare structure metadata.
+    *
+    * @param deployment the deployment
+    * @param structureMetaData the structure metadata
+    */
+   void prepareStructureMetaData(Deployment deployment, StructureMetaData structureMetaData);
+
+   /**
+    * Prepare context info.
+    *
+    * @param parentDeploymentContext the parent deployment context
+    * @param contextInfo the context info
+    */
+   void prepareContextInfo(DeploymentContext parentDeploymentContext, ContextInfo contextInfo);
+
+   /**
+    * Apply structure metadata.
+    *
+    * @param deploymentContext the deployment context
+    * @param structureMetaData the structure metadata
+    */
+   void applyStructureMetaData(DeploymentContext deploymentContext, StructureMetaData structureMetaData);
+
+   /**
+    * Apply context info.
+    *
+    * @param deploymentContext the deployment context
+    * @param contextInfo the context info
+    */
+   void applyContextInfo(DeploymentContext deploymentContext, ContextInfo contextInfo);
+}
\ No newline at end of file

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-structure-spi/src/main/java/org/jboss/deployers/structure/spi/helpers/AbstractStructureBuilder.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -34,19 +34,24 @@
 import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
 import org.jboss.deployers.structure.spi.DeploymentContext;
 import org.jboss.deployers.structure.spi.StructureBuilder;
+import org.jboss.deployers.structure.spi.StructureProcessor;
 import org.jboss.logging.Logger;
 
 /**
  * AbstractStructureBuilder.
  * 
  * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
  * @version $Revision: 1.1 $
  */
 public class AbstractStructureBuilder implements StructureBuilder
 {
    /** The log */
    private final Logger log = Logger.getLogger(getClass());
-   
+
+   /** The structure processor */
+   private StructureProcessor structureProcessor;
+
    public DeploymentContext populateContext(Deployment deployment, StructureMetaData metaData) throws DeploymentException
    {
       if (deployment == null)
@@ -61,6 +66,8 @@
       DeploymentContext result;
       try
       {
+         prepareStructureMetaData(deployment, metaData);
+
          result = createRootDeploymentContext(deployment, metaData);
          if (result == null)
             throw new IllegalStateException("Root deployment context is null");
@@ -69,6 +76,8 @@
          ContextInfo contextInfo = metaData.getContext("");
          if (contextInfo == null)
             contextInfo = StructureMetaDataFactory.createContextInfo("", null);
+
+         applyStructureMetaData(result, metaData);
          contextInfo.setPredeterminedManagedObjects(deployment.getPredeterminedManagedObjects());
          applyContextInfo(result, contextInfo);
       }
@@ -120,6 +129,8 @@
             // Only process the child contexts
             if ("".equals(child.getPath()) == false)
             {
+               prepareContextInfo(context, child);
+
                DeploymentContext childContext = createChildDeploymentContext(context, child);
                if (childContext == null)
                   throw new IllegalStateException("Child deployment context is null");
@@ -146,6 +157,42 @@
    }
 
    /**
+    * Prepare the structure metadata.
+    *
+    * @param deploymentContext the deployment
+    * @param structureMetaData the structure metadata
+    */
+   protected void prepareStructureMetaData(Deployment deploymentContext, StructureMetaData structureMetaData)
+   {
+      if (structureProcessor != null)
+         structureProcessor.prepareStructureMetaData(deploymentContext, structureMetaData);
+   }
+
+   /**
+    * Prepare the structure metadata.
+    *
+    * @param parentDeploymentContext the parent deployment context
+    * @param contextInfo the context info
+    */
+   protected void prepareContextInfo(DeploymentContext parentDeploymentContext, ContextInfo contextInfo)
+   {
+      if (structureProcessor != null)
+         structureProcessor.prepareContextInfo(parentDeploymentContext, contextInfo);
+   }
+
+   /**
+    * Apply the structure metadata.
+    *
+    * @param deploymentContext the parent deployment context
+    * @param structureMetaData the structure metadata
+    */
+   protected void applyStructureMetaData(DeploymentContext deploymentContext, StructureMetaData structureMetaData)
+   {
+      if (structureProcessor != null)
+         structureProcessor.applyStructureMetaData(deploymentContext, structureMetaData);
+   }
+
+   /**
     * Apply the context info. This transfers the PredeterminedManagedObjects
     * and TransientManagedObjects and other information from the ContextInfo to the DeploymentContext.
     * 
@@ -161,6 +208,9 @@
 
       context.setRelativeOrder(contextInfo.getRelativeOrder());
       applyComparator(context, contextInfo);
+
+      if (structureProcessor != null)
+         structureProcessor.applyContextInfo(context, contextInfo);
    }
 
    /**
@@ -238,4 +288,24 @@
       String name = parent.getName() + "/" + path;
       return new AbstractDeploymentContext(name, path); 
    }
+
+   /**
+    * Set structure processor.
+    *
+    * @param structureProcessor the context info processor
+    */
+   public void setStructureProcessor(StructureProcessor structureProcessor)
+   {
+      this.structureProcessor = structureProcessor;
+   }
+
+   /**
+    * Get the context info processor.
+    *
+    * @return the structure processor
+    */
+   protected StructureProcessor getStructureProcessor()
+   {
+      return structureProcessor;
+   }
 }

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/InMemoryClassesDeployer.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -22,7 +22,6 @@
 package org.jboss.deployers.vfs.plugins.classloader;
 
 import java.net.URL;
-import java.util.List;
 
 import org.jboss.classloading.spi.metadata.ClassLoadingMetaData;
 import org.jboss.deployers.spi.DeploymentException;
@@ -100,12 +99,7 @@
          VirtualFile classes = unit.removeAttachment(DYNAMIC_CLASS_KEY, VirtualFile.class);
          if (classes != null)
          {
-            List<VirtualFile> classPath = unit.getClassPath();
-            if (classPath != null)
-            {
-               classPath.remove(classes);
-               unit.setClassPath(classPath);
-            }
+            unit.removeClassPath(classes);
          }
       }
       finally

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/classloader/UrlIntegrationDeployer.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -123,7 +123,7 @@
          {
             for (URL integrationURL : integrationURLs)
             {
-               VirtualFile integration = VFS.getCachedFile(integrationURL);
+               VirtualFile integration = VFS.getRoot(integrationURL);
                unit.addClassPath(integration);
                added.add(integration);
             }
@@ -150,7 +150,7 @@
          {
             try
             {
-               VirtualFile integration = VFS.getCachedFile(integrationURL);
+               VirtualFile integration = VFS.getRoot(integrationURL);
                classPath.remove(integration);
             }
             catch (Throwable t)

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/dependency/DependenciesMetaDataDeployer.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -50,4 +50,4 @@
       Object contextName = context.getName();
       unit.addAttachment(DeploymentDependencies.class, new DeploymentDependenciesImpl(contextName, deployment));
    }
-}
+}
\ No newline at end of file

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentContext.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -25,9 +25,9 @@
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import java.util.Arrays;
 
 import org.jboss.deployers.structure.spi.DeploymentUnit;
 import org.jboss.deployers.structure.spi.helpers.AbstractDeploymentContext;
@@ -152,12 +152,26 @@
       }
    }
 
+   /**
+    * Get mutable metadata locations.
+    *
+    * @return the mutable metadata locations
+    */
+   protected List<VirtualFile> getMutableMetaDataLocations()
+   {
+      return metaDataLocations;
+   }
+
    public List<VirtualFile> getMetaDataLocations()
    {
-      if (metaDataLocations == null)
+      if (metaDataLocations == null || metaDataLocations.isEmpty())
+      {
          return Collections.emptyList();
-
-      return metaDataLocations;
+      }
+      else
+      {
+         return Collections.unmodifiableList(metaDataLocations);
+      }
    }
 
    public void setMetaDataLocations(List<VirtualFile> locations)
@@ -272,16 +286,81 @@
       }
    }
 
+   public void prependMetaDataLocation(VirtualFile... locations)
+   {
+      if (locations == null)
+         throw new IllegalArgumentException("Null locations");
+
+      List<VirtualFile> metadataLocations = getMutableMetaDataLocations();
+      if (metadataLocations == null)
+         metadataLocations = new ArrayList<VirtualFile>();
+
+      for (int i = locations.length-1; i >= 0; --i)
+      {
+         VirtualFile location = locations[i];
+         if (location == null)
+            throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(locations));
+         metadataLocations.add(0, location);
+      }
+      setMetaDataLocations(metadataLocations);
+   }
+
+   public void appendMetaDataLocation(VirtualFile... locations)
+   {
+      if (locations == null)
+         throw new IllegalArgumentException("Null location");
+
+      List<VirtualFile> metaDataLocations = getMutableMetaDataLocations();
+      if (metaDataLocations == null)
+         metaDataLocations = new ArrayList<VirtualFile>();
+
+      for (VirtualFile location : locations)
+      {
+         if (location == null)
+            throw new IllegalArgumentException("Null virtual file in " + Arrays.toString(locations));
+         metaDataLocations.add(location);
+      }
+      setMetaDataLocations(metaDataLocations);
+   }
+
+   public void removeMetaDataLocation(VirtualFile... locations)
+   {
+      if (locations == null || locations.length == 0)
+         return;
+
+      for (VirtualFile location : locations)
+      {
+         metaDataLocations.remove(location);
+      }
+   }
+
    public VirtualFile getFile(String name)
    {
       return getResourceLoader().getFile(name);
    }
 
-   public List<VirtualFile> getClassPath()
+   /**
+    * Get mutable classpath.
+    *
+    * @return the mutable classpath
+    */
+   protected List<VirtualFile> getMutableClassPath()
    {
       return classPath;
    }
 
+   public List<VirtualFile> getClassPath()
+   {
+      if (classPath == null || classPath.isEmpty())
+      {
+         return Collections.emptyList();
+      }
+      else
+      {
+         return Collections.unmodifiableList(classPath);
+      }
+   }
+
    public void setClassPath(List<VirtualFile> paths)
    {
       this.classPath = paths;
@@ -294,7 +373,7 @@
       if (files == null)
          throw new IllegalArgumentException("Null files");
 
-      List<VirtualFile> classPath = getClassPath();
+      List<VirtualFile> classPath = getMutableClassPath();
       if (classPath == null)
          classPath = new ArrayList<VirtualFile>();
 
@@ -312,7 +391,7 @@
       if (files == null)
          throw new IllegalArgumentException("Null files");
 
-      List<VirtualFile> classPath = getClassPath();
+      List<VirtualFile> classPath = getMutableClassPath();
       if (classPath == null)
          classPath = new ArrayList<VirtualFile>();
 
@@ -331,7 +410,7 @@
       if (files == null)
          throw new IllegalArgumentException("Null files");
 
-      List<VirtualFile> classPath = getClassPath();
+      List<VirtualFile> classPath = getMutableClassPath();
       if (classPath == null)
          classPath = new ArrayList<VirtualFile>();
 
@@ -350,7 +429,7 @@
       if (files == null)
          throw new IllegalArgumentException("Null files");
 
-      List<VirtualFile> classPath = getClassPath();
+      List<VirtualFile> classPath = getMutableClassPath();
       if (classPath == null)
          classPath = new ArrayList<VirtualFile>();
 
@@ -363,6 +442,17 @@
       setClassPath(classPath);
    }
 
+   public void removeClassPath(VirtualFile... files)
+   {
+      if (files == null || files.length == 0)
+         return;
+
+      for (VirtualFile file : files)
+      {
+         classPath.remove(file);
+      }
+   }
+
    @Override
    public VFSDeploymentContext getTopLevel()
    {
@@ -384,6 +474,19 @@
       return new AbstractVFSDeploymentUnit(this);
    }
 
+   @Override
+   public void cleanup()
+   {
+      try
+      {
+         root.cleanup();
+      }
+      finally
+      {
+         super.cleanup();
+      }
+   }
+   
    @SuppressWarnings("unchecked")
    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
    {

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/AbstractVFSDeploymentUnit.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -33,6 +33,7 @@
  * AbstractVFSDeploymentUnit.
  * 
  * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
  * @version $Revision: 1.1 $
  */
 public class AbstractVFSDeploymentUnit extends AbstractDeploymentUnit implements VFSDeploymentUnit
@@ -68,6 +69,21 @@
       return getDeploymentContext().getMetaDataFiles(name, suffix);
    }
 
+   public void prependMetaDataLocation(VirtualFile... locations)
+   {
+      getDeploymentContext().prependMetaDataLocation(locations);
+   }
+
+   public void appendMetaDataLocation(VirtualFile... locations)
+   {
+      getDeploymentContext().appendMetaDataLocation(locations);
+   }
+
+   public void removeMetaDataLocation(VirtualFile... locations)
+   {
+      getDeploymentContext().removeMetaDataLocation(locations);
+   }
+
    @Override
    public VFSDeploymentResourceLoader getResourceLoader()
    {
@@ -124,6 +140,11 @@
       getDeploymentContext().appendClassPath(files);
    }
 
+   public void removeClassPath(VirtualFile... files)
+   {
+      getDeploymentContext().removeClassPath(files);
+   }
+
    @Override
    public VFSDeploymentUnit getParent()
    {

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -64,7 +64,9 @@
                VirtualFile jbossStructure = file.getChild("META-INF/jboss-structure.xml");
                if (jbossStructure != null)
                {
-                  log.trace("... context has a META-INF/jboss-structure.xml");
+                  if (trace)
+                     log.trace("... context has a META-INF/jboss-structure.xml");
+
                   URL url = jbossStructure.toURL();
                   UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
                   Unmarshaller unmarshaller = factory.newUnmarshaller();

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/AbstractModificationTypeMatcher.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.vfs.plugins.structure.modify;
+
+import java.util.List;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.ModificationType;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.logging.Logger;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Abstract modification type matcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class AbstractModificationTypeMatcher implements ModificationTypeMatcher
+{
+   protected Logger log = Logger.getLogger(getClass());
+
+   private boolean checkChildren;
+   private boolean topLevelOnly;
+   private boolean childrenOnly;
+
+   private ModificationType modificationType;
+
+   public boolean determineModification(VirtualFile root, StructureMetaData structureMetaData)
+   {
+      ContextInfo contextInfo = structureMetaData.getContext("");
+      if (childrenOnly == false)
+      {
+         boolean result = isModificationDetermined(root, contextInfo);
+         if (result)
+         {
+            contextInfo.setModificationType(modificationType);
+            return true;
+         }
+      }
+
+      if (checkChildren)
+      {
+         List<ContextInfo> contexts = structureMetaData.getContexts();
+         if (contexts != null && contexts.isEmpty() == false)
+         {
+            for (ContextInfo child : contexts)
+            {
+               String path = child.getPath();
+               // Only process the child contexts
+               if ("".equals(path) == false)
+               {
+                  try
+                  {
+                     VirtualFile file = root.getChild(path);
+                     if (file != null && isModificationDetermined(file, child))
+                     {
+                        contextInfo.setModificationType(modificationType);
+                        return true;
+                     }
+                  }
+                  catch (Exception e)
+                  {
+                     log.debug("Exception checking child context (" + child + ") for modification, cause: " + e);
+                  }
+               }
+            }
+         }
+      }
+      return false;
+   }
+
+   public boolean determineModification(VirtualFile root, ContextInfo contextInfo)
+   {
+      boolean result = false;
+      if (topLevelOnly == false)
+      {
+         result = isModificationDetermined(root, contextInfo);
+         if (result)
+         {
+            contextInfo.setModificationType(modificationType);
+         }
+      }
+      return result;
+   }
+
+   /**
+    * Is modification determined.
+    *
+    * @param file the file
+    * @param contextInfo the context info
+    * @return true if we should apply modification type, false otherwise
+    */
+   protected abstract boolean isModificationDetermined(VirtualFile file, ContextInfo contextInfo);
+
+   /**
+    * Do we apply modification to the top structure context.
+    *
+    * @param checkChildren the apply to top flag
+    */
+   public void setCheckChildren(boolean checkChildren)
+   {
+      this.checkChildren = checkChildren;
+   }
+
+   /**
+    * Is this matcher top level only.
+    *
+    * @param topLevelOnly the top level only flag
+    */
+   public void setTopLevelOnly(boolean topLevelOnly)
+   {
+      this.topLevelOnly = topLevelOnly;
+   }
+
+   /**
+    * Is this matcher children only.
+    *
+    * @param childrenOnly the children only flag
+    */
+   public void setChildrenOnly(boolean childrenOnly)
+   {
+      this.childrenOnly = childrenOnly;
+   }
+
+   /**
+    * Set the modification type.
+    *
+    * @param modificationType the modification type
+    */
+   public void setModificationType(ModificationType modificationType)
+   {
+      this.modificationType = modificationType;
+   }
+}
\ No newline at end of file

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/FileModificationTypeMatcher.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,118 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.vfs.plugins.structure.modify;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.ArrayList;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * File modification type matcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class FileModificationTypeMatcher extends AbstractModificationTypeMatcher
+{
+   private String[] paths;
+   private boolean metadataOnly;
+
+   public FileModificationTypeMatcher(String... paths)
+   {
+      if (paths == null || paths.length == 0)
+         throw new IllegalArgumentException("Null or empty paths");
+
+      this.paths = paths;
+   }
+
+   protected boolean isModificationDetermined(VirtualFile root, ContextInfo contextInfo)
+   {
+      for (String path : paths)
+      {
+         for (VirtualFile file : getStartingFiles(root, contextInfo))
+         {
+            try
+            {
+               if (file.getChild(path) != null)
+                  return true;
+            }
+            catch (Exception e)
+            {
+               log.debug("Cannot determine modification type, cause: " + e);
+            }
+         }
+      }
+      return false;
+   }
+
+   /**
+    * Get starting files for path check.
+    *
+    * @param file the current file
+    * @param contextInfo the context info
+    * @return list of starting files
+    */
+   protected List<VirtualFile> getStartingFiles(VirtualFile file, ContextInfo contextInfo)
+   {
+      if (metadataOnly)
+      {
+         List<String> metadataPaths = contextInfo.getMetaDataPath();
+         if (metadataPaths == null || metadataPaths.isEmpty())
+         {
+            return Collections.emptyList();
+         }
+         else
+         {
+            List<VirtualFile> result = new ArrayList<VirtualFile>(metadataPaths.size());
+            for (String metadataPath : metadataPaths)
+            {
+               try
+               {
+                  VirtualFile child = file.getChild(metadataPath);
+                  if (child != null)
+                     result.add(child);
+               }
+               catch (Exception ignored)
+               {
+               }
+            }
+            return result;
+         }
+      }
+      else
+      {
+         return Collections.singletonList(file);
+      }
+   }
+
+   /**
+    * Should we check metadata only.
+    *
+    * @param metadataOnly the metadata only flag
+    */
+   public void setMetadataOnly(boolean metadataOnly)
+   {
+      this.metadataOnly = metadataOnly;
+   }
+}
\ No newline at end of file

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeMatcher.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.vfs.plugins.structure.modify;
+
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Determine if we need some modification.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public interface ModificationTypeMatcher
+{
+   /**
+    * Should we modify the file.
+    *
+    * @param root the deployment root
+    * @param structureMetaData the current structure metadata
+    * @return true if we determined modification
+    */
+   boolean determineModification(VirtualFile root, StructureMetaData structureMetaData);
+
+   /**
+    * Should we modify the file.
+    *
+    * @param root the deployment root
+    * @param contextInfo the current context info
+    * @return true if we determined modification
+    */
+   boolean determineModification(VirtualFile root, ContextInfo contextInfo);
+}
\ No newline at end of file

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/ModificationTypeStructureProcessor.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.vfs.plugins.structure.modify;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.deployers.client.spi.Deployment;
+import org.jboss.deployers.spi.structure.ContextInfo;
+import org.jboss.deployers.spi.structure.StructureMetaData;
+import org.jboss.deployers.structure.spi.StructureProcessor;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * Determine if we need some modification.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class ModificationTypeStructureProcessor implements StructureProcessor
+{
+   private List<ModificationTypeMatcher> matchers;
+
+   public void prepareStructureMetaData(Deployment deployment, StructureMetaData structureMetaData)
+   {
+      if (deployment instanceof VFSDeployment == false)
+         return;
+
+      VFSDeployment vfsDeployment = VFSDeployment.class.cast(deployment);
+      VirtualFile root = vfsDeployment.getRoot();
+      checkForModification(root, structureMetaData);
+   }
+
+   public void prepareContextInfo(DeploymentContext parentDeploymentContext, ContextInfo contextInfo)
+   {
+      if (parentDeploymentContext instanceof VFSDeploymentContext == false || contextInfo == null)
+         return;
+
+      VFSDeploymentContext vfsParentDeploymentContext = VFSDeploymentContext.class.cast(parentDeploymentContext);
+      VirtualFile root = vfsParentDeploymentContext.getFile(contextInfo.getPath());
+      checkForModification(root, contextInfo);
+   }
+
+   public void applyStructureMetaData(DeploymentContext deploymentContext, StructureMetaData structureMetaData)
+   {
+   }
+
+   public void applyContextInfo(DeploymentContext deploymentContext, ContextInfo contextInfo)
+   {
+   }
+
+   /**
+    * Check for modification.
+    *
+    * @param root the deployment root
+    * @param structureMetaData the structure metadata
+    */
+   protected void checkForModification(VirtualFile root, StructureMetaData structureMetaData)
+   {
+      ContextInfo contex = structureMetaData.getContext("");
+      if (contex == null || contex.getModificationType() != null)
+         return;
+
+      if (matchers != null && matchers.isEmpty() == false)
+      {
+         for (ModificationTypeMatcher matcher : matchers)
+         {
+            if (matcher.determineModification(root, structureMetaData))
+            {
+               break;
+            }
+         }
+      }
+   }
+
+   /**
+    * Check for modification.
+    *
+    * @param root the deployment root
+    * @param contextInfo the context info
+    */
+   protected void checkForModification(VirtualFile root, ContextInfo contextInfo)
+   {
+      if (root == null || contextInfo == null || contextInfo.getModificationType() != null)
+         return;
+
+      if (matchers != null && matchers.isEmpty() == false)
+      {
+         for (ModificationTypeMatcher matcher : matchers)
+         {
+            if (matcher.determineModification(root, contextInfo))
+            {
+               break;
+            }
+         }
+      }
+   }
+
+   /**
+    * Set modification type matchers.
+    *
+    * @param matchers the modification type matchers.
+    */
+   public void setMatchers(List<ModificationTypeMatcher> matchers)
+   {
+      this.matchers = matchers;
+   }
+
+   /**
+    * Add modification type matcher.
+    *
+    * @param matcher the modification type matcher
+    */
+   public void addMatcher(ModificationTypeMatcher matcher)
+   {
+      if (matchers == null)
+         matchers = new ArrayList<ModificationTypeMatcher>();
+
+      matchers.add(matcher);
+   }
+
+   /**
+    * Remove modification type matcher.
+    *
+    * @param matcher the modification type matcher
+    */
+   public void removeMatcher(ModificationTypeMatcher matcher)
+   {
+      if (matchers != null)
+      {
+         matchers.remove(matcher);
+      }
+   }
+}

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/modify/TempTopModificationTypeMatcher.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.deployers.vfs.plugins.structure.modify;
+
+import org.jboss.deployers.spi.structure.ModificationType;
+
+/**
+ * Temp top modification type matcher.
+ *
+ * @author <a href="mailto:ales.justin at jboss.org">Ales Justin</a>
+ */
+public class TempTopModificationTypeMatcher extends FileModificationTypeMatcher
+{
+   public TempTopModificationTypeMatcher(String... paths)
+   {
+      super(paths);
+      setCheckChildren(true);
+      setModificationType(ModificationType.TEMP);
+      setTopLevelOnly(true);
+   }
+}
\ No newline at end of file

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/main/resources/schema/jboss-deployers-2.0.xsd	2009-01-27 13:38:45 UTC (rev 83487)
@@ -25,7 +25,7 @@
       <xsd:annotation>
          <xsd:documentation>
             <![CDATA[
-            The root classloader element
+            The root parser type element
             ]]>
          </xsd:documentation>
       </xsd:annotation>

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/DeployersVFSTestSuite.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -40,6 +40,7 @@
 import org.jboss.test.deployers.vfs.parsing.test.ParsingTestSuite;
 import org.jboss.test.deployers.vfs.structure.VFSStructureTestSuite;
 import org.jboss.test.deployers.vfs.structurebuilder.VFSStructureBuilderTestSuite;
+import org.jboss.test.deployers.vfs.structureprocessor.VFSStructureProcessorTestSuite;
 import org.jboss.test.deployers.vfs.xb.JBossXBDeployersTestSuite;
 
 /**
@@ -62,6 +63,7 @@
 
       suite.addTest(VFSDeploymentFactoryTestSuite.suite());
       suite.addTest(VFSStructureBuilderTestSuite.suite());
+      suite.addTest(VFSStructureProcessorTestSuite.suite());
       suite.addTest(VFSStructureTestSuite.suite());
       suite.addTest(VFSMetaDataTestSuite.suite());
       suite.addTest(ParsingTestSuite.suite());

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/dependency/test/DependenciesTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -117,4 +117,63 @@
          undeploy(du);
       }
    }
+
+   public void testBeanRedeploy() throws Throwable
+   {
+      DeploymentUnit du = addDeployment("/dependency", "bean");
+      try
+      {
+         assertDeployment(du, new ControllerState("PreReal"));
+         DeploymentUnit tmDU = assertDeploy("/dependency", "support");
+         try
+         {
+            assertDeployment(du, ControllerState.INSTALLED);
+
+            undeploy(tmDU);
+
+            assertDeployment(du, new ControllerState("PreReal"));
+
+            tmDU = assertDeploy("/dependency", "support");
+
+            assertDeployment(du, ControllerState.INSTALLED);
+         }
+         finally
+         {
+            undeploy(tmDU);
+         }
+      }
+      finally
+      {
+         undeploy(du);
+      }
+   }
+
+   public void testModuleAndAliasRedeploy() throws Throwable
+   {
+      DeploymentUnit du = addDeployment("/dependency", "module");
+      try
+      {
+         assertDeployment(du, ControllerState.PRE_INSTALL);
+         DeploymentUnit aliasDU = assertDeploy("/dependency", "alias");
+         try
+         {
+            assertDeployment(aliasDU, ControllerState.INSTALLED);
+            assertDeployment(du, ControllerState.INSTALLED);
+
+            undeploy(aliasDU);
+            assertDeployment(du, ControllerState.PRE_INSTALL);
+
+            aliasDU = assertDeploy("/dependency", "alias");
+            assertDeployment(du, ControllerState.INSTALLED);            
+         }
+         finally
+         {
+            undeploy(aliasDU);
+         }
+      }
+      finally
+      {
+         undeploy(du);
+      }
+   }
 }

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/deployer/validate/support/MyVirtualFile.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -186,6 +186,10 @@
          {
             return null;
          }
+
+         public void cleanup()
+         {
+         }
       };
    }
 }

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/parsing/test/DeployersAltDDTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -205,6 +205,10 @@
          {
             return null;
          }
+
+         public void cleanup()
+         {
+         }
       });
       return altDD;
    }

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structure/file/test/FileMatcherTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -235,6 +235,10 @@
             {
                return null;
             }
+
+            public void cleanup()
+            {
+            }
          };
       }
 

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structurebuilder/test/VFSStructureBuilderUnitTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -127,7 +127,7 @@
       List<VirtualFile> classPath = context.getClassPath();
       
       if (classPathEntries == null)
-         assertNull(classPath);
+         assertEmpty(classPath);
       else
       {
          int cpeSize = classPathEntries.size();

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor)

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java	2009-01-27 12:13:50 UTC (rev 83469)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -1,49 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.deployers.vfs.structureprocessor;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-import org.jboss.test.deployers.vfs.structureprocessor.test.VFSStructureProcessorUnitTestCase;
-
-/**
- * VFSStructureProcessorTestSuite.
- *
- * @author <a href="ales.justin at jboss.org">Ales Justin</a>
- */
-public class VFSStructureProcessorTestSuite extends TestSuite
-{
-   public static void main(String[] args)
-   {
-      TestRunner.run(suite());
-   }
-
-   public static Test suite()
-   {
-      TestSuite suite = new TestSuite("VFS Structure Processor Tests");
-
-      suite.addTest(VFSStructureProcessorUnitTestCase.suite());
-
-      return suite;
-   }
-}
\ No newline at end of file

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/VFSStructureProcessorTestSuite.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.structureprocessor;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import junit.textui.TestRunner;
+import org.jboss.test.deployers.vfs.structureprocessor.test.VFSStructureProcessorUnitTestCase;
+
+/**
+ * VFSStructureProcessorTestSuite.
+ *
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ */
+public class VFSStructureProcessorTestSuite extends TestSuite
+{
+   public static void main(String[] args)
+   {
+      TestRunner.run(suite());
+   }
+
+   public static Test suite()
+   {
+      TestSuite suite = new TestSuite("VFS Structure Processor Tests");
+
+      suite.addTest(VFSStructureProcessorUnitTestCase.suite());
+
+      return suite;
+   }
+}
\ No newline at end of file

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/support (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/support)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test)

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java	2009-01-27 12:13:50 UTC (rev 83469)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -1,61 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.deployers.vfs.structureprocessor.test;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.jboss.deployers.structure.spi.StructureBuilder;
-import org.jboss.deployers.structure.spi.StructureProcessor;
-import org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder;
-import org.jboss.test.deployers.BaseDeployersVFSTest;
-
-/**
- * StructureProcessorUnitTest.
- *
- * @author <a href="ales.justin at jboss.org">Ales Justin</a>
- */
-public abstract class StructureProcessorUnitTest extends BaseDeployersVFSTest
-{
-   public static Test suite()
-   {
-      return new TestSuite(StructureProcessorUnitTest.class);
-   }
-
-   public StructureProcessorUnitTest(String name)
-   {
-      super(name);
-   }
-
-   @Override
-   protected StructureBuilder createStructureBuilder()
-   {
-      StructureBuilder structureBuilder = super.createStructureBuilder();
-      if (structureBuilder instanceof AbstractStructureBuilder)
-      {
-         AbstractStructureBuilder asb = AbstractStructureBuilder.class.cast(structureBuilder);
-         asb.setStructureProcessor(createStructureProcessor());
-      }
-      return structureBuilder;
-   }
-
-   protected abstract StructureProcessor createStructureProcessor();
-}
\ No newline at end of file

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/StructureProcessorUnitTest.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.structureprocessor.test;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.deployers.structure.spi.StructureBuilder;
+import org.jboss.deployers.structure.spi.StructureProcessor;
+import org.jboss.deployers.structure.spi.helpers.AbstractStructureBuilder;
+import org.jboss.test.deployers.BaseDeployersVFSTest;
+
+/**
+ * StructureProcessorUnitTest.
+ *
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ */
+public abstract class StructureProcessorUnitTest extends BaseDeployersVFSTest
+{
+   public static Test suite()
+   {
+      return new TestSuite(StructureProcessorUnitTest.class);
+   }
+
+   public StructureProcessorUnitTest(String name)
+   {
+      super(name);
+   }
+
+   @Override
+   protected StructureBuilder createStructureBuilder()
+   {
+      StructureBuilder structureBuilder = super.createStructureBuilder();
+      if (structureBuilder instanceof AbstractStructureBuilder)
+      {
+         AbstractStructureBuilder asb = AbstractStructureBuilder.class.cast(structureBuilder);
+         asb.setStructureProcessor(createStructureProcessor());
+      }
+      return structureBuilder;
+   }
+
+   protected abstract StructureProcessor createStructureProcessor();
+}
\ No newline at end of file

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java	2009-01-27 12:13:50 UTC (rev 83469)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -1,155 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.test.deployers.vfs.structureprocessor.test;
-
-import java.util.Arrays;
-import java.util.Collection;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.jboss.deployers.client.spi.DeployerClient;
-import org.jboss.deployers.plugins.main.MainDeployerImpl;
-import org.jboss.deployers.structure.spi.DeploymentContext;
-import org.jboss.deployers.structure.spi.StructureProcessor;
-import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
-import org.jboss.deployers.vfs.plugins.structure.modify.FileModificationTypeMatcher;
-import org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeMatcher;
-import org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeStructureProcessor;
-import org.jboss.deployers.vfs.spi.client.VFSDeployment;
-import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
-import org.jboss.deployers.spi.structure.ModificationType;
-import org.jboss.virtual.VFSUtils;
-import org.jboss.virtual.VirtualFile;
-
-/**
- * VFSStructureProcessorUnitTestCase.
- *
- * @author <a href="ales.justin at jboss.org">Ales Justin</a>
- */
-public class VFSStructureProcessorUnitTestCase extends StructureProcessorUnitTest
-{
-   public static Test suite()
-   {
-      return new TestSuite(VFSStructureProcessorUnitTestCase.class);
-   }
-
-   public VFSStructureProcessorUnitTestCase(String name)
-   {
-      super(name);
-   }
-
-   protected StructureProcessor createStructureProcessor()
-   {
-      ModificationTypeStructureProcessor mtsp = new ModificationTypeStructureProcessor();
-
-      ModificationTypeMatcher topAndChildren = createTempMatcher(true, true, false, true, "child.xml");
-      ModificationTypeMatcher directTop = createTempMatcher(true, false, true, false, "top.xml");
-      ModificationTypeMatcher justChildren = createTempMatcher(true, false, false, true, "sub.xml");
-
-      mtsp.setMatchers(Arrays.asList(directTop, topAndChildren, justChildren));
-      return mtsp;
-   }
-
-   protected ModificationTypeMatcher createTempMatcher(
-         boolean metadataOnly,
-         boolean checkChildren,
-         boolean topLevelOnly,
-         boolean childrenOnly,
-         String... paths)
-   {
-      FileModificationTypeMatcher matcher = new FileModificationTypeMatcher(paths);
-      matcher.setModificationType(ModificationType.TEMP);
-      matcher.setMetadataOnly(metadataOnly);
-      matcher.setCheckChildren(checkChildren);
-      matcher.setTopLevelOnly(topLevelOnly);
-      matcher.setChildrenOnly(childrenOnly);
-      return matcher;
-   }
-
-   protected VFSDeploymentContext getTopDeploymentContext(DeployerClient main, String name)
-   {
-      MainDeployerImpl mdi = (MainDeployerImpl)main;
-      Collection<DeploymentContext> all = mdi.getAll();
-      for (DeploymentContext dc : all)
-      {
-         if (dc.getSimpleName().equals(name))
-            return VFSDeploymentContext.class.cast(dc);
-      }
-      throw new IllegalArgumentException("No such deployment context: " + name + ", all: " + all);
-   }
-
-   protected void testTopModification(String path) throws Exception
-   {
-      DeployerClient main = createMainDeployer();
-      addStructureDeployer(main, new JARStructure());
-
-      VFSDeployment deployment = createDeployment("/structureprocessor", path);
-      main.deploy(deployment);
-      try
-      {
-         VFSDeploymentContext vdc = getTopDeploymentContext(main, path);
-         VirtualFile root = vdc.getRoot();
-         assertTrue("Should be temp", VFSUtils.isTemporaryFile(root));
-      }
-      finally
-      {
-         main.undeploy(deployment);
-      }
-   }
-
-   public void testDirectTopLevelModification() throws Exception
-   {
-      testTopModification("directtop");
-   }
-
-   public void testTopFromChildModification() throws Exception
-   {
-      testTopModification("topfromchild");
-   }
-
-   public void testChildModification() throws Exception
-   {
-      DeployerClient main = createMainDeployer();
-      addStructureDeployer(main, new JARStructure());
-
-      VFSDeployment deployment = createDeployment("/structureprocessor", "childmod");
-      main.deploy(deployment);
-      try
-      {
-         VFSDeploymentContext vdc = getTopDeploymentContext(main, "childmod");
-         VirtualFile root = vdc.getRoot();
-         VirtualFile file = root.getChild("tempchild");
-         try
-         {
-            assertTrue("Should be temp", VFSUtils.isTemporaryFile(file));
-         }
-         finally
-         {
-            file.cleanup();
-         }
-      }
-      finally
-      {
-         main.undeploy(deployment);
-      }
-   }
-}
\ No newline at end of file

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/structureprocessor/test/VFSStructureProcessorUnitTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1,155 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.deployers.vfs.structureprocessor.test;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+import org.jboss.deployers.client.spi.DeployerClient;
+import org.jboss.deployers.plugins.main.MainDeployerImpl;
+import org.jboss.deployers.structure.spi.DeploymentContext;
+import org.jboss.deployers.structure.spi.StructureProcessor;
+import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
+import org.jboss.deployers.vfs.plugins.structure.modify.FileModificationTypeMatcher;
+import org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeMatcher;
+import org.jboss.deployers.vfs.plugins.structure.modify.ModificationTypeStructureProcessor;
+import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
+import org.jboss.deployers.spi.structure.ModificationType;
+import org.jboss.virtual.VFSUtils;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * VFSStructureProcessorUnitTestCase.
+ *
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
+ */
+public class VFSStructureProcessorUnitTestCase extends StructureProcessorUnitTest
+{
+   public static Test suite()
+   {
+      return new TestSuite(VFSStructureProcessorUnitTestCase.class);
+   }
+
+   public VFSStructureProcessorUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   protected StructureProcessor createStructureProcessor()
+   {
+      ModificationTypeStructureProcessor mtsp = new ModificationTypeStructureProcessor();
+
+      ModificationTypeMatcher topAndChildren = createTempMatcher(true, true, false, true, "child.xml");
+      ModificationTypeMatcher directTop = createTempMatcher(true, false, true, false, "top.xml");
+      ModificationTypeMatcher justChildren = createTempMatcher(true, false, false, true, "sub.xml");
+
+      mtsp.setMatchers(Arrays.asList(directTop, topAndChildren, justChildren));
+      return mtsp;
+   }
+
+   protected ModificationTypeMatcher createTempMatcher(
+         boolean metadataOnly,
+         boolean checkChildren,
+         boolean topLevelOnly,
+         boolean childrenOnly,
+         String... paths)
+   {
+      FileModificationTypeMatcher matcher = new FileModificationTypeMatcher(paths);
+      matcher.setModificationType(ModificationType.TEMP);
+      matcher.setMetadataOnly(metadataOnly);
+      matcher.setCheckChildren(checkChildren);
+      matcher.setTopLevelOnly(topLevelOnly);
+      matcher.setChildrenOnly(childrenOnly);
+      return matcher;
+   }
+
+   protected VFSDeploymentContext getTopDeploymentContext(DeployerClient main, String name)
+   {
+      MainDeployerImpl mdi = (MainDeployerImpl)main;
+      Collection<DeploymentContext> all = mdi.getAll();
+      for (DeploymentContext dc : all)
+      {
+         if (dc.getSimpleName().equals(name))
+            return VFSDeploymentContext.class.cast(dc);
+      }
+      throw new IllegalArgumentException("No such deployment context: " + name + ", all: " + all);
+   }
+
+   protected void testTopModification(String path) throws Exception
+   {
+      DeployerClient main = createMainDeployer();
+      addStructureDeployer(main, new JARStructure());
+
+      VFSDeployment deployment = createDeployment("/structureprocessor", path);
+      main.deploy(deployment);
+      try
+      {
+         VFSDeploymentContext vdc = getTopDeploymentContext(main, path);
+         VirtualFile root = vdc.getRoot();
+         assertTrue("Should be temp", VFSUtils.isTemporaryFile(root));
+      }
+      finally
+      {
+         main.undeploy(deployment);
+      }
+   }
+
+   public void testDirectTopLevelModification() throws Exception
+   {
+      testTopModification("directtop");
+   }
+
+   public void testTopFromChildModification() throws Exception
+   {
+      testTopModification("topfromchild");
+   }
+
+   public void testChildModification() throws Exception
+   {
+      DeployerClient main = createMainDeployer();
+      addStructureDeployer(main, new JARStructure());
+
+      VFSDeployment deployment = createDeployment("/structureprocessor", "childmod");
+      main.deploy(deployment);
+      try
+      {
+         VFSDeploymentContext vdc = getTopDeploymentContext(main, "childmod");
+         VirtualFile root = vdc.getRoot();
+         VirtualFile file = root.getChild("tempchild");
+         try
+         {
+            assertTrue("Should be temp", VFSUtils.isTemporaryFile(file));
+         }
+         finally
+         {
+            file.cleanup();
+         }
+      }
+      finally
+      {
+         main.undeploy(deployment);
+      }
+   }
+}
\ No newline at end of file

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/java/org/jboss/test/deployers/vfs/webbeans/test/WebBeanDiscoveryTestCase.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -65,12 +65,12 @@
          assertNotNull(wbDiscovery);
 
          Set<String> expected = new HashSet<String>();
-         addExpectedClass(expected, "ejbs.jar");
-         addExpectedClass(expected, "ext.jar");
-         addExpectedClass(expected, "simple.jar");
-         addExpectedClass(expected, "ui.jar");
-         addExpectedClass(expected, "crm.jar");
-         addExpectedClass(expected, "simple.war", "/WEB-INF/web-beans.xml");
+         addExpectedResouorce(expected, "ejbs.jar");
+         addExpectedResouorce(expected, "ext.jar");
+         addExpectedResouorce(expected, "simple.jar");
+         addExpectedResouorce(expected, "ui.jar");
+         addExpectedResouorce(expected, "crm.jar");
+         addExpectedResource(expected, "simple.war", "/WEB-INF/web-beans.xml");
 
          for (URL url : wbDiscovery.discoverWebBeansXml())
          {
@@ -110,12 +110,12 @@
       }
    }
 
-   private static void addExpectedClass(Set<String> expected, String unit)
+   private static void addExpectedResouorce(Set<String> expected, String unit)
    {
-      addExpectedClass(expected, unit, "/META-INF/web-beans.xml");
+      addExpectedResource(expected, unit, "/META-INF/web-beans.xml");
    }
 
-   private static void addExpectedClass(Set<String> expected, String unit, String suffix)
+   private static void addExpectedResource(Set<String> expected, String unit, String suffix)
    {
       expected.add(unit + suffix);
    }

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structure/ear/scanning.ear/web.jar/org/jboss/test/deployers/vfs/structure/ear/support/TestServlet.class
===================================================================
(Binary files differ)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF)

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt	2009-01-27 12:13:50 UTC (rev 83469)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt	2009-01-27 13:38:45 UTC (rev 83487)
@@ -1 +0,0 @@
-empty

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/META-INF/emtpy.txt	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1 @@
+empty

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF)

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml	2009-01-27 12:13:50 UTC (rev 83469)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml	2009-01-27 13:38:45 UTC (rev 83487)
@@ -1 +0,0 @@
-<sub/>

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/childmod/tempchild/META-INF/sub.xml	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1 @@
+<sub/>

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/directtop)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF)

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml	2009-01-27 12:13:50 UTC (rev 83469)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml	2009-01-27 13:38:45 UTC (rev 83487)
@@ -1 +0,0 @@
-<top/>

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/directtop/META-INF/top.xml	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1 @@
+<top/>

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/topfromchild)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF)

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt	2009-01-27 12:13:50 UTC (rev 83469)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt	2009-01-27 13:38:45 UTC (rev 83487)
@@ -1 +0,0 @@
-empty

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt)
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt	                        (rev 0)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/META-INF/emtpy.txt	2009-01-27 13:38:45 UTC (rev 83487)
@@ -0,0 +1 @@
+empty

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild)

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF)

Deleted: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF/child.xml
===================================================================

Copied: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF/child.xml (from rev 83469, projects/jboss-deployers/trunk/deployers-vfs/src/test/resources/structureprocessor/topfromchild/somechild/META-INF/child.xml)
===================================================================

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/StructureContext.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -21,9 +21,9 @@
 */
 package org.jboss.deployers.vfs.spi.structure;
 
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.Set;
-import java.util.HashSet;
-import java.util.Collections;
 
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.structure.ContextInfo;

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentContext.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -30,6 +30,7 @@
  * VFSDeploymentContext.
  * 
  * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
  * @version $Revision: 1.1 $
  */
 public interface VFSDeploymentContext extends DeploymentContext
@@ -82,6 +83,27 @@
    List<VirtualFile> getMetaDataFiles(String name, String suffix);
 
    /**
+    * Prepend metadata file locations.
+    * 
+    * @param locations the locations
+    */
+   void prependMetaDataLocation(VirtualFile... locations);
+
+   /**
+    * Append metadata file locations.
+    *
+    * @param locations the locations
+    */
+   void appendMetaDataLocation(VirtualFile... locations);
+
+   /**
+    * Remove metadata file locations.
+    *
+    * @param locations the locations
+    */
+   void removeMetaDataLocation(VirtualFile... locations);
+
+   /**
     * Gets a file from this deployment
     * 
     * @param name the name to exactly match
@@ -133,6 +155,13 @@
    void appendClassPath(List<VirtualFile> files);
 
    /**
+    * Remove classpath files.
+    *
+    * @param files the files
+    */
+   void removeClassPath(VirtualFile... files);
+
+   /**
     * Get the top level deployment context
     * 
     * @return the top level deployment context

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSDeploymentUnit.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -30,6 +30,7 @@
  * VFSDeploymentUnit.
  * 
  * @author <a href="adrian at jboss.org">Adrian Brock</a>
+ * @author <a href="ales.justin at jboss.org">Ales Justin</a>
  * @version $Revision: 1.1 $
  */
 public interface VFSDeploymentUnit extends DeploymentUnit
@@ -55,6 +56,27 @@
    List<VirtualFile> getMetaDataFiles(String name, String suffix);
    
    /**
+    * Prepend metadata file locations.
+    *
+    * @param locations the locations
+    */
+   void prependMetaDataLocation(VirtualFile... locations);
+
+   /**
+    * Append metadata file locations.
+    *
+    * @param locations the locations
+    */
+   void appendMetaDataLocation(VirtualFile... locations);
+
+   /**
+    * Remove metadata file locations.
+    *
+    * @param locations the locations
+    */
+   void removeMetaDataLocation(VirtualFile... locations);
+
+   /**
     * Get a resource loader
     * 
     * @return the resource loader
@@ -87,7 +109,9 @@
     * Set the classpath
     * 
     * @param classPath the classpath
+    * @deprecated user view should not have setters
     */
+   @Deprecated
    void setClassPath(List<VirtualFile> classPath);
    
    /**
@@ -131,8 +155,15 @@
     * @param files a virtual file
     */
    void addClassPath(List<VirtualFile> files);
-   
+
    /**
+    * Remove classpath files.
+    *
+    * @param files the files
+    */
+   void removeClassPath(VirtualFile... files);
+
+   /**
     * Get the top leve deployment unit
     * 
     * @return the top level deployment unit

Modified: projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2009-01-27 13:38:45 UTC (rev 83487)
@@ -526,6 +526,8 @@
    protected void applyContextInfo(StructureContext context, ContextInfo result)
    {
       if (result != null && contextInfoOrder != null)
+      {
          result.setRelativeOrder(contextInfoOrder);
+      }
    }
 }

Modified: projects/jboss-deployers/branches/Branch_2_0/pom.xml
===================================================================
--- projects/jboss-deployers/branches/Branch_2_0/pom.xml	2009-01-27 13:22:19 UTC (rev 83486)
+++ projects/jboss-deployers/branches/Branch_2_0/pom.xml	2009-01-27 13:38:45 UTC (rev 83487)
@@ -21,17 +21,17 @@
   </scm>
 
   <properties>
+    <version.jboss.vfs>2.0.1.GA</version.jboss.vfs>
     <version.jboss.man>2.0.0.GA</version.jboss.man>
     <version.jboss.mdr>2.0.1.GA</version.jboss.mdr>
-    <version.jboss.microcontainer>2.0.2.GA</version.jboss.microcontainer>
-    <version.jboss.classloader>2.0.1.GA</version.jboss.classloader>
-    <version.jboss.classloading.spi>5.0.0.CR2</version.jboss.classloading.spi>
-    <version.jboss.common.core>2.2.9.GA</version.jboss.common.core>
+    <version.jboss.microcontainer>2.0.3.GA</version.jboss.microcontainer>
+    <version.jboss.classloader>2.0.2.GA</version.jboss.classloader>
+    <version.jboss.classloading.spi>5.0.3.GA</version.jboss.classloading.spi>
+    <version.jboss.common.core>2.2.10.GA</version.jboss.common.core>
     <version.jboss.logging.spi>2.0.5.GA</version.jboss.logging.spi>
     <version.jboss.logging.log4j>2.0.5.GA</version.jboss.logging.log4j>
     <version.jbossxb>2.0.0.GA</version.jbossxb>
     <version.jboss.aop>2.0.0.SP1</version.jboss.aop>
-    <version.jboss.vfs>2.0.0.GA</version.jboss.vfs>
     <version.org.jboss.test>1.1.1.GA</version.org.jboss.test>
     <version.junit>4.4</version.junit>
     <version.javassist>3.9.0.GA</version.javassist>




More information about the jboss-cvs-commits mailing list