[jboss-cvs] JBossAS SVN: r75081 - trunk/system/src/main/org/jboss/system/server/profileservice/repository.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jun 25 14:46:45 EDT 2008


Author: alesj
Date: 2008-06-25 14:46:44 -0400 (Wed, 25 Jun 2008)
New Revision: 75081

Modified:
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
Log:
Synch access to deployerDir map.

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-06-25 18:30:35 UTC (rev 75080)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/SerializableDeploymentRepository.java	2008-06-25 18:46:44 UTC (rev 75081)
@@ -87,7 +87,7 @@
    /** The application phase deployments dir */
    private File[] applicationDirs;
    /** The application phase deployments dir */
-   private Map<String, VirtualFile> deployDirs;
+   private final Map<String, VirtualFile> deployDirs = new HashMap<String, VirtualFile>();
    /** The deployment post edit root location */
    private File adminEditsRoot;
    /** The profile key this repository is associated with */
@@ -618,7 +618,6 @@
          if( applicationDir.exists() == false )
             throw new FileNotFoundException("Profile contains no deploy dir: "+applicationDir);
       }
-      deployDirs = new HashMap<String, VirtualFile>(applicationDirs.length);
 
       adminEditsRoot = new File(profileRoot, "profile/edits");
 
@@ -651,11 +650,15 @@
    {
       URI uri = applicationDir.toURI();
       String uriString = uri.toString();
-      VirtualFile dir = deployDirs.get(uriString);
-      if (dir == null)
+      VirtualFile dir;
+      synchronized (deployDirs)
       {
-         dir = VFS.getRoot(uri);
-         deployDirs.put(uriString, dir);
+         dir = deployDirs.get(uriString);
+         if (dir == null)
+         {
+            dir = VFS.getRoot(uri);
+            deployDirs.put(uriString, dir);
+         }
       }
       return dir;
    }




More information about the jboss-cvs-commits mailing list