[jboss-cvs] JBossAS SVN: r78268 - in projects/jboss-deployers/trunk: deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Sep 9 13:39:14 EDT 2008


Author: adrian at jboss.org
Date: 2008-09-09 13:39:14 -0400 (Tue, 09 Sep 2008)
New Revision: 78268

Modified:
   projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSStructuralDeployers.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:
[JBDEPLOY-70] - Remove deprecated/redundant code

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	2008-09-09 16:59:06 UTC (rev 78267)
+++ projects/jboss-deployers/trunk/deployers-vfs/src/main/java/org/jboss/deployers/vfs/plugins/structure/VFSStructuralDeployersImpl.java	2008-09-09 17:39:14 UTC (rev 78268)
@@ -135,38 +135,6 @@
       log.debug("Removed structure deployer " + deployer);
    }
    
-   @Deprecated // Remove this JBDEPLOY-66 
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData structureMetaData) throws DeploymentException
-   {
-      StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();
-      StructureContext context = new StructureContext(root, parent, file, structure, this, null);
-      boolean result = doDetermineStructure(context);
-      if (result)
-      {
-         String relativePath = AbstractStructureDeployer.getRelativePath(parent, file);
-         
-         // Something said it recognised it
-         ContextInfo recognised = structure.getContext("");
-         if (recognised == null)
-            throw new IllegalStateException("Something recognised the deployment, but there is no context? " + file);
-         
-         // Create the context in the parent structure
-         ContextInfo parentContext;
-         List<String> metaDataPath = recognised.getMetaDataPath();
-         if (metaDataPath == null || metaDataPath.isEmpty())
-            parentContext = StructureMetaDataFactory.createContextInfo(relativePath, recognised.getClassPath());
-         else
-            parentContext = StructureMetaDataFactory.createContextInfo(relativePath, metaDataPath, recognised.getClassPath());
-
-         // copy the modification type information
-         parentContext.setModificationType(recognised.getModificationType());
-         structureMetaData.addContext(parentContext);
-         MutableAttachments attachments = (MutableAttachments) parentContext.getPredeterminedManagedObjects();
-         attachments.addAttachment(StructureMetaData.class, structure);
-      }
-      return result;
-   }
-   
    public boolean determineStructure(VirtualFile file, StructureContext parentContext) throws DeploymentException
    {
       StructureMetaData structure = StructureMetaDataFactory.createStructureMetaData();

Modified: projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSStructuralDeployers.java
===================================================================
--- projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSStructuralDeployers.java	2008-09-09 16:59:06 UTC (rev 78267)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/VFSStructuralDeployers.java	2008-09-09 17:39:14 UTC (rev 78268)
@@ -21,7 +21,6 @@
  */
 package org.jboss.deployers.vfs.spi.structure;
 
-import org.jboss.deployers.spi.structure.StructureMetaData;
 import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.virtual.VirtualFile;
 
@@ -36,20 +35,7 @@
    /**
     * Determine the structure of a virtual file
     *
-    * @param root the root file
-    * @param parent the parent file
     * @param file the virtual file
-    * @param structureMetaData the structure metadata
-    * @return true when recognised, false otherwise
-    * @throws DeploymentException for any error
-    */
-   @Deprecated // Remove this JBDEPLOY-66
-   boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData structureMetaData) throws DeploymentException;
-
-   /**
-    * Determine the structure of a virtual file
-    *
-    * @param file the virtual file
     * @param parentContext the parent context
     * @return true when recognised, false otherwise
     * @throws DeploymentException for any error

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	2008-09-09 16:59:06 UTC (rev 78267)
+++ projects/jboss-deployers/trunk/deployers-vfs-spi/src/main/java/org/jboss/deployers/vfs/spi/structure/helpers/AbstractStructureDeployer.java	2008-09-09 17:39:14 UTC (rev 78268)
@@ -28,16 +28,15 @@
 import java.util.List;
 import java.util.Set;
 
-import org.jboss.deployers.spi.DeploymentException;
 import org.jboss.deployers.spi.annotations.AnnotationEnvironment;
 import org.jboss.deployers.spi.structure.ClassPathEntry;
 import org.jboss.deployers.spi.structure.ContextInfo;
 import org.jboss.deployers.spi.structure.StructureMetaData;
 import org.jboss.deployers.spi.structure.StructureMetaDataFactory;
+import org.jboss.deployers.vfs.spi.structure.CandidateAnnotationsCallback;
 import org.jboss.deployers.vfs.spi.structure.StructureContext;
 import org.jboss.deployers.vfs.spi.structure.StructureDeployer;
 import org.jboss.deployers.vfs.spi.structure.VFSStructuralDeployers;
-import org.jboss.deployers.vfs.spi.structure.CandidateAnnotationsCallback;
 import org.jboss.logging.Logger;
 import org.jboss.util.collection.CollectionsFactory;
 import org.jboss.virtual.VFSUtils;
@@ -172,18 +171,6 @@
       candidateAnnotations.add(annotationClass);
    }
 
-   // This should be an abstract method JBDEPLOY-66
-   public boolean determineStructure(StructureContext context) throws DeploymentException
-   {
-      return determineStructure(context.getRoot(), context.getParent(), context.getFile(), context.getMetaData(), context.getDeployers());
-   }
-
-   @Deprecated // Remove this JBDEPLOY-66
-   public boolean determineStructure(VirtualFile root, VirtualFile parent, VirtualFile file, StructureMetaData metaData, VFSStructuralDeployers deployers) throws DeploymentException
-   {
-      return false;
-   }
-
    public boolean isSupportsCandidateAnnotations()
    {
       return supportsCandidateAnnotations;
@@ -223,18 +210,6 @@
    }
 
    /**
-    * See if a file corresponds to a top-level deployment.
-    * 
-    * @param parent the parent file
-    * @return true when top level
-    */
-   @Deprecated // Remove JBDEPLOY-66 - use StructureContext.isTopLevel()
-   public boolean isTopLevel(VirtualFile parent)
-   {
-      return parent == null;
-   }
-
-   /**
     * Add an entry to the context classpath.
     * 
     * @param structureContext - the structure context
@@ -283,54 +258,6 @@
    }
 
    /**
-    * Add an entry to the context classpath.
-    * 
-    * @param root - the root file the classpath entry should be relative to
-    * @param entry - the candidate file to add as a classpath entry
-    * @param includeEntry - a flag indicating if the entry should be added to
-    *    the classpath
-    * @param includeRootManifestCP - a flag indicating if the entry metainf
-    *    manifest classpath should be included.
-    * @param context - the context to populate
-    * @throws IOException on any IO error
-    */
-   @Deprecated // Remove JBDEPLOY-66
-   protected void addClassPath(VirtualFile root, VirtualFile entry, boolean includeEntry, boolean includeRootManifestCP, ContextInfo context) throws IOException
-   {
-      boolean trace = log.isTraceEnabled();
-      
-      List<VirtualFile> paths = new ArrayList<VirtualFile>();
-
-      // The path we have been told to add
-      if (includeEntry)
-         paths.add(entry);
-
-      // Add the manifest locations
-      if (includeRootManifestCP && isLeaf(entry) == false)
-      {
-         try
-         {
-            VFSUtils.addManifestLocations(entry, paths);
-         }
-         catch(Exception e)
-         {
-            if (trace)
-               log.trace("Failed to add manifest locations", e);
-         }
-      }
-
-      // Translate from VirtualFile to relative paths
-      for (VirtualFile vf : paths)
-      {
-         String entryPath = getRelativePath(root, vf);
-         ClassPathEntry cpe = StructureMetaDataFactory.createClassPathEntry(entryPath);
-         context.addClassPathEntry(cpe);
-         if (trace)
-            log.trace("Added classpath entry " + entryPath + " for " + vf.getName() + " from " + root);
-      }
-   }
-
-   /**
     * Create annotation environment
     *
     * @param root the deployment root
@@ -478,39 +405,8 @@
       applyStructure(context, result);
       return result;
    }
-   
-   /**
-    * Create a context
-    * 
-    * @param root the root context
-    * @param structureMetaData the structure metadata
-    * @return the context info
-    * @throws IllegalArgumentException for a null root or structure metaData
-    */
-   @Deprecated // Remove JBDEPLOY-66
-   protected ContextInfo createContext(VirtualFile root, StructureMetaData structureMetaData)
-   {
-      return createContext(root, (String)null, structureMetaData);
-   }
 
    /**
-    * Create a context
-    *
-    * @param root the root context
-    * @param metaDataPath the metadata path
-    * @param structureMetaData the structure metadata
-    * @return the context info
-    * @throws IllegalArgumentException for a null root or structure metaData
-    */
-   @Deprecated // Remove JBDEPLOY-66
-   protected ContextInfo createContext(VirtualFile root, String metaDataPath, StructureMetaData structureMetaData)
-   {
-      ContextInfo result = applyMetadataPath(root, metaDataPath);
-      applyStructure(root, structureMetaData, result);
-      return result;
-   }
-
-   /**
     * Apply metadata on root to create context.
     *
     * @param context the context
@@ -547,42 +443,6 @@
    }
 
    /**
-    * Apply metadata on root to create context.
-    *
-    * @param root the root context
-    * @param metaDataPath the metadata path
-    * @return the context info
-    */
-   @Deprecated // Remove JBDEPLOY-66
-   protected ContextInfo applyMetadataPath(VirtualFile root, String metaDataPath)
-   {
-      if (root == null)
-         throw new IllegalArgumentException("Null root");
-
-      // Determine whether the metadata path exists
-      if (metaDataPath != null)
-      {
-         try
-         {
-            VirtualFile child = root.getChild(metaDataPath);
-            if (child == null)
-               metaDataPath = null;
-         }
-         catch (IOException e)
-         {
-            log.warn("Not using metadata path " + metaDataPath + " for " + root.getName() + " reason: " + e.getMessage());
-            metaDataPath = null;
-         }
-      }
-
-      // Create and link the context
-      if (metaDataPath != null)
-         return StructureMetaDataFactory.createContextInfo("", metaDataPath, null);
-      else
-         return StructureMetaDataFactory.createContextInfo("", null);
-   }
-
-   /**
     * Create a context
     *
     * @param context the structure context
@@ -637,62 +497,6 @@
    }
 
    /**
-    * Create a context
-    *
-    * @param root the root context
-    * @param metaDataPaths the metadata paths
-    * @param structureMetaData the structure metadata
-    * @return the context info
-    * @throws IllegalArgumentException for a null root or structure metaData
-    */
-   @Deprecated // Remove JBDEPLOY-66
-   protected ContextInfo createContext(VirtualFile root, String[] metaDataPaths, StructureMetaData structureMetaData)
-   {
-      ContextInfo result = applyMetadataPaths(root, metaDataPaths);
-      applyStructure(root, structureMetaData, result);
-      return result;
-   }
-
-   /**
-    * Apply metadata on root to create context.
-    *
-    * @param root the root context
-    * @param metaDataPaths the metadata paths
-    * @return the context info
-    */
-   @Deprecated // Remove JBDEPLOY-66
-   protected ContextInfo applyMetadataPaths(VirtualFile root, String[] metaDataPaths)
-   {
-      if (root == null)
-         throw new IllegalArgumentException("Null root");
-
-      List<String> metaDataPath = CollectionsFactory.createLazyList();
-      // Determine whether the metadata paths exists
-      if (metaDataPaths != null && metaDataPaths.length > 0)
-      {
-         for(String path : metaDataPaths)
-         {
-            try
-            {
-               VirtualFile child = root.getChild(path);
-               if (child != null)
-                  metaDataPath.add(path);
-            }
-            catch (IOException e)
-            {
-               log.warn("Not using metadata path " + path + " for " + root.getName() + " reason: " + e.getMessage());
-            }
-         }
-      }
-
-      // Create and link the context
-      if (metaDataPath.isEmpty())
-         return StructureMetaDataFactory.createContextInfo("", null);
-      else
-         return StructureMetaDataFactory.createContextInfo("", metaDataPath, null);
-   }
-
-   /**
     * Apply structure metadata on context.
     *
     * @param context the structure context
@@ -724,42 +528,4 @@
       if (result != null && contextInfoOrder != null)
          result.setRelativeOrder(contextInfoOrder);
    }
-
-   /**
-    * Apply structure metadata on context.
-    *
-    * @param root the root context
-    * @param structureMetaData the structure metadata
-    * @param context the new created context
-    */
-   @Deprecated // remove JBDEPLOY-66
-   protected void applyStructure(VirtualFile root, StructureMetaData structureMetaData, ContextInfo context)
-   {
-      boolean trace = log.isTraceEnabled();
-
-      if (root == null)
-         throw new IllegalArgumentException("Null root");
-      if (structureMetaData == null)
-         throw new IllegalArgumentException("Null structure metadata");
-
-      applyContextInfo(root, context);
-
-      structureMetaData.addContext(context);
-      if (trace)
-         log.trace("Added context " + context + " from " + root.getName());
-   }
-
-   /**
-    * Apply context info.
-    * Can be overridden for specific root.
-    *
-    * @param root the root file
-    * @param result the new context info
-    */
-   @Deprecated // remove JBDEPLOY-66
-   protected void applyContextInfo(VirtualFile root, ContextInfo result)
-   {
-      if (result != null && contextInfoOrder != null)
-         result.setRelativeOrder(contextInfoOrder);
-   }
 }




More information about the jboss-cvs-commits mailing list