[jboss-cvs] JBossAS SVN: r99062 - in projects/jboss-deployers/trunk: deployers-core/src/main/java/org/jboss/deployers/plugins/structure and 4 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jan 6 06:13:11 EST 2010


Author: alesj
Date: 2010-01-06 06:13:10 -0500 (Wed, 06 Jan 2010)
New Revision: 99062

Modified:
   projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/DeploymentFactory.java
   projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/StructureMetaDataFactory.java
   projects/jboss-deployers/trunk/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/DefaultStructureMetaDataFactory.java
   projects/jboss-deployers/trunk/deployers-core/src/test/java/org/jboss/test/deployers/structure/test/StructureMetaDataFactoryContextInfoUnitTestCase.java
   projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
   projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java
Log:
Bring back old method signatures, modify the new ones a bit.


Modified: projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/DeploymentFactory.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/DeploymentFactory.java	2010-01-06 10:44:08 UTC (rev 99061)
+++ projects/jboss-deployers/trunk/deployers-client-spi/src/main/java/org/jboss/deployers/client/spi/DeploymentFactory.java	2010-01-06 11:13:10 UTC (rev 99062)
@@ -21,7 +21,6 @@
  */
 package org.jboss.deployers.client.spi;
 
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Map;
@@ -110,7 +109,7 @@
    public ContextInfo addContext(PredeterminedManagedObjectAttachments context, String path, List<String> metaDataPath, List<ClassPathEntry> classPath)
    {
       StructureMetaData structure = assureStructure(context);
-      ContextInfo result = StructureMetaDataFactory.createContextInfo(path, createMetaDataEntries(metaDataPath), classPath);
+      ContextInfo result = StructureMetaDataFactory.createContextInfo(path, metaDataPath, classPath);
       structure.addContext(result);
       return result;
    }
@@ -141,23 +140,6 @@
    }
 
    /**
-    * Create metadata path entries.
-    *
-    * @param metaDataPath the metadata path entries
-    * @return the entries
-    */
-   public static List<MetaDataEntry> createMetaDataEntries(List<String> metaDataPath)
-   {
-      if (metaDataPath == null)
-         throw new IllegalArgumentException("Null metadata path");
-
-      List<MetaDataEntry> entries = new ArrayList<MetaDataEntry>(metaDataPath.size());
-      for (String path : metaDataPath)
-         entries.add(createMetaDataPathEntry(path));
-      return entries;
-   }
-
-   /**
     * Create a new classpath entry
     * 
     * @param path the path

Modified: projects/jboss-deployers/trunk/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/DefaultStructureMetaDataFactory.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/DefaultStructureMetaDataFactory.java	2010-01-06 10:44:08 UTC (rev 99061)
+++ projects/jboss-deployers/trunk/deployers-core/src/main/java/org/jboss/deployers/plugins/structure/DefaultStructureMetaDataFactory.java	2010-01-06 11:13:10 UTC (rev 99062)
@@ -21,6 +21,7 @@
  */
 package org.jboss.deployers.plugins.structure;
 
+import java.util.Arrays;
 import java.util.List;
 
 import org.jboss.deployers.spi.structure.ClassPathEntry;
@@ -54,16 +55,31 @@
       return new ContextInfoImpl(path, classPath);
    }
 
+   protected ContextInfo newContextInfo(String path, String metaDataPath, List<ClassPathEntry> classPath)
+   {
+      return new ContextInfoImpl(path, newMetaDataPathEntry(metaDataPath), classPath);
+   }
+
    protected ContextInfo newContextInfo(String path, MetaDataEntry metaDataPath, List<ClassPathEntry> classPath)
    {
       return new ContextInfoImpl(path, metaDataPath, classPath);
    }
-   
-   protected ContextInfo newContextInfo(String path, List<MetaDataEntry> metaDataPath, List<ClassPathEntry> classPath)
+
+   protected ContextInfo newContextInfo(String path, List<String> metaDataPaths, List<ClassPathEntry> classPath)
    {
-      return new ContextInfoImpl(path, metaDataPath, classPath);
+      return new ContextInfoImpl(path, createMetaDataEntries(metaDataPaths), classPath);
    }
 
+   protected ContextInfo newContextInfo(String path, MetaDataEntry[] metaDataPaths, List<ClassPathEntry> classPath)
+   {
+      return new ContextInfoImpl(path, Arrays.asList(metaDataPaths), classPath);
+   }
+
+   protected ContextInfo newContextInfo(List<ClassPathEntry> classPath, List<MetaDataEntry> metaDataPaths, String path)
+   {
+      return new ContextInfoImpl(path, metaDataPaths, classPath);
+   }
+
    protected MetaDataEntry newMetaDataPathEntry(String metaDataPath)
    {
       return newMetaDataPathEntry(metaDataPath, MetaDataType.DEFAULT);

Modified: projects/jboss-deployers/trunk/deployers-core/src/test/java/org/jboss/test/deployers/structure/test/StructureMetaDataFactoryContextInfoUnitTestCase.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-core/src/test/java/org/jboss/test/deployers/structure/test/StructureMetaDataFactoryContextInfoUnitTestCase.java	2010-01-06 10:44:08 UTC (rev 99061)
+++ projects/jboss-deployers/trunk/deployers-core/src/test/java/org/jboss/test/deployers/structure/test/StructureMetaDataFactoryContextInfoUnitTestCase.java	2010-01-06 11:13:10 UTC (rev 99062)
@@ -21,7 +21,6 @@
 */
 package org.jboss.test.deployers.structure.test;
 
-import java.util.ArrayList;
 import java.util.List;
 
 import junit.framework.Test;
@@ -29,7 +28,6 @@
 
 import org.jboss.deployers.spi.structure.ClassPathEntry;
 import org.jboss.deployers.spi.structure.ContextInfo;
-import org.jboss.deployers.spi.structure.MetaDataEntry;
 import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
 import org.jboss.test.deployers.structure.AbstractContextInfoTest;
 
@@ -78,10 +76,7 @@
    @Override
    protected ContextInfo createPathAndMetaDataAndClassPath(String path, List<String> metaDataPath, List<ClassPathEntry> classPath)
    {
-      List<MetaDataEntry> entries = new ArrayList<MetaDataEntry>();
-      for (String mdp : metaDataPath)
-         entries.add(StructureMetaDataFactory.createMetaDataEntry(mdp));
-      return StructureMetaDataFactory.createContextInfo(path, entries, classPath);
+      return StructureMetaDataFactory.createContextInfo(path, metaDataPath, classPath);
    }
 
    @Override

Modified: projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/StructureMetaDataFactory.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/StructureMetaDataFactory.java	2010-01-06 10:44:08 UTC (rev 99061)
+++ projects/jboss-deployers/trunk/deployers-core-spi/src/main/java/org/jboss/deployers/spi/structure/StructureMetaDataFactory.java	2010-01-06 11:13:10 UTC (rev 99062)
@@ -21,12 +21,14 @@
  */
 package org.jboss.deployers.spi.structure;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
  * StructureFactory.
  * 
  * @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 abstract class StructureMetaDataFactory
@@ -86,7 +88,7 @@
     * @return the context info
     * @throws IllegalArgumentException for a null path or metadata path
     */
-   public static ContextInfo createContextInfo(String path, MetaDataEntry metaDataPath, List<ClassPathEntry> classPath)
+   public static ContextInfo createContextInfo(String path, String metaDataPath, List<ClassPathEntry> classPath)
    {
       return StructureMetaDataBuilder.getInstance().newContextInfo(path, metaDataPath, classPath);
    }
@@ -100,12 +102,55 @@
     * @return the context info
     * @throws IllegalArgumentException for a null path or metadata path
     */
-   public static ContextInfo createContextInfo(String path, List<MetaDataEntry> metaDataPath, List<ClassPathEntry> classPath)
+   public static ContextInfo createContextInfo(String path, MetaDataEntry metaDataPath, List<ClassPathEntry> classPath)
    {
       return StructureMetaDataBuilder.getInstance().newContextInfo(path, metaDataPath, classPath);
    }
 
    /**
+    * Create a new ContextInfo.
+    *
+    * @param path the path
+    * @param metaDataPaths the metadata paths
+    * @param classPath the class path
+    * @return the context info
+    * @throws IllegalArgumentException for a null path or metadata path
+    */
+   public static ContextInfo createContextInfo(String path, List<String> metaDataPaths, List<ClassPathEntry> classPath)
+   {
+      return StructureMetaDataBuilder.getInstance().newContextInfo(path, metaDataPaths, classPath);
+   }
+
+   /**
+    * Create a new ContextInfo.
+    *
+    * @param path the path
+    * @param metaDataPaths the metadata path
+    * @param classPath the class path
+    * @return the context info
+    * @throws IllegalArgumentException for a null path or metadata path
+    */
+   public static ContextInfo createContextInfo(String path, MetaDataEntry[] metaDataPaths, List<ClassPathEntry> classPath)
+   {
+      return StructureMetaDataBuilder.getInstance().newContextInfo(path, metaDataPaths, classPath);
+   }
+
+   /**
+    * Create a new ContextInfo.
+    * Switch parameter order to allow for method override.
+    *
+    * @param classPath the class path
+    * @param metaDataPaths the metadata path
+    * @param path the path
+    * @return the context info
+    * @throws IllegalArgumentException for a null path or metadata path
+    */
+   public static ContextInfo createContextInfo(List<ClassPathEntry> classPath, List<MetaDataEntry> metaDataPaths, String path)
+   {
+      return StructureMetaDataBuilder.getInstance().newContextInfo(classPath, metaDataPaths, path);
+   }
+
+   /**
     * Create a new MetaData entry.
     *
     * @param metaDataPath the metadata path
@@ -129,6 +174,23 @@
    }
 
    /**
+    * Create metadata path entries.
+    *
+    * @param metaDataPath the metadata path entries
+    * @return the entries
+    */
+   protected static List<MetaDataEntry> createMetaDataEntries(List<String> metaDataPath)
+   {
+      if (metaDataPath == null)
+         throw new IllegalArgumentException("Null metadata path");
+
+      List<MetaDataEntry> entries = new ArrayList<MetaDataEntry>(metaDataPath.size());
+      for (String path : metaDataPath)
+         entries.add(createMetaDataEntry(path));
+      return entries;
+   }
+
+   /**
     * Create a new classpath entry
     * 
     * @return the classpath entry
@@ -198,7 +260,7 @@
     * @return the context info
     * @throws IllegalArgumentException for a null path or metadata path
     */
-   protected abstract ContextInfo newContextInfo(String path, MetaDataEntry metaDataPath, List<ClassPathEntry> classPath);
+   protected abstract ContextInfo newContextInfo(String path, String metaDataPath, List<ClassPathEntry> classPath);
    
    /**
     * Create a new ContextInfo.
@@ -209,9 +271,42 @@
     * @return the context info
     * @throws IllegalArgumentException for a null path or metadata path
     */
-   protected abstract ContextInfo newContextInfo(String path, List<MetaDataEntry> metaDataPath, List<ClassPathEntry> classPath);
+   protected abstract ContextInfo newContextInfo(String path, MetaDataEntry metaDataPath, List<ClassPathEntry> classPath);
 
    /**
+    * Create a new ContextInfo.
+    *
+    * @param path the path
+    * @param metaDataPaths the metadata paths
+    * @param classPath the class path
+    * @return the context info
+    * @throws IllegalArgumentException for a null path or metadata path
+    */
+   protected abstract ContextInfo newContextInfo(String path, List<String> metaDataPaths, List<ClassPathEntry> classPath);
+
+   /**
+    * Create a new ContextInfo.
+    *
+    * @param classPath the class path
+    * @param metaDataPaths the metadata paths
+    * @param path the path
+    * @return the context info
+    * @throws IllegalArgumentException for a null path or metadata path
+    */
+   protected abstract ContextInfo newContextInfo(List<ClassPathEntry> classPath, List<MetaDataEntry> metaDataPaths, String path);
+
+   /**
+    * Create a new ContextInfo.
+    *
+    * @param path the path
+    * @param metaDataPaths the metadata paths
+    * @param classPath the class path
+    * @return the context info
+    * @throws IllegalArgumentException for a null path or metadata path
+    */
+   protected abstract ContextInfo newContextInfo(String path, MetaDataEntry[] metaDataPaths, List<ClassPathEntry> classPath);
+
+   /**
     * Create new metadata path entry.
     *
     * @param metaDataPath the metadata path

Modified: projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java	2010-01-06 10:44:08 UTC (rev 99061)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java	2010-01-06 11:13:10 UTC (rev 99062)
@@ -156,7 +156,7 @@
          if (metaDataPath == null || metaDataPath.isEmpty())
             parentContextInfo = StructureMetaDataFactory.createContextInfo(relativePath, recognised.getClassPath());
          else
-            parentContextInfo = StructureMetaDataFactory.createContextInfo(relativePath, metaDataPath, recognised.getClassPath());
+            parentContextInfo = StructureMetaDataFactory.createContextInfo(recognised.getClassPath(), metaDataPath, relativePath);
 
          // copy the modification type information
          parentContextInfo.setModificationType(recognised.getModificationType());

Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2010-01-06 10:44:08 UTC (rev 99061)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2010-01-06 11:13:10 UTC (rev 99062)
@@ -439,7 +439,7 @@
 
       // Create and link the context
       if (metaDataPath != null)
-         return StructureMetaDataFactory.createContextInfo("", createMetaDataEntry(metaDataPath), null);
+         return StructureMetaDataFactory.createContextInfo("", metaDataPath, null);
       else
          return StructureMetaDataFactory.createContextInfo("", null);
    }
@@ -463,17 +463,6 @@
     * Create metadata entry.
     *
     * @param path the path
-    * @return the metadata entry
-    */
-   private MetaDataEntry createMetaDataEntry(String path)
-   {
-      return StructureMetaDataFactory.createMetaDataEntry(path);
-   }
-
-   /**
-    * Create metadata entry.
-    *
-    * @param path the path
     * @param type the type
     * @return the metadata entry
     */
@@ -517,7 +506,7 @@
          throw new IllegalArgumentException("Null context");
 
       VirtualFile root = context.getFile();
-      List<MetaDataEntry> metaDataPath = CollectionsFactory.createLazyList();
+      List<String> metaDataPath = CollectionsFactory.createLazyList();
       // Determine whether the metadata paths exists
       if (metaDataPaths != null && metaDataPaths.length > 0)
       {
@@ -527,7 +516,7 @@
             {
                VirtualFile child = root.getChild(path);
                if (child != null)
-                  metaDataPath.add(createMetaDataEntry(path));
+                  metaDataPath.add(path);
             }
             catch (IOException e)
             {




More information about the jboss-cvs-commits mailing list