[jboss-cvs] JBossAS SVN: r76665 - in projects/jboss-deployers/trunk: deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file and 8 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 5 09:59:36 EDT 2008


Author: adrian at jboss.org
Date: 2008-08-05 09:59:36 -0400 (Tue, 05 Aug 2008)
New Revision: 76665

Modified:
   projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/StructureContext.java
   projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java
   projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/matchers/support/ExposedJARStructure.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/WrapperMockEarStructureDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/TestDummyClassLoaderStructureDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/WarUnpackStructure.java
   projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/test/TerminateStructureTestCase.java
Log:
[JBDEPLOY-66] - Cutover our structure deployers to the new StructureContext

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/explicit/DeclaredStructure.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -25,8 +25,7 @@
 import java.net.URL;
 
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
 import org.jboss.virtual.VirtualFile;
 import org.jboss.xb.binding.Unmarshaller;
@@ -49,8 +48,9 @@
       setRelativeOrder(0);
    }
 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
+      VirtualFile file = structureContext.getFile();
       try
       {
          boolean trace = log.isTraceEnabled();
@@ -69,7 +69,7 @@
                   UnmarshallerFactory factory = UnmarshallerFactory.newInstance();
                   Unmarshaller unmarshaller = factory.newUnmarshaller();
                   StructureMetaDataObjectFactory ofactory = new StructureMetaDataObjectFactory();
-                  unmarshaller.unmarshal(url.toString(), ofactory, metaData);
+                  unmarshaller.unmarshal(url.toString(), ofactory, structureContext.getMetaData());
                   isJBossStructure = true;
                }
             }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/file/FileStructure.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -24,15 +24,14 @@
 import java.util.Set;
 import java.util.concurrent.CopyOnWriteArraySet;
 
+import org.jboss.beans.metadata.api.annotations.Install;
+import org.jboss.beans.metadata.api.annotations.Uninstall;
+import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.deployer.FileMatcher;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
-import org.jboss.deployers.vfs.spi.deployer.FileMatcher;
 import org.jboss.virtual.VirtualFile;
-import org.jboss.beans.metadata.api.annotations.Install;
-import org.jboss.beans.metadata.api.annotations.Uninstall;
 
 /**
  * FileStructure is a simple suffix recognition structure deployer.
@@ -165,9 +164,10 @@
       return false;
    }
 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
       ContextInfo context = null;
+      VirtualFile file = structureContext.getFile();
       try
       {
          boolean trace = log.isTraceEnabled();
@@ -177,7 +177,7 @@
             if( trace )
                log.trace(file + " is a leaf");
             // See if this is a top-level by checking the parent
-            if (isTopLevel(parent) == false)
+            if (structureContext.isTopLevel() == false)
             {
                if (isKnownFile(file.getName()) == false && checkFileMatchers(file) == false)
                {
@@ -199,7 +199,8 @@
             }
 
             // Create a context info for this file
-            context = createContext(file, metaData);
+            if (isFile)
+               context = createContext(structureContext);
             // There are no subdeployments for files
             if (trace)
                log.trace(file + " isFile: " + isFile);
@@ -215,7 +216,7 @@
       catch (Exception e)
       {
          if (context != null)
-            metaData.removeContext(context);
+            structureContext.removeChild(context);
 
          throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
       }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/jar/JARStructure.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -24,16 +24,15 @@
 import java.io.IOException;
 import java.util.Set;
 
+import org.jboss.beans.metadata.api.annotations.Install;
+import org.jboss.beans.metadata.api.annotations.Uninstall;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.deployer.matchers.JarExtensionProvider;
 import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
 import org.jboss.virtual.VirtualFile;
 import org.jboss.virtual.plugins.context.jar.JarUtils;
-import org.jboss.beans.metadata.api.annotations.Install;
-import org.jboss.beans.metadata.api.annotations.Uninstall;
 
 /**
  * JARStructure.
@@ -98,9 +97,10 @@
          JarUtils.removeJarSuffix(extension);
    }
 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
       ContextInfo context = null;
+      VirtualFile file = structureContext.getFile();
       try
       {
          boolean trace = log.isTraceEnabled();
@@ -111,7 +111,7 @@
             // we require a META-INF otherwise each subdirectory would be a subdeployment
             if (JarUtils.isArchive(file.getName()) == false)
             {
-               if (isTopLevel(parent) == false)
+               if (structureContext.isTopLevel() == false)
                {
                   try
                   {
@@ -153,20 +153,20 @@
          }
 
          // Create a context for this jar file with META-INF as the location for metadata  
-         context = createContext(file, "META-INF", metaData);
+         context = createContext(structureContext, "META-INF");
 
          // The classpath is the root
-         super.addClassPath(root, file, true, true, context);
+         super.addClassPath(structureContext, file, true, true, context);
 
          // We try all the children as potential subdeployments
-         addAllChildren(root, file, metaData, deployers);
+         addAllChildren(structureContext);
          return true;
       }
       catch (Exception e)
       {
          // Remove the invalid context
          if(context != null)
-            metaData.removeContext(context);
+            structureContext.removeChild(context);
 
          throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
       }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/org/jboss/deployers/vfs/plugins/structure/war/WARStructure.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -26,8 +26,7 @@
 
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
 import org.jboss.virtual.VirtualFile;
 import org.jboss.virtual.VirtualFileFilter;
@@ -80,9 +79,10 @@
       this.webInfLibFilter = webInfLibFilter;
    }
 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
       ContextInfo context = null;
+      VirtualFile file = structureContext.getFile();
       try
       {
          boolean trace = log.isTraceEnabled();
@@ -120,17 +120,17 @@
 
             // Create a context for this war file with WEB-INF as the location for metadata
             // Some wars also might have metadata in WEB-INF/classes/META-INF, e.g. persistence.xml
-            context = createContext(file, new String[]{"WEB-INF", "WEB-INF/classes/META-INF"}, metaData);
+            context = createContext(structureContext, new String[]{"WEB-INF", "WEB-INF/classes/META-INF"});
 
             // Add the war manifest classpath entries
-            addClassPath(root, file, false, true, context);
+            addClassPath(structureContext, file, false, true, context);
             try
             {
                // The classpath is WEB-INF/classes
                VirtualFile classes = file.getChild("WEB-INF/classes");
                // Add the war manifest classpath entries
                if (classes != null)
-                  addClassPath(root, classes, true, false, context);
+                  addClassPath(structureContext, classes, true, false, context);
                else if (trace)
                   log.trace("No WEB-INF/classes for: " + file.getPathName());
             }
@@ -146,7 +146,7 @@
                {
                   List<VirtualFile> archives = webinfLib.getChildren(webInfLibFilter);
                   for (VirtualFile jar : archives)
-                     addClassPath(root, jar, true, true, context);
+                     addClassPath(structureContext, jar, true, true, context);
                }
                else if (trace)
                   log.trace("No WEB-INF/lib for: " + file.getPathName());
@@ -170,7 +170,7 @@
       {
          // Remove the invalid context
          if (context != null)
-            metaData.removeContext(context);
+            structureContext.removeChild(context);
 
          throw DeploymentException.rethrowAsDeploymentException("Error determining structure: " + file.getName(), e);
       }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/matchers/support/ExposedJARStructure.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/matchers/support/ExposedJARStructure.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/matchers/support/ExposedJARStructure.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -25,10 +25,8 @@
 import java.util.Set;
 
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.structure.StructureMetaData;
 import org.jboss.deployers.vfs.plugins.structure.jar.JARStructure;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 
 /**
  * Exposes recognized files.
@@ -44,11 +42,11 @@
       return recognized;
    }
 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
-      boolean determined = super.determineStructure(root, parent, file, metaData, deployers);
+      boolean determined = super.determineStructure(structureContext);
       if (determined)
-         recognized.add(file.getName());
+         recognized.add(structureContext.getName());
       return determined;
    }
 }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/MockEarStructureDeployer.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -37,8 +37,7 @@
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
 import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
 import org.jboss.virtual.VFSUtils;
 import org.jboss.virtual.VirtualFile;
@@ -94,16 +93,17 @@
       this.earLibFilter = earLibFilter;
    }
 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
       ContextInfo context;
       boolean valid;
+      VirtualFile file = structureContext.getFile();
       try
       {
          if (file.isLeaf() == true || file.getName().endsWith(".ear") == false)
             return false;
 
-         context = createContext(file, "META-INF", metaData);
+         context = createContext(structureContext, "META-INF");
 
          VirtualFile applicationProps = getMetaDataFile(file, "META-INF/application.properties");
          VirtualFile jbossProps = getMetaDataFile(file, "META-INF/jboss-application.properties");
@@ -126,7 +126,7 @@
             {
                List<VirtualFile> archives = lib.getChildren(earLibFilter);
                for (VirtualFile archive : archives)
-                  super.addClassPath(root, archive, true, true, context);
+                  super.addClassPath(structureContext, archive, true, true, context);
             }
          }
          catch (IOException ignored)
@@ -135,7 +135,7 @@
          }
 
          // Add the ear manifest locations?
-         super.addClassPath(root, file, false, true, context);
+         super.addClassPath(structureContext, file, false, true, context);
 
          if (scan)
             scanEar(file, modules);
@@ -156,7 +156,7 @@
                            + file.getName());
                   }
                   // Ask the deployers to analyze this
-                  if (deployers.determineStructure(root, file, module, metaData) == false)
+                  if (structureContext.determineChildStructure(module) == false)
                   {
                      throw new RuntimeException(fileName
                            + " module listed in application.xml is not a recognized deployment, .ear: "

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/WrapperMockEarStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/WrapperMockEarStructureDeployer.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/ear/support/WrapperMockEarStructureDeployer.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -21,10 +21,8 @@
 */
 package org.jboss.test.deployers.vfs.structure.ear.support;
 
-import org.jboss.virtual.VirtualFile;
-import org.jboss.deployers.spi.structure.StructureMetaData;
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 
 /**
  * @author ales.justin at jboss.org
@@ -34,10 +32,10 @@
    private boolean touched;
    private boolean valid;
 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
       touched = true;
-      valid = super.determineStructure(root, parent, file, metaData, deployers);
+      valid = super.determineStructure(structureContext);
       return valid;
    }
 

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/TestDummyClassLoaderStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/TestDummyClassLoaderStructureDeployer.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/TestDummyClassLoaderStructureDeployer.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -22,10 +22,8 @@
 package org.jboss.test.deployers.vfs.structure.support;
 
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.structure.StructureMetaData;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
-import org.jboss.virtual.VirtualFile;
 
 /**
  * TestDummyClassLoaderStructureDeployer.
@@ -54,8 +52,7 @@
       setRelativeOrder(-1);
    }
    
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file,
-         StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+   public boolean determineStructure(StructureContext structureContext) throws DeploymentException
    {
       checkClassLoader();
       return false;

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/WarUnpackStructure.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/WarUnpackStructure.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/support/WarUnpackStructure.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -21,19 +21,19 @@
 */
 package org.jboss.test.deployers.vfs.structure.support;
 
-import org.jboss.deployers.vfs.plugins.structure.war.WARStructure;
 import org.jboss.deployers.spi.structure.ContextInfo;
 import org.jboss.deployers.spi.structure.ModificationType;
-import org.jboss.virtual.VirtualFile;
+import org.jboss.deployers.vfs.plugins.structure.war.WARStructure;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 
 /**
  * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
  */
 public class WarUnpackStructure extends WARStructure
 {
-   protected void applyContextInfo(VirtualFile root, ContextInfo result)
+   protected void applyContextInfo(StructureContext context, ContextInfo result)
    {
-      super.applyContextInfo(root, result);
+      super.applyContextInfo(context, result);
       result.setModificationType(ModificationType.UNPACK);
    }
 }

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/test/TerminateStructureTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/test/TerminateStructureTestCase.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/tests/org/jboss/test/deployers/vfs/structure/test/TerminateStructureTestCase.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -22,15 +22,14 @@
 package org.jboss.test.deployers.vfs.structure.test;
 
 import junit.framework.Test;
+
 import org.jboss.deployers.spi.DeploymentException;
-import org.jboss.deployers.spi.structure.StructureMetaData;
 import org.jboss.deployers.vfs.spi.client.VFSDeployment;
+import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
 import org.jboss.deployers.vfs.spi.structure.VFSDeploymentContext;
-import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
 import org.jboss.deployers.vfs.spi.structure.helpers.AbstractStructureDeployer;
 import org.jboss.test.deployers.vfs.structure.AbstractStructureTest;
-import org.jboss.virtual.VirtualFile;
 
 /**
  * Terminate test case.
@@ -115,7 +114,7 @@
          setRelativeOrder(order);
       }
 
-      public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+      public boolean determineStructure(StructureContext structureContext) throws DeploymentException
       {
          return false;
       }
@@ -128,7 +127,7 @@
          setRelativeOrder(order);
       }
 
-      public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+      public boolean determineStructure(StructureContext structureContext) throws DeploymentException
       {
          throw new DeploymentException(String.valueOf(getRelativeOrder()));
       }
@@ -141,7 +140,7 @@
          setRelativeOrder(order);
       }
 
-      public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
+      public boolean determineStructure(StructureContext structureContext) throws DeploymentException
       {
          throw new RuntimeException(String.valueOf(getRelativeOrder()));
       }

Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/StructureContext.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/StructureContext.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/StructureContext.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -161,7 +161,7 @@
    {
       return parent == null;
    }
-
+   
    /**
     * Get the file.
     * 
@@ -206,18 +206,19 @@
     * Determine the child structure
     * 
     * @param child the child
+    * @return true when recognised
     * @throws DeploymentException for any error
     */
-   public void determineChildStructure(VirtualFile child) throws DeploymentException
+   public boolean determineChildStructure(VirtualFile child) throws DeploymentException
    {
       if (child == null)
          throw new IllegalArgumentException("Null child");
       
-      getDeployers().determineStructure(child, this);
+      return getDeployers().determineStructure(child, this);
    }
    
    /**
-    * Add a context
+    * Add a child context
     * 
     * @param child the child
     */
@@ -228,4 +229,17 @@
       
       getMetaData().addContext(child);
    }
+   
+   /**
+    * Remove a child context
+    * 
+    * @param child the child
+    */
+   public void removeChild(ContextInfo child)
+   {
+      if (child == null)
+         throw new IllegalArgumentException("Null child");
+      
+      getMetaData().removeContext(child);
+   }
 }
\ No newline at end of file

Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2008-08-05 13:08:17 UTC (rev 76664)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2008-08-05 13:59:36 UTC (rev 76665)
@@ -419,7 +419,7 @@
       // Determine whether the metadata path exists
       if (metaDataPath != null)
       {
-         VirtualFile root = context.getRoot();
+         VirtualFile root = context.getFile();
          try
          {
             VirtualFile child = root.getChild(metaDataPath);
@@ -503,7 +503,7 @@
       if (context == null)
          throw new IllegalArgumentException("Null context");
 
-      VirtualFile root = context.getRoot();
+      VirtualFile root = context.getFile();
       List<String> metaDataPath = CollectionsFactory.createLazyList();
       // Determine whether the metadata paths exists
       if (metaDataPaths != null && metaDataPaths.length > 0)




More information about the jboss-cvs-commits mailing list