[jboss-cvs] JBossAS SVN: r85817 - in branches/Branch_5_x: system/src/main/org/jboss/system/tools and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Mar 13 08:19:25 EDT 2009


Author: alesj
Date: 2009-03-13 08:19:25 -0400 (Fri, 13 Mar 2009)
New Revision: 85817

Modified:
   branches/Branch_5_x/profileservice/src/resources/hdscanner-jboss-beans.xml
   branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java
   branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScanner.java
   branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java
   branches/Branch_5_x/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java
Log:
[JBAS-6330]; fix Rob's reported bugz.

Modified: branches/Branch_5_x/profileservice/src/resources/hdscanner-jboss-beans.xml
===================================================================
--- branches/Branch_5_x/profileservice/src/resources/hdscanner-jboss-beans.xml	2009-03-13 11:44:48 UTC (rev 85816)
+++ branches/Branch_5_x/profileservice/src/resources/hdscanner-jboss-beans.xml	2009-03-13 12:19:25 UTC (rev 85817)
@@ -26,6 +26,7 @@
       <constructor>
         <parameter><inject bean="HDScanner"/></parameter>
         <parameter><inject bean="ProfileService"/></parameter>
+        <parameter><inject bean="StructureModificationChecker"/></parameter>
       </constructor>
     </bean>
 

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java	2009-03-13 11:44:48 UTC (rev 85816)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentRepositoryAdapter.java	2009-03-13 12:19:25 UTC (rev 85817)
@@ -67,9 +67,9 @@
    boolean hasURL(URL url) throws URISyntaxException;
 
    /**
-    * List deployed urls.
+    * List deployed urls as strings.
     *
     * @return the list of deployed urls
     */
-   URL[] listDeployedURLs();
+   String[] listDeployedURLs();
 }
\ No newline at end of file

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScanner.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScanner.java	2009-03-13 11:44:48 UTC (rev 85816)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScanner.java	2009-03-13 12:19:25 UTC (rev 85817)
@@ -123,7 +123,7 @@
       return adapter.hasURL(url);
    }
 
-   public URL[] listDeployedURLs()
+   public String[] listDeployedURLs()
    {
       return adapter.listDeployedURLs();
    }

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java	2009-03-13 11:44:48 UTC (rev 85816)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/tools/DeploymentScannerMBean.java	2009-03-13 12:19:25 UTC (rev 85817)
@@ -96,9 +96,9 @@
    boolean hasURL(URL url) throws URISyntaxException;
 
    /**
-    * List deployed urls.
+    * List deployed urls as strings.
     *
     * @return the list of deployed urls
     */
-   URL[] listDeployedURLs();
+   String[] listDeployedURLs();
 }
\ No newline at end of file

Modified: branches/Branch_5_x/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java	2009-03-13 11:44:48 UTC (rev 85816)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/tools/ProfileServiceDeploymentRepositoryAdapter.java	2009-03-13 12:19:25 UTC (rev 85817)
@@ -40,6 +40,7 @@
 import org.jboss.system.server.profileservice.hotdeploy.Scanner;
 import org.jboss.system.server.profileservice.repository.MutableDeploymentRepository;
 import org.jboss.virtual.VirtualFile;
+import org.jboss.deployers.vfs.spi.structure.modified.StructureModificationChecker;
 
 /**
  * Profile deployment repository adapter.
@@ -54,17 +55,22 @@
 
    private Scanner scanner;
    private ProfileService ps;
+   private StructureModificationChecker checker;
+
    private DeploymentScannerProfile profile;
 
-   public ProfileServiceDeploymentRepositoryAdapter(Scanner scanner, ProfileService ps)
+   public ProfileServiceDeploymentRepositoryAdapter(Scanner scanner, ProfileService ps, StructureModificationChecker checker)
    {
       if (scanner == null)
          throw new IllegalArgumentException("Null scanner");
       if (ps == null)
          throw new IllegalArgumentException("Null profile service");
+      if (checker == null)
+         throw new IllegalArgumentException("Null structure checker");
 
       this.scanner = scanner;
       this.ps = ps;
+      this.checker = checker;
    }
 
    /**
@@ -74,7 +80,7 @@
     */
    public void create() throws Exception
    {
-      this.profile = new DeploymentScannerProfile();
+      this.profile = new DeploymentScannerProfile(checker);
       // Create the profile
       registerProfile();
    }
@@ -144,12 +150,19 @@
 
    public void addURL(URL url) throws URISyntaxException
    {
-      profile.getURIs().add(url.toURI());
+      URI uri = url.toURI();
+      Collection<URI> uris = profile.getURIs();
+      if (uris.contains(uri) == false)
+      {
+         uris.add(uri);
+      }
    }
 
    public void removeURL(URL url) throws URISyntaxException
    {
-      profile.getURIs().remove(url.toURI());
+      URI uri = url.toURI();
+      Collection<URI> uris = profile.getURIs();
+      uris.remove(uri);
    }
 
    public boolean hasURL(URL url) throws URISyntaxException
@@ -159,9 +172,9 @@
       return profile.getURIs().contains(uri);
    }
 
-   public URL[] listDeployedURLs()
+   public String[] listDeployedURLs()
    {
-      List<URL> urls = new ArrayList<URL>();
+      List<String> urls = new ArrayList<String>();
 
       Collection<ProfileKey> activeProfiles = ps.getActiveProfileKeys();
       if (activeProfiles != null && activeProfiles.isEmpty() == false)
@@ -188,7 +201,7 @@
                   {
                      try
                      {
-                        urls.add(root.toURL());
+                        urls.add(root.toURL().toExternalForm());
                      }
                      catch (Exception e)
                      {
@@ -200,16 +213,17 @@
          }
       }
 
-      return urls.toArray(new URL[urls.size()]);
+      return urls.toArray(new String[urls.size()]);
    }
 
    public static class DeploymentScannerProfile extends MutableDeploymentRepository implements MutableProfile
    {
       private volatile boolean enableHotDeployment;
 
-      public DeploymentScannerProfile()
+      public DeploymentScannerProfile(StructureModificationChecker checker)
       {
          super(profileName, new URI[0]);
+         setChecker(checker);
       }
 
       /**




More information about the jboss-cvs-commits mailing list