User: user57  
  Date: 02/03/16 00:40:44

  Modified:    src/main/org/jboss/deployment/scanner
                        URLDeploymentScanner.java
  Log:
   o Directory listings are now sorted as a shorterm fix for some deployment
     dependency issues.
  
  Revision  Changes    Path
  1.5       +26 -5     
jboss-system/src/main/org/jboss/deployment/scanner/URLDeploymentScanner.java
  
  Index: URLDeploymentScanner.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss-system/src/main/org/jboss/deployment/scanner/URLDeploymentScanner.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- URLDeploymentScanner.java 2 Mar 2002 09:59:12 -0000       1.4
  +++ URLDeploymentScanner.java 16 Mar 2002 08:40:44 -0000      1.5
  @@ -32,11 +32,13 @@
   
   import org.jboss.util.NullArgumentException;
   
  +import org.jboss.deployment.DeploymentSorter;
  +
   /**
    * A URL-based deployment scanner.  Supports local directory 
    * scanning for file-based urls.
    *
  - * @version <tt>$Revision: 1.4 $</tt>
  + * @version <tt>$Revision: 1.5 $</tt>
    * @author  <a href="mailto:[EMAIL PROTECTED]";>Jason Dillon</a>
    */
   public class URLDeploymentScanner
  @@ -52,6 +54,9 @@
      /** The server's home directory, for relative paths. */
      protected File serverHome;
   
  +   /** HACK to sort urls from a scaned directory. */
  +   protected DeploymentSorter sorter = new DeploymentSorter();
  +
      public void setURLList(final List list)
      {
         if (list == null)
  @@ -332,7 +337,7 @@
         return deployedSet.contains(du);
      }
   
  -   public void scan() throws Exception
  +   public synchronized void scan() throws Exception
      {
         if (urlList == null)
            throw new IllegalStateException("not initialized");
  @@ -433,7 +438,7 @@
            }
            return;
         }
  -         
  +
         // if it is not a directory, and it is not deployed then add it
         if (!file.isDirectory()) {
            // just a plain file which isn't deployed
  @@ -446,7 +451,10 @@
         if (files == null) {
            throw new Exception("Null files returned from directory listing");
         }
  -      
  +
  +      // list of urls to deploy
  +      List list = new LinkedList();
  +         
         for (int i = 0; i < files.length; i++)
         {
            if (files[i].isDirectory()) {
  @@ -463,8 +471,21 @@
            // It is a new file
            url = files[i].toURL();
            if (!isDeployed(url)) {
  -            deploy(new DeployedURL(url));
  +            list.add(url);
            }
  +      }
  +
  +      //
  +      // HACK, sort the elements so dependencies have a better chance of working
  +      // 
  +      list = sorter.sortURLs(list);
  +
  +      // deploy each url
  +      Iterator iter = list.iterator();
  +      while (iter.hasNext()) 
  +      {
  +         url = (URL)iter.next();
  +         deploy(new DeployedURL(url));
         }
      }
   
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to