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

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Mar 5 09:41:34 EST 2009


Author: emuckenhuber
Date: 2009-03-05 09:41:34 -0500 (Thu, 05 Mar 2009)
New Revision: 85295

Modified:
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java
Log:
better handling of locked deployment content.

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-05 14:18:19 UTC (rev 85294)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractDeploymentRepository.java	2009-03-05 14:41:34 UTC (rev 85295)
@@ -46,6 +46,9 @@
 public abstract class AbstractDeploymentRepository extends AbstractVFSProfileSource implements DeploymentRepository
 {
    
+   /** The ignore flags. */
+   protected final static int ignoreFlags = DeploymentContentFlags.LOCKED | DeploymentContentFlags.DISABLED;
+   
    /** The associated profile key. */
    private ProfileKey key;
    
@@ -78,7 +81,21 @@
       this.contentFlags.clear();
    }
    
+   
    @Override
+   protected boolean acceptsDeployment(String name)
+   {
+      if(hasDeploymentContentFlags(name, ignoreFlags))
+      {
+         if(log.isTraceEnabled())
+            log.trace("Ignoring locked application: " + name);
+         
+         return false;
+      }
+      return super.acceptsDeployment(name);
+   }
+   
+   @Override
    public ProfileDeployment removeDeployment(String vfsPath) throws Exception
    {
       if(vfsPath == null)

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java	2009-03-05 14:18:19 UTC (rev 85294)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/AbstractVFSProfileSource.java	2009-03-05 14:41:34 UTC (rev 85295)
@@ -198,7 +198,7 @@
       }
       
       String key = component.toURI().toString();
-      if (applicationCtxs.containsKey(key) == true)
+      if(acceptsDeployment(key) == false)
          return;
 
       if (component.isLeaf())
@@ -216,6 +216,14 @@
       }      
    }
    
+   protected boolean acceptsDeployment(String name)
+   {
+      if (applicationCtxs.containsKey(name) == true)
+         return false;
+      
+      return true;
+   }
+   
    protected List<String> findDeploymentContent(String name)
    {
       if(this.applicationVFCache.containsKey(name))

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-05 14:18:19 UTC (rev 85294)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/MutableDeploymentRepository.java	2009-03-05 14:41:34 UTC (rev 85295)
@@ -185,7 +185,6 @@
          if (apps != null)
          {
             Iterator<ProfileDeployment> iter = apps.iterator();
-            int ignoreFlags = DeploymentContentFlags.LOCKED | DeploymentContentFlags.DISABLED;
             while (iter.hasNext())
             {
                ProfileDeployment ctx = iter.next();
@@ -229,14 +228,11 @@
                addedDeployments(added, deployDir);
                for (VirtualFile vf : added)
                {
-                  if (this.hasDeploymentContentFlags(vf.getPathName(), ignoreFlags))
-                  {
-                     if (trace)
-                        log.trace("Ignoring locked application: " + vf);
-                     continue;
-                  }
+                  // Create deployment
                   ProfileDeployment ctx = createDeployment(vf);
+                  // Create modification info
                   ModificationInfo info = new ModificationInfo(ctx, vf.getLastModified(), ModifyStatus.ADDED);
+                  // Add
                   modified.add(info);
                   addDeployment(ctx.getName(), ctx);
                   getChecker().addStructureRoot(vf);




More information about the jboss-cvs-commits mailing list