[jboss-cvs] JBossAS SVN: r85116 - in trunk/system/src/main/org/jboss/system/server: profileservice/repository and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Mar 2 09:38:13 EST 2009


Author: emuckenhuber
Date: 2009-03-02 09:38:12 -0500 (Mon, 02 Mar 2009)
New Revision: 85116

Added:
   trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
Modified:
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java
Log:
add a basic immutable profile.

Added: trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/server/profile/repository/AbstractImmutableProfile.java	2009-03-02 14:38:12 UTC (rev 85116)
@@ -0,0 +1,138 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.system.server.profile.repository;
+
+import java.net.URI;
+import java.util.Collection;
+import java.util.List;
+
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.Profile;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.system.server.profileservice.repository.AbstractVFSProfileSource;
+import org.jboss.virtual.VirtualFile;
+
+/**
+ * A immutable profile.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class AbstractImmutableProfile extends AbstractVFSProfileSource implements Profile
+{
+
+   /** The profile key. */
+   private ProfileKey key;
+   
+   /** The profile dependencies */
+   private List<ProfileKey> subProfiles;
+   
+   public AbstractImmutableProfile(ProfileKey key, URI[] uris)
+   {
+      this(key, uris, null);
+   }
+   
+   public AbstractImmutableProfile(ProfileKey key, URI[] uris, List<ProfileKey> subprofiles)
+   {
+      super(uris);
+      //
+      if(key == null)
+         throw new IllegalArgumentException("Null profile key.");
+      
+      this.key = key;
+      this.subProfiles = subprofiles;
+   }
+   
+   public void create() throws Exception
+   {
+      for(URI uri : getRepositoryURIs())
+      {
+         VirtualFile root = getCachedVirtualFile(uri);
+         loadApplications(root);
+      }
+      updateLastModfied();
+   }
+   
+   public ProfileKey getKey()
+   {
+      return this.key;
+   }
+
+   public Collection<ProfileKey> getSubProfiles()
+   {
+      return this.subProfiles;
+   }
+   
+   @Override
+   public ProfileDeployment getDeployment(String vfsPath) throws NoSuchDeploymentException
+   {
+      if(vfsPath == null)
+         throw new IllegalArgumentException("Null name");
+      
+      ProfileDeployment ctx = super.getDeployment(vfsPath);
+      if(ctx == null)
+      {
+         List<String> names = findDeploymentContent(vfsPath);
+         if(names.size() == 1)
+         {
+            ctx = super.getDeployment(names.get(0));
+         }
+         else if(names.size() > 1)
+         {
+            throw new NoSuchDeploymentException("Multiple deployments found for: "+ vfsPath +", available: " + names);            
+         }
+      }
+      if(ctx == null)
+      {
+         log.debug("Failed to find application for: "+vfsPath+", available: " + getDeploymentNames());
+         throw new NoSuchDeploymentException("Failed to find deployment in file: " + vfsPath);
+      }
+      return ctx;
+   }
+   
+   public void setSubProfiles(List<ProfileKey> subProfiles)
+   {
+      this.subProfiles = subProfiles;
+   }
+
+   public boolean hasDeployment(String name)
+   {
+      if(name == null)
+         throw new IllegalArgumentException("Null name.");
+      // FIXME
+      try
+      {
+         return getDeployment(name) != null;
+      }
+      catch(Exception e)
+      {
+         return false;
+      }
+   }
+
+   public boolean isMutable()
+   {
+      return false;
+   }
+
+}

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java	2009-03-02 14:17:28 UTC (rev 85115)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractAttachmentStore.java	2009-03-02 14:38:12 UTC (rev 85116)
@@ -198,7 +198,7 @@
       }
       catch(IOException e)
       {
-         log.error("failed to get LastModified date for file, not using persisted metadata: "+ profileDeployment.getRoot().getPathName());
+         log.error("failed to get LastModified date for file, not using persisted metadata: "+ profileDeployment.getName());
          return deployment;
       }
       

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java	2009-03-02 14:17:28 UTC (rev 85115)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java	2009-03-02 14:38:12 UTC (rev 85116)
@@ -24,24 +24,18 @@
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
-import org.jboss.logging.Logger;
 import org.jboss.profileservice.spi.DeploymentContentFlags;
 import org.jboss.profileservice.spi.DeploymentRepository;
 import org.jboss.profileservice.spi.NoSuchDeploymentException;
 import org.jboss.profileservice.spi.ProfileDeployment;
 import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
-import org.jboss.virtual.VirtualFileFilter;
 
 /**
  * A abstract VFS based deployment repository.
@@ -49,46 +43,22 @@
  * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
  * @version $Revision$
  */
-public abstract class AbstractDeploymentRepository implements DeploymentRepository
+public abstract class AbstractDeploymentRepository extends AbstractVFSProfileSource implements DeploymentRepository
 {
    
    /** The associated profile key. */
    private ProfileKey key;
    
-   /** The repository uris. */
-   protected final Collection<URI> uris;
-
-   /** The VFSDeployments. */
-   private Map<String, ProfileDeployment> applicationCtxs = new ConcurrentHashMap<String, ProfileDeployment>();
-   
    /** The content flags. */
    private Map<String, Integer> contentFlags = new ConcurrentHashMap<String, Integer>();
-   
-   /** Allowed deployments filter. */
-   private VirtualFileFilter deploymentFilter;
-   
-   /** The application phase deployment files keyed by VirtualFile URI string. */
-   private final Map<String, VirtualFile> applicationVFCache = new ConcurrentHashMap<String, VirtualFile>();
-
-   /** The last time the profile was modified. */
-   private volatile long lastModified;
-   
-   /** The logger. */
-   protected final Logger log = Logger.getLogger(getClass());
-   
+      
    public AbstractDeploymentRepository(ProfileKey key, URI[] uris)
    {
+      super(uris);
       if(key == null)
          throw new IllegalArgumentException("Null profile key.");
-      if(uris == null)
-         throw new IllegalArgumentException("Null uris");
       
       this.key = key;
-      this.uris = new ArrayList<URI>();
-      for(URI uri : uris)
-      {
-         this.uris.add(uri);
-      }
    }
    
    public ProfileKey getProfileKey()
@@ -96,21 +66,6 @@
       return this.key;
    }
 
-   public VirtualFileFilter getDeploymentFilter()
-   {
-      return deploymentFilter;
-   }
-   
-   public void setDeploymentFilter(VirtualFileFilter deploymentFilter)
-   {
-      this.deploymentFilter = deploymentFilter;
-   }
-   
-   public URI[] getRepositoryURIs()
-   {
-      return uris.toArray(new URI[uris.size()]);
-   }
-   
    public void create() throws Exception
    {
       //
@@ -118,162 +73,69 @@
    
    public void unload()
    {
+      super.destroy();
       // Unload
-      this.applicationCtxs.clear();
-      this.applicationVFCache.clear();
       this.contentFlags.clear();
-      this.lastModified = 0;
    }
    
-   public void addDeployment(String vfsPath, ProfileDeployment d) throws Exception
-   {
-      if(vfsPath == null)
-         throw new IllegalArgumentException("Null vfsPath");
-      if(d == null)
-         throw new IllegalArgumentException("Null deployment");
-      
-      this.applicationCtxs.put(vfsPath, d);
-      if(d.getRoot() != null)
-         this.applicationVFCache.put(d.getName(), d.getRoot());
-      updateLastModfied();
-   }
-   
+   @Override
    public ProfileDeployment removeDeployment(String vfsPath) throws Exception
    {
       if(vfsPath == null)
          throw new IllegalArgumentException("Null vfsPath");
       
       // Get the deployment
-      ProfileDeployment deployment = getDeployment(vfsPath);
+      ProfileDeployment deployment = super.removeDeployment(vfsPath);
       // Remove the entries
-      this.applicationCtxs.remove(deployment.getName());
-      this.applicationVFCache.remove(deployment.getName());
-      // Update last modified
-      updateLastModfied();
+      this.contentFlags.remove(deployment.getName());
       // Return
       return deployment;
    }
-   
-   /**
-    * Load all the applications under the applicationDir.
-    * 
-    * @param applicationDir the application directory
-    * @throws IOException
-    */
-   protected void loadApplications(VirtualFile applicationDir) throws Exception
-   {
-      ArrayList<VirtualFile> added = new ArrayList<VirtualFile>();
-      addedDeployments(added, applicationDir);
-      for (VirtualFile vf : added)
-      {
-         ProfileDeployment vfCtx = createDeployment(vf);
-         addDeployment(vfCtx.getName(), vfCtx);
-      }
-   }
-   
-   protected void addedDeployments(List<VirtualFile> list, VirtualFile root) throws IOException, URISyntaxException
-   {
-      if(root.isLeaf())
-      {
-         addedDeployment(list, root);
-      }
-      else
-      {
-         List<VirtualFile> components = root.getChildren();
-         for (VirtualFile component : components)
-         {
-            addedDeployment(list, component);
-         }         
-      }
-   }
-   
-   protected void addedDeployment(List<VirtualFile> list, VirtualFile component) throws IOException, URISyntaxException
-   {
-      // Excluding files from scanning
-      if(deploymentFilter != null && ! this.deploymentFilter.accepts(component))
-      {
-         if(log.isTraceEnabled())
-            log.trace("ignoring "+ component);
-         return;
-      }
-      
-      String key = component.toURI().toString();
-      if (applicationCtxs.containsKey(key) == true)
-         return;
 
-      if (component.isLeaf())
-      {
-         list.add(component);
-      }
-      else if (component.getName().indexOf('.') == -1)
-      {
-         // recurse if not '.' in name and recursive search is enabled
-         addedDeployments(list, component);
-      }
-      else
-      {
-         list.add(component);
-      }      
-   }
-
+   @Override
    public ProfileDeployment getDeployment(String vfsPath) throws NoSuchDeploymentException
    {
       if(vfsPath == null)
          throw new IllegalArgumentException("Null vfsPath");
       
-      ProfileDeployment ctx = this.applicationCtxs.get(vfsPath);
+      ProfileDeployment ctx = super.getDeployment(vfsPath);
       if(ctx == null)
       {
          List<String> names = findDeploymentContent(vfsPath);
          if(names.size() == 1)
          {
-            ctx = this.applicationCtxs.get(names.get(0));
+            ctx = super.getDeployment(names.get(0));
          }
          else if(names.size() > 1)
          {
-            throw new NoSuchDeploymentException("Multiple deployments found for: "+vfsPath+", available: " + names);            
+            throw new NoSuchDeploymentException("Multiple deployments found for: "+ vfsPath +", available: " + names);            
          }
       }
       if(ctx == null)
       {
-         log.debug("Failed to find application for: "+vfsPath+", available: " + applicationCtxs.keySet());
-         throw new NoSuchDeploymentException("Failed to find deployment in profile: "+ key + " filename: " + vfsPath);
+         log.debug("Failed to find application for: "+vfsPath+", available: " + getDeploymentNames());
+         throw new NoSuchDeploymentException("Failed to find deployment in file: " + vfsPath);
       }
       return ctx;
    }
 
-   public Set<String> getDeploymentNames()
-   {
-      return this.applicationCtxs.keySet();
-   }
-
-   public Collection<ProfileDeployment> getDeployments()
-   {
-      return this.applicationCtxs.values();
-   }
-
-   public long getLastModified()
-   {
-      return this.lastModified;
-   }
-
    public VirtualFile getDeploymentContent(String name) throws IOException
    {
       if(name == null)
          throw new IllegalArgumentException("Null name");
       
       // A deploy content needs to be added over addDeployContent
-      VirtualFile vf = this.applicationVFCache.get(name);
+      VirtualFile vf = getCachedVirtualFile(name);
       if(vf == null)
       {
          List<String> matchingNames = findDeploymentContent(name);
          if(matchingNames.size() == 1)
          {
-            vf = this.applicationVFCache.get(matchingNames.get(0));
+            vf = getCachedVirtualFile(matchingNames.get(0));
          }
          else if(matchingNames.size() > 1)
          {
-            throw new FileNotFoundException("Multiple names found for name: " + name + ", available " + matchingNames);
+            throw new FileNotFoundException("Multiple names found for name: " + name + ", profile: "+ key + ", available: " + matchingNames);
          }
       }
       if(vf == null)
@@ -290,7 +152,7 @@
       Collection<String> tmp = new HashSet<String>();
       for(String name : names)
       {
-         if(this.applicationVFCache.containsKey(name))
+         if(getCachedVirtualFile(name) != null)
          {
             tmp.add(name);
          }
@@ -304,23 +166,6 @@
       }
       return tmp.toArray(new String[tmp.size()]);
    }
-   
-   protected List<String> findDeploymentContent(String name)
-   {
-      List<String> contents = new ArrayList<String>();
-      for(String cacheName : this.applicationVFCache.keySet())
-      {
-         String fixedName = cacheName;
-         if(cacheName.endsWith("/"))
-            fixedName = cacheName.substring(0, cacheName.length() -1);
-         
-         if(fixedName.endsWith(name))
-         {
-            contents.add(cacheName);
-         }
-      }
-      return contents;
-   }
 
    public int lockDeploymentContent(String vfsPath)
    {
@@ -365,24 +210,4 @@
       return flags;
    }
 
-   protected ProfileDeployment createDeployment(VirtualFile vf) throws Exception
-   {
-      return new AbstractProfileDeployment(vf);
-   }
-
-   protected VirtualFile getCachedVirtualFile(URI uri) throws IOException 
-   {
-      VirtualFile vf = this.applicationVFCache.get(uri.toString());
-      if(vf == null)
-      {
-         vf = VFS.getRoot(uri);
-         this.applicationVFCache.put(uri.toString(), vf);
-      }
-      return vf;
-   }
-   
-   protected void updateLastModfied()
-   {
-      this.lastModified = System.currentTimeMillis();
-   }
 }

Added: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java	                        (rev 0)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java	2009-03-02 14:38:12 UTC (rev 85116)
@@ -0,0 +1,266 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */ 
+package org.jboss.system.server.profileservice.repository;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.jboss.logging.Logger;
+import org.jboss.profileservice.spi.NoSuchDeploymentException;
+import org.jboss.profileservice.spi.ProfileDeployment;
+import org.jboss.virtual.VFS;
+import org.jboss.virtual.VirtualFile;
+import org.jboss.virtual.VirtualFileFilter;
+
+/**
+ * A abstract VFS based source for profile deployments.
+ * 
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class AbstractVFSProfileSource
+{
+   
+   /** The repository uris. */
+   protected final Collection<URI> uris;
+
+   /** The VFSDeployments. */
+   private Map<String, ProfileDeployment> applicationCtxs = new ConcurrentHashMap<String, ProfileDeployment>();
+   
+   /** Allowed deployments filter. */
+   private VirtualFileFilter deploymentFilter;
+   
+   /** The application phase deployment files keyed by VirtualFile URI string. */
+   private final Map<String, VirtualFile> applicationVFCache = new ConcurrentHashMap<String, VirtualFile>();
+
+   /** The last time the profile was modified. */
+   private volatile long lastModified;
+   
+   /** The logger. */
+   protected final Logger log = Logger.getLogger(getClass());
+   
+   public AbstractVFSProfileSource(URI[] uris)
+   {
+      if(uris == null)
+         throw new IllegalArgumentException("Null uris");
+      
+      this.uris = new ArrayList<URI>();
+      for(URI uri : uris)
+      {
+         this.uris.add(uri);
+      }
+   }
+
+   public VirtualFileFilter getDeploymentFilter()
+   {
+      return deploymentFilter;
+   }
+   
+   public void setDeploymentFilter(VirtualFileFilter deploymentFilter)
+   {
+      this.deploymentFilter = deploymentFilter;
+   }
+   
+   public URI[] getRepositoryURIs()
+   {
+      return uris.toArray(new URI[uris.size()]);
+   }
+   
+   public Set<String> getDeploymentNames()
+   {
+      return this.applicationCtxs.keySet();
+   }
+
+   public Collection<ProfileDeployment> getDeployments()
+   {
+      return this.applicationCtxs.values();
+   }
+   
+   public long getLastModified()
+   {
+      return this.lastModified;
+   }
+   
+   public void destroy()
+   {
+      // Unload
+      this.applicationCtxs.clear();
+      this.applicationVFCache.clear();
+      this.lastModified = 0;
+   }
+   
+   public void addDeployment(String vfsPath, ProfileDeployment d) throws Exception
+   {
+      if(vfsPath == null)
+         throw new IllegalArgumentException("Null vfsPath");
+      if(d == null)
+         throw new IllegalArgumentException("Null deployment");
+      
+      this.applicationCtxs.put(vfsPath, d);
+      if(d.getRoot() != null)
+         this.applicationVFCache.put(d.getName(), d.getRoot());
+      updateLastModfied();
+   }
+   
+   public ProfileDeployment getDeployment(String vfsPath) throws NoSuchDeploymentException
+   {
+      if(vfsPath == null)
+         throw new IllegalArgumentException("Null vfsPath");
+
+      return this.applicationCtxs.get(vfsPath);
+   }
+   
+   public ProfileDeployment removeDeployment(String vfsPath) throws Exception
+   {
+      if(vfsPath == null)
+         throw new IllegalArgumentException("Null vfsPath");
+      
+      // Get the deployment
+      ProfileDeployment deployment = getDeployment(vfsPath);
+      // Remove the entries
+      this.applicationCtxs.remove(deployment.getName());
+      this.applicationVFCache.remove(deployment.getName());
+      // Update last modified
+      updateLastModfied();
+      // Return
+      return deployment;
+   }
+   
+   /**
+    * Load all the applications under the applicationDir.
+    * 
+    * @param applicationDir the application directory
+    * @throws IOException
+    */
+   protected void loadApplications(VirtualFile applicationDir) throws Exception
+   {
+      ArrayList<VirtualFile> added = new ArrayList<VirtualFile>();
+      addedDeployments(added, applicationDir);
+      for (VirtualFile vf : added)
+      {
+         ProfileDeployment vfCtx = createDeployment(vf);
+         addDeployment(vfCtx.getName(), vfCtx);
+      }
+   }
+   
+   protected void addedDeployments(List<VirtualFile> list, VirtualFile root) throws IOException, URISyntaxException
+   {
+      if(root.isLeaf())
+      {
+         addedDeployment(list, root);
+      }
+      else
+      {
+         List<VirtualFile> components = root.getChildren();
+         for (VirtualFile component : components)
+         {
+            addedDeployment(list, component);
+         }         
+      }
+   }
+   
+   protected void addedDeployment(List<VirtualFile> list, VirtualFile component) throws IOException, URISyntaxException
+   {
+      // Excluding files from scanning
+      if(deploymentFilter != null && ! this.deploymentFilter.accepts(component))
+      {
+         if(log.isTraceEnabled())
+            log.trace("ignoring "+ component);
+         return;
+      }
+      
+      String key = component.toURI().toString();
+      if (applicationCtxs.containsKey(key) == true)
+         return;
+
+      if (component.isLeaf())
+      {
+         list.add(component);
+      }
+      else if (component.getName().indexOf('.') == -1)
+      {
+         // recurse if not '.' in name and recursive search is enabled
+         addedDeployments(list, component);
+      }
+      else
+      {
+         list.add(component);
+      }      
+   }
+   
+   protected List<String> findDeploymentContent(String name)
+   {
+      if(this.applicationVFCache.containsKey(name))
+      {
+         return Collections.singletonList(name);
+      }
+      
+      List<String> contents = new ArrayList<String>();
+      for(String cacheName : this.applicationVFCache.keySet())
+      {
+         String fixedName = cacheName;
+         if(cacheName.endsWith("/"))
+            fixedName = cacheName.substring(0, cacheName.length() -1);
+         
+         if(fixedName.endsWith(name))
+         {
+            contents.add(cacheName);
+         }
+      }
+      return contents;
+   }
+   
+   protected ProfileDeployment createDeployment(VirtualFile vf) throws Exception
+   {
+      return new AbstractProfileDeployment(vf);
+   }
+
+   protected VirtualFile getCachedVirtualFile(String name)
+   {
+      return this.applicationVFCache.get(name);
+   }
+   
+   protected VirtualFile getCachedVirtualFile(URI uri) throws IOException 
+   {
+      VirtualFile vf = getCachedVirtualFile(uri.toString());
+      if(vf == null)
+      {
+         vf = VFS.getRoot(uri);
+         this.applicationVFCache.put(uri.toString(), vf);
+      }
+      return vf;
+   }
+   
+   protected void updateLastModfied()
+   {
+      this.lastModified = System.currentTimeMillis();
+   }
+}
+

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java	2009-03-02 14:17:28 UTC (rev 85115)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java	2009-03-02 14:38:12 UTC (rev 85116)
@@ -158,7 +158,7 @@
          }
 
          // Lock the content
-         lockDeploymentContent(vfsPath);
+         lockDeploymentContent(repositoryName);
       }
       finally
       {
@@ -190,7 +190,7 @@
             {
                ProfileDeployment ctx = iter.next();
                VirtualFile root = ctx.getRoot();
-               String pathName = root.getPathName();
+               String pathName = ctx.getName();
                // Ignore locked or disabled applications
                if (this.hasDeploymentContentFlags(pathName, ignoreFlags))
                {




More information about the jboss-cvs-commits mailing list