[jboss-cvs] JBossAS SVN: r87022 - branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Apr 8 21:46:26 EDT 2009


Author: bstansberry at jboss.com
Date: 2009-04-08 21:46:26 -0400 (Wed, 08 Apr 2009)
New Revision: 87022

Modified:
   branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
Log:


Modified: branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
===================================================================
--- branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java	2009-04-09 01:25:20 UTC (rev 87021)
+++ branches/Branch_5_x/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java	2009-04-09 01:46:26 UTC (rev 87022)
@@ -31,10 +31,12 @@
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
 import org.jboss.deployers.vfs.spi.structure.modified.StructureModificationChecker;
+import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.DeploymentContentFlags;
 import org.jboss.profileservice.spi.ModificationInfo;
 import org.jboss.profileservice.spi.ProfileDeployment;
@@ -44,6 +46,7 @@
 import org.jboss.system.server.profileservice.repository.clustered.local.LocalContentManager;
 import org.jboss.system.server.profileservice.repository.clustered.local.LocalContentManagerFactory;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
+import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
 
 /**
@@ -92,7 +95,7 @@
          Set<LocalContentManagerFactory<?>> persisterFactories) 
          throws IOException
    {
-      super(key, uris);
+      super(key, validateURIs(uris, key));
       
       if (clusteringHandlers == null)
       {
@@ -103,7 +106,7 @@
       {
          throw new IllegalArgumentException("Null persisterFactories");
       }
-      this.namedURIMap = getNamedURIMap(uris);
+      this.namedURIMap = getNamedURIMap(getRepositoryURIs());
       this.clusteringHandlers = clusteringHandlers;
       this.localContentManagerFactories = persisterFactories;
    }
@@ -712,6 +715,27 @@
 //      return updated;      
 //   }
 
+   private static URI[] validateURIs(URI[] uris, ProfileKey profileKey)
+   {
+      List<URI> list = new ArrayList<URI>();
+      for (URI uri : uris)
+      {
+         try
+         {
+            VFS.getRoot(uri);
+            list.add(uri);
+         }
+         catch (Exception e)
+         {
+            Logger slog = Logger.getLogger(ClusteredDeploymentRepository.class);
+            slog.error("Problem accessing URI " + uri + " -- it will not be " +
+                 "used for profile " + profileKey + ". Problem was: " + 
+                 e.getLocalizedMessage());
+         }         
+      }
+      return list.toArray(new URI[list.size()]);
+   }
+   
    private Map<String, URI> getNamedURIMap(URI[] uris) throws IOException
    {
       Map<String, URI> map = new HashMap<String, URI>();
@@ -719,17 +743,8 @@
       {
          for (URI uri : uris)
          {
-            try
-            {
-               VirtualFile vf = getCachedVirtualFile(uri);
-               map.put(vf.getName(), uri);
-            }
-            catch (Exception e)
-            {
-               log.error("Problem accessing URI " + uri + " -- it will not be " +
-               		"used for profile " + getProfileKey() + ". Problem was " + 
-               		e.getLocalizedMessage());
-            }
+            VirtualFile vf = getCachedVirtualFile(uri);
+            map.put(vf.getName(), uri);
          }
       }
       




More information about the jboss-cvs-commits mailing list