[jboss-cvs] JBossAS SVN: r88110 - in trunk: cluster/src/main/org/jboss/profileservice/cluster/repository and 14 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 1 17:41:25 EDT 2009


Author: bstansberry at jboss.com
Date: 2009-05-01 17:41:24 -0400 (Fri, 01 May 2009)
New Revision: 88110

Added:
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-mod-deployment-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-remove-deployment-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml
Removed:
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml
   trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml
Modified:
   trunk/cluster/src/main/org/jboss/ha/timestamp/TimestampDiscrepancyService.java
   trunk/cluster/src/main/org/jboss/profileservice/cluster/repository/DefaultRepositoryClusteringHandler.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/RepositoryClusteringHandler.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/AbstractLocalContentManager.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryRootMetadata.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/AbstractContentModificationGenerator.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteContentModificationGenerator.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java
   trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/SynchronizationActionContext.java
   trunk/testsuite/imports/sections/cluster.xml
   trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ReadWriteClusteredLockManagerUnitTestCase.java
   trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java
Log:
[JBAS-5552] Sync with Branch_5_x

Modified: trunk/cluster/src/main/org/jboss/ha/timestamp/TimestampDiscrepancyService.java
===================================================================
--- trunk/cluster/src/main/org/jboss/ha/timestamp/TimestampDiscrepancyService.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/cluster/src/main/org/jboss/ha/timestamp/TimestampDiscrepancyService.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -920,14 +920,14 @@
    /** Object we register with the HAPartition */
    public class RpcHandler
    {
-      public Map<Server, TimestampDiscrepancy> getDiscrepancies()
+      public RemoteDiscrepancies getDiscrepancies()
       {
          Map<Server, TimestampDiscrepancy> result = null;
          synchronized (discrepancies)
          {
             result = new HashMap<Server, TimestampDiscrepancy>(discrepancies);
          }
-         return result;
+         return new RemoteDiscrepancies(partition.getClusterNode(), result);
       }
       
       public TimestampResponse getLocalTimestamp()

Modified: trunk/cluster/src/main/org/jboss/profileservice/cluster/repository/DefaultRepositoryClusteringHandler.java
===================================================================
--- trunk/cluster/src/main/org/jboss/profileservice/cluster/repository/DefaultRepositoryClusteringHandler.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/cluster/src/main/org/jboss/profileservice/cluster/repository/DefaultRepositoryClusteringHandler.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -42,6 +42,7 @@
 import org.jboss.system.server.profileservice.repository.clustered.local.LocalContentManager;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata;
+import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryRootMetadata;
 import org.jboss.system.server.profileservice.repository.clustered.sync.ByteChunk;
 import org.jboss.system.server.profileservice.repository.clustered.sync.ContentModification;
 import org.jboss.system.server.profileservice.repository.clustered.sync.ImmutableSynchronizationPolicy;
@@ -333,7 +334,7 @@
       return result;      
    }
 
-   public VirtualFile addDeploymentContent(String vfsPath, InputStream contentIS) throws IOException
+   public RepositoryItemMetadata addDeploymentContent(String vfsPath, InputStream contentIS) throws IOException
    {
       RepositoryItemMetadata item = this.contentManager.getItemForAddition(vfsPath);
       RepositoryContentMetadata updated = this.contentManager.getContentMetadataForAdd(item, contentIS);
@@ -351,7 +352,9 @@
       
       installModifications(modifications, updated);
       
-      return this.contentManager.getVirtualFileForItem(item);
+      official = this.contentManager.getOfficialContentMetadata();
+      RepositoryRootMetadata rrmd = official.getRepositoryRootMetadata(item.getRootName());
+      return rrmd.getItemMetadata(item.getRelativePathElements());
    }
 
    public void removeDeploymentContent(VirtualFile vf) throws Exception

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/ClusteredDeploymentRepository.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -30,32 +30,33 @@
 import java.util.Collection;
 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;
 import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.ModificationInfo.ModifyStatus;
-import org.jboss.system.server.profileservice.repository.AbstractDeploymentRepository;
+import org.jboss.system.server.profileservice.repository.HotDeploymentRepository;
 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.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata;
+import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryRootMetadata;
 import org.jboss.virtual.VFS;
 import org.jboss.virtual.VirtualFile;
 
 /**
+ * DeploymentRepository that keeps its contents in sync across a cluster.
+ * 
  * @author Brian Stansberry
  * 
  * @version $Revision: $
  */
-public class ClusteredDeploymentRepository 
-   extends AbstractDeploymentRepository
+public class ClusteredDeploymentRepository
+   extends HotDeploymentRepository
 {
    private enum LoadStatus { UNLOADED, LOADING, LOADED };
    
@@ -79,8 +80,6 @@
     */
    private volatile LoadStatus loadStatus = LoadStatus.UNLOADED;
    
-   /** The structure modification checker */
-   private StructureModificationChecker checker;
    private boolean created;
       
    /**
@@ -157,35 +156,18 @@
       return update;
    }
 
-   /**
-    * Get the structure modified checker.
-    *
-    * @return the checker
-    */
-   protected StructureModificationChecker getChecker()
-   {
-      if (checker == null)
-         throw new IllegalArgumentException("Checker must be set");
-
-      return checker;
-   }
-
-   /**
-    * Set the checker.
-    *
-    * @param checker the checker
-    */
-   public void setChecker(StructureModificationChecker checker)
-   {
-      this.checker = checker;
-   }
-
    // ---------------------------------------------------- DeploymentRepository
 
    /**
     * Extends superclass to check whether our configured URIs actually exist,
     * if so validating that a clustering handler has been injected, throwing
-    * an <code>IllegalStateException</code> if not.
+    * an <code>IllegalStateException</code> if not. This allows this
+    * repository to function as an empty repository in a non-clustered server 
+    * that doesn't have a RepositoryClusteringHandler, so long as the 
+    * configured URIs don't actually exist (e.g. AS "default" config w/o 
+    * a "farm/" dir). If the configured URIs *do* exist, that implies this
+    * repository is meant to work, and a missing clustering handler dependency
+    * is an exception condition.
     * 
     * {@inheritDoc}
     */
@@ -195,7 +177,7 @@
       super.create();
       
       // See if our URIs actually exist. If not we don't care
-      // if we are missing required dependencies
+      // if we are missing required dependencies. 
       boolean needToFunction = false;      
       for (URI uri : this.getRepositoryURIs())
       {
@@ -330,12 +312,21 @@
       }
       try
       {      
-         VirtualFile contentVF = this.clusteringHandler.addDeploymentContent(vfsPath, contentIS);
+         RepositoryContentMetadata existingRCMD = new RepositoryContentMetadata(this.localContentManager.getOfficialContentMetadata());         
+         RepositoryItemMetadata newRIMD = this.clusteringHandler.addDeploymentContent(vfsPath, contentIS);
+         RepositoryRootMetadata existingRRMD = existingRCMD.getRepositoryRootMetadata(newRIMD.getRootName());
+         boolean exists = existingRRMD != null && existingRRMD.getItemMetadata(newRIMD.getRelativePathElements()) != null;
+         VirtualFile root = getCachedVirtualFile(namedURIMap.get(newRIMD.getRootName()));
+         VirtualFile contentVF = root.getChild(newRIMD.getRelativePath());
 
          try
          {
-            contentVF = getCachedVirtualFile(contentVF.toURI());
-            repositoryName = contentVF.toURI().toString();
+            // Add the new virtual file to the cache
+            repositoryName = addVirtualFileCache(contentVF);
+            
+            // Cleanup 
+            if(exists)
+               cleanUpRoot(contentVF);
          }
          catch(URISyntaxException e)
          {
@@ -396,7 +387,7 @@
             // cluster. However, we might have had changes made to our
             // content (e.g. via addDeploymentContenxt(...)) that have not
             // been deployed. So, check for those...
-            return createModificationInfo();
+            return super.getModifiedDeployments();
          }
       }
       finally
@@ -419,7 +410,7 @@
          // pulling anything to cluster -- just push our changes
          latestContent = this.clusteringHandler.synchronizeContent(false);
          
-         return createModificationInfo();
+         return super.getModifiedDeployments();
       }
       finally
       {
@@ -478,7 +469,7 @@
    {      
       this.clusteringHandler = null;
       this.localContentManager = null; 
-      this.created = false;
+      this.created = false;     
    }
 
    // --------------------------------------  Legacy RepositoryContentPersister
@@ -750,86 +741,5 @@
       
       return map;
    }
-   
-   /**
-    * FIXME This was cut-and-pasted from MutableDeploymentRepository. Turn
-    * the guts of it into a static utility method somewhere.
-    * 
-    * @return
-    * @throws Exception
-    */
-   private Collection<ModificationInfo> createModificationInfo() throws Exception
-   {
-      ArrayList<ModificationInfo> modified = new ArrayList<ModificationInfo>();
-      Collection<ProfileDeployment> apps = getDeployments();
-      boolean trace = log.isTraceEnabled();
-      if (trace)
-         log.trace("Checking applications for modifications");
-      if (apps != null)
-      {
-         Iterator<ProfileDeployment> iter = apps.iterator();
-         int ignoreFlags = DeploymentContentFlags.LOCKED | DeploymentContentFlags.DISABLED;
-         while (iter.hasNext())
-         {
-            ProfileDeployment ctx = iter.next();
-            VirtualFile root = ctx.getRoot();
-            String pathName = root.getPathName();
-            // Ignore locked or disabled applications
-            if (this.hasDeploymentContentFlags(pathName, ignoreFlags))
-            {
-               if (trace)
-                  log.trace("Ignoring locked application: " + root);
-               continue;
-            }
-            // Check for removal
-            if (root.exists() == false)
-            {
-               long rootLastModified = root.getLastModified();
-               ModificationInfo info = new ModificationInfo(ctx, rootLastModified, ModifyStatus.REMOVED);
-               modified.add(info);
-               iter.remove();
-               // Remove last modified cache
-               getChecker().removeStructureRoot(root);
-               if (trace)
-                  log.trace(pathName + " was removed");
-            }
-            // Check for modification
-            else if (getChecker().hasStructureBeenModified(root) || hasDeploymentContentFlags(pathName, DeploymentContentFlags.MODIFIED))
-            {
-               long rootLastModified = root.getLastModified();
-               if (trace)
-                  log.trace(pathName + " was modified: " + rootLastModified);
-               // Create the modification info
-               ModificationInfo info = new ModificationInfo(ctx, rootLastModified, ModifyStatus.MODIFIED);
-               modified.add(info);
-            }
-         }
-         // Now check for additions
-         for (URI applicationDir : getRepositoryURIs())
-         {
-            VirtualFile deployDir = getCachedVirtualFile(applicationDir);
-            ArrayList<VirtualFile> added = new ArrayList<VirtualFile>();
-            addedDeployments(added, deployDir);
-            for (VirtualFile vf : added)
-            {
-               if (this.hasDeploymentContentFlags(vf.getPathName(), ignoreFlags))
-               {
-                  if (trace)
-                     log.trace("Ignoring locked application: " + vf);
-                  continue;
-               }
-               ProfileDeployment ctx = createDeployment(vf);
-               ModificationInfo info = new ModificationInfo(ctx, vf.getLastModified(), ModifyStatus.ADDED);
-               modified.add(info);
-               addDeployment(ctx.getName(), ctx);
-               getChecker().addStructureRoot(vf);
-            }
-         }
-      }
 
-      if (modified.size() > 0)
-         updateLastModfied();
-      return modified;
-   }
-
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/RepositoryClusteringHandler.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/RepositoryClusteringHandler.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/RepositoryClusteringHandler.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -28,30 +28,138 @@
 import org.jboss.profileservice.spi.ProfileKey;
 import org.jboss.system.server.profileservice.repository.clustered.local.LocalContentManager;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
+import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata;
 import org.jboss.system.server.profileservice.repository.clustered.sync.InconsistentRepositoryStructureException;
 import org.jboss.virtual.VirtualFile;
 
 /**
+ * Handles intra-cluster operations for a clustered DeploymentRepository.
+ * 
  * @author Brian Stansberry
- *
+ * 
+ * @version $Revision: $
  */
 public interface RepositoryClusteringHandler
 {
+   /** Gets the key identifying the Profile this handler is meant for */
    ProfileKey getProfileKey();
+   /** Gets the name of the cluster partition this hander is associated with */
    String getPartitionName();
+   /** Gets the unique id for this node within the cluster partition */
    String getLocalNodeName();
    
+   /** 
+    * Gets whether this handler allows a node to push content changes to the
+    * cluster. If <code>true</code>, what changes will be accepted are an
+    * implementation detail.
+    * 
+    * @return <code>true</code> if content changes are <strong>not</strong> allowed; 
+    *         <code>false</code> otherwise
+    */
    boolean isImmutable();
+   
+   /** 
+    * Sets whether this handler allows a node to push content changes to the
+    * cluster. If <code>true</code>, what changes will be accepted are an
+    * implementation detail.
+    * 
+    * @param immutable <code>true</code> if content changes are <strong>not</strong> allowed; 
+    *         <code>false</code> otherwise
+    */
    void setImmutable(boolean immutable);
    
-   void initialize(LocalContentManager<?> persister) throws Exception;
+   /**
+    * Handler should prepare itself for operation.
+    * 
+    * @param localContentManager object that handles repository content locally
+    * 
+    * @throws Exception
+    */
+   void initialize(LocalContentManager<?> localContentManager) throws Exception;
+   
+   /**
+    * Notification that handler can perform clean up work as it will not 
+    * be asked to coordinate further with the cluster.
+    * 
+    * @throws Exception
+    */
    void shutdown() throws Exception;
+   
+   /**
+    * Acquire a cluster-wide lock for this repository. Must not be invoked
+    * if a {@link #lockLocally() local lock} is already held.
+    * 
+    * @return <code>true</code> if the lock was acquired, <code>false</code>
+    *         if not
+    */
    boolean lockGlobally();
+   
+   /**
+    * Acquire a local-only lock for this repository. Will not be granted if
+    * a node already owns a {@link #lockGlobally() cluster-wide lock}.
+    * 
+    * @return <code>true</code> if the lock was acquired, <code>false</code>
+    *         if not
+    */
    boolean lockLocally();
+   
+   /**
+    * Release a cluster-wide lock obtained in {@link #lockGlobally()}.
+    */
+   void unlockGlobally();
+   
+   /**
+    * Release a local lock obtained in {@link #lockLocally()}.
+    */
+   void unlockLocally();
+   
+   /**
+    * Synchronize this node's repository content with the rest of the cluster.
+    * This would typically involve a scan of repository content with any
+    * detected changes being propagated to the cluster.
+    * 
+    * @param pullFromCluster <code>true</code> if the synchronization should
+    *                        include pulling in changes from the cluster, e.g.
+    *                        as part of the startup of a node or during a merge
+    *                        following the healing of a cluster split;
+    *                        <code>false</code> if the synchronization should
+    *                        only consist of pushing local modifications to
+    *                        the cluster, e.g. as part of a hot deployment scan
+    *                        
+    * @return metadata describing the local repository content after the
+    *         synchronization
+    *         
+    * @throws InconsistentRepositoryStructureException 
+    * @throws IOException
+    */
    RepositoryContentMetadata synchronizeContent(boolean pullFromCluster) 
          throws InconsistentRepositoryStructureException, IOException;
-   VirtualFile addDeploymentContent(String vfsPath, InputStream contentIS) throws IOException;
+   
+   /**
+    * Read the content from the given input stream and add it to the repository
+    * across the cluster. This is used as part of processing of programmatic
+    * changes to the repository content, as opposed to asking the
+    * handler to deal with changes made manually.
+    * 
+    * @param vfsPath path describing where the content should be located in
+    *                the repository
+    * 
+    * @param contentIS input stream from which the content can be read
+    * 
+    * @return metadata describing the new content
+    * 
+    * @throws IOException
+    */
+   RepositoryItemMetadata addDeploymentContent(String vfsPath, InputStream contentIS) throws IOException;
+   
+   /**
+    * Remove content from the repository across the cluster. This is used as part of processing of programmatic
+    * changes to the repository content, as opposed to asking the
+    * handler to deal with changes made manually.
+    * 
+    * @param vf VirtualFile that contains the content
+    * 
+    * @throws Exception
+    */
    void removeDeploymentContent(VirtualFile vf) throws Exception;
-   void unlockGlobally();
-   void unlockLocally();
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/AbstractLocalContentManager.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/AbstractLocalContentManager.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/AbstractLocalContentManager.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -171,60 +171,57 @@
    {
       synchronized (this)
       {
-         if (this.currentContentMetadata == null)
+         RepositoryContentMetadata md = new RepositoryContentMetadata(profileKey);
+         List<RepositoryRootMetadata> roots = new ArrayList<RepositoryRootMetadata>();
+         RepositoryContentMetadata official = getOfficialContentMetadata();
+         for (Map.Entry<String, URI> entry : namedURIMap.entrySet())
          {
-            RepositoryContentMetadata md = new RepositoryContentMetadata(profileKey);
-            List<RepositoryRootMetadata> roots = new ArrayList<RepositoryRootMetadata>();
-            RepositoryContentMetadata official = getOfficialContentMetadata();
-            for (Map.Entry<String, URI> entry : namedURIMap.entrySet())
+            RepositoryRootMetadata rmd = new RepositoryRootMetadata();
+            rmd.setName(entry.getKey());
+            RepositoryRootMetadata existingRmd = official == null ? null : official.getRepositoryRootMetadata(entry.getKey());
+            
+            VirtualFile root = getCachedVirtualFile(entry.getValue());         
+            if (isDirectory(root))
             {
-               RepositoryRootMetadata rmd = new RepositoryRootMetadata();
-               rmd.setName(entry.getKey());
-               RepositoryRootMetadata existingRmd = official == null ? null : official.getRepositoryRootMetadata(entry.getKey());
-               
-               VirtualFile root = getCachedVirtualFile(entry.getValue());         
-               if (isDirectory(root))
+               for(VirtualFile child: root.getChildren())
                {
-                  for(VirtualFile child: root.getChildren())
-                  {
-                     createItemMetadataFromScan(rmd, existingRmd, child, root);
-                  }
+                  createItemMetadataFromScan(rmd, existingRmd, child, root);
                }
-               else
-               {
-                  // The root is itself an item. Treat it as a "child" of
-                  // itself with no relative path
-                  createItemMetadataFromScan(rmd, existingRmd, root, root);
-               }
-               
-               roots.add(rmd);
             }
-            md.setRepositories(roots);
+            else
+            {
+               // The root is itself an item. Treat it as a "child" of
+               // itself with no relative path
+               createItemMetadataFromScan(rmd, existingRmd, root, root);
+            }
             
-            // Retain any existing "removed item" metadata -- but only if
-            // it wasn't re-added!!
-            RepositoryContentMetadata existing = getOfficialContentMetadata();
-            if (existing != null)
+            roots.add(rmd);
+         }
+         md.setRepositories(roots);
+         
+         // Retain any existing "removed item" metadata -- but only if
+         // it wasn't re-added!!
+         RepositoryContentMetadata existing = getOfficialContentMetadata();
+         if (existing != null)
+         {
+            for (RepositoryRootMetadata existingRoot : existing.getRepositories())
             {
-               for (RepositoryRootMetadata existingRoot : existing.getRepositories())
+               RepositoryRootMetadata rmd = md.getRepositoryRootMetadata(existingRoot.getName());
+               if (rmd != null)
                {
-                  RepositoryRootMetadata rmd = md.getRepositoryRootMetadata(existingRoot.getName());
-                  if (rmd != null)
+                  for (RepositoryItemMetadata existingItem : existingRoot.getContent())
                   {
-                     for (RepositoryItemMetadata existingItem : existingRoot.getContent())
+                     if (existingItem.isRemoved() // but check for re-add 
+                           && rmd.getItemMetadata(existingItem.getRelativePathElements()) == null)
                      {
-                        if (existingItem.isRemoved() // but check for re-add 
-                              && rmd.getItemMetadata(existingItem.getRelativePathElements()) == null)
-                        {
-                           rmd.addItemMetadata(new RepositoryItemMetadata(existingItem));
-                        }
+                        rmd.addItemMetadata(new RepositoryItemMetadata(existingItem));
                      }
                   }
                }
             }
-            
-            this.currentContentMetadata = md;
          }
+         
+         this.currentContentMetadata = md;
          return this.currentContentMetadata;
       }
    }
@@ -316,10 +313,20 @@
       for (TwoPhaseCommitAction<T> action : this.currentSynchronizationActions)
       {
          if (action.prepare() == false)
-         {
+         {            
+            if (log.isTraceEnabled())
+            {
+               ContentModification mod = action.getRepositoryContentModification();
+               log.trace("prepare failed for " + mod.getType() + " " + mod.getItem().getRelativePath());
+            }
             return false;
          }
       }
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("prepared synchronization " + id);
+      }
       return true;
    }
    
@@ -336,6 +343,11 @@
          this.currentSynchronizationActions = null;
          this.currentSynchronizationActionContext = null;
       }
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("committed synchronization " + id);
+      }
    }
 
    public void rollbackSynchronization(SynchronizationId<?> id)
@@ -351,6 +363,11 @@
          this.currentSynchronizationActionContext = null;
          this.currentSynchronizationActions = null;
       }
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("rolled back synchronization " + id);
+      }
    }
    
    public void installCurrentContentMetadata()
@@ -726,7 +743,16 @@
             log.error("Caught exception persisting " + RepositoryContentMetadata.class.getSimpleName(), e);
          }
          this.officialContentMetadata = newOfficial;
+         
+         if (log.isTraceEnabled())
+         {
+            log.trace("updateContentMetadata(): updated official metadata");
+         }
       }
+      else if (log.isTraceEnabled())
+      {
+         log.trace("updateContentMetadata(): content is unchanged");
+      }
       this.currentContentMetadata = null;
    }
    

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/AbstractLocalContentChangeAction.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -57,7 +57,11 @@
    @Override
    protected void doComplete() throws Exception
    {
-      // no-op
+      if (getLogger().isTraceEnabled())
+      {
+         ContentModification mod = getRepositoryContentModification();
+         getLogger().trace("doComplete(): " + mod.getType() + " for " + mod.getItem().getRelativePath());
+      }
    }
 
    @Override
@@ -84,7 +88,15 @@
             }
          }
          
-         return modifyTarget();
+         boolean result = modifyTarget();
+         if (getLogger().isTraceEnabled())
+         {
+            ContentModification mod = getRepositoryContentModification();
+            getLogger().trace("doPrepare(): modifyTarget result for " + 
+                  mod.getType() + " for " + mod.getItem().getRelativePath() + 
+                  " is " + result);
+         }
+         return result;
       }
       catch (Exception e)
       {

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/local/file/FileReadAction.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -107,6 +107,11 @@
    protected void doComplete() throws Exception
    {
       safeCloseStream();
+      if (log.isTraceEnabled())
+      {
+         ContentModification mod = getRepositoryContentModification();
+         log.trace("doComplete(): " + mod.getType() + " for " + mod.getItem().getRelativePath());
+      }
    }
 
    @Override

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryItemMetadata.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -308,7 +308,7 @@
             }
             else
             {
-               result = -1;
+               result = o.relativePath == null ? 0 : -1;
             }
          }
          
@@ -316,6 +316,28 @@
          {
             result = (int) (this.timestamp - o.timestamp);
          }
+         
+         if (result == 0 && this.directory != o.directory)
+         {
+            result = this.directory ? 1 : -1;
+         }
+         
+         if (result == 0 && this.removed != o.removed)
+         {
+            result = this.removed ? 1 : -1;
+         }
+         
+         if (result == 0)
+         {
+            if (this.originatingNode != null)
+            {
+               result = o.originatingNode == null ? -1 : this.originatingNode.compareTo(o.originatingNode);
+            }
+            else
+            {
+               result = o.originatingNode == null ? 0 : 1;
+            }
+         }
       }
       return result;
    }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryRootMetadata.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryRootMetadata.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/metadata/RepositoryRootMetadata.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -29,6 +29,7 @@
 
 import javax.xml.bind.annotation.XmlAttribute;
 import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
 
 /**
  * Concise description of the contents under a single root URI in a
@@ -37,6 +38,7 @@
  * 
  * @author Brian Stansberry
  */
+ at XmlType(name="repositoryRootType", propOrder={"content", "name"})
 public class RepositoryRootMetadata  
    extends AbstractSortedMetadataContainer<List<String>, RepositoryItemMetadata>
    implements Identifiable<String>, Serializable, Comparable<RepositoryRootMetadata>

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/AbstractContentModificationGenerator.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/AbstractContentModificationGenerator.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/AbstractContentModificationGenerator.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -343,10 +343,13 @@
          {
             throw new IllegalStateException("prerejectedAddParent already set");
          }
-         else if (this.prerejectedRemoveParent != null)
-         {
-            throw new IllegalStateException("prerejectedRemoveParent already set");
-         }
+         // We allow removing content under something we've rejected
+         // This happens when RepositoryItemMetadata w/ removed=false needs
+         // to be pushed to a node
+//         else if (this.prerejectedRemoveParent != null)
+//         {
+//            throw new IllegalStateException("prerejectedRemoveParent already set");
+//         }
          
          ContentModification peeked = peekPreapprovedRemoveParent();
          if (peeked != null && toPush.getItem().isChildOf(peeked.getItem()) == false)

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/LocalContentModificationGenerator.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -22,6 +22,7 @@
 
 package org.jboss.system.server.profileservice.repository.clustered.sync;
 
+import org.jboss.logging.Logger;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata;
 import org.jboss.system.server.profileservice.repository.clustered.sync.ContentModification.Type;
 
@@ -43,7 +44,8 @@
  */
 public class LocalContentModificationGenerator extends AbstractContentModificationGenerator
 {
-
+   private static final Logger log = Logger.getLogger(LocalContentModificationGenerator.class);
+   
    @Override
    protected void handleAddition(String rootName, 
          RepositoryItemMetadata item, GeneratedModifications mods)
@@ -53,6 +55,11 @@
       drainPreapprovedRemovals(mods);
       Type type = item.isDirectory() ? Type.MKDIR_TO_CLUSTER : Type.PUSH_TO_CLUSTER;
       mods.addModification(new ContentModification(type, rootName, item));
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("created " + type + " modification for " + item.getRelativePath());
+      }
    }
 
 //   @Override
@@ -95,7 +102,12 @@
       // So, drain any remaining preapproved removals
       drainPreapprovedRemovals(mods);
       
-      mods.addModification(new ContentModification(Type.MKDIR_TO_CLUSTER, rootName, modified));      
+      mods.addModification(new ContentModification(Type.MKDIR_TO_CLUSTER, rootName, modified));  
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("created " + Type.MKDIR_TO_CLUSTER + " modification for " + modified.getRelativePath());
+      }    
    }
 
    @Override
@@ -119,8 +131,13 @@
       // on the stack to be inserted once all the child removals
       // are done.
       ContentModification mod = new ContentModification(Type.PUSH_TO_CLUSTER, rootName, modified);
-      mods.pushPreapprovedRemoveParent(mod);
+      mods.pushPreapprovedRemoveParent(mod); 
       
+      if (log.isTraceEnabled())
+      {
+         log.trace("created " + Type.PUSH_TO_CLUSTER + " modification for " + modified.getRelativePath());
+      }    
+      
    }
 
    @Override
@@ -131,7 +148,12 @@
       // So, drain any remaining preapproved removals
       drainPreapprovedRemovals(mods);
       
-      mods.addModification(new ContentModification(Type.DIR_TIMESTAMP_MISMATCH, rootName, base));      
+      mods.addModification(new ContentModification(Type.DIR_TIMESTAMP_MISMATCH, rootName, base));  
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("created " + Type.DIR_TIMESTAMP_MISMATCH + " modification for " + base.getRelativePath());
+      }         
    }
 
    @Override
@@ -142,7 +164,12 @@
       // So, drain any remaining preapproved removals
       drainPreapprovedRemovals(mods);
       
-      mods.addModification(new ContentModification(Type.PUSH_TO_CLUSTER, rootName, modified));
+      mods.addModification(new ContentModification(Type.PUSH_TO_CLUSTER, rootName, modified));  
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("created " + Type.PUSH_TO_CLUSTER + " modification for " + modified.getRelativePath());
+      }         
    }
 
    @Override
@@ -161,12 +188,22 @@
          mods.addModification(new ContentModification(Type.PREPARE_RMDIR_TO_CLUSTER, rootName, item));
          // Push the actual removal on the stack to execute when
          // children are done
-         mods.pushPreapprovedRemoveParent(removal);
+         mods.pushPreapprovedRemoveParent(removal);  
+         
+         if (log.isTraceEnabled())
+         {
+            log.trace("created " + Type.PREPARE_RMDIR_TO_CLUSTER + " modification for " + item.getRelativePath());
+         }         
       }
       else
       {
          mods.addModification(removal);
-      }
+      }  
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("created " + Type.REMOVE_TO_CLUSTER + " modification for " + item.getRelativePath());
+      }         
    }
 
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteContentModificationGenerator.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteContentModificationGenerator.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteContentModificationGenerator.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -104,14 +104,57 @@
    protected void handleMissing(String rootName, RepositoryItemMetadata item, 
          GeneratedModifications mods)
    {
-      if (item.isRemoved())
+      if (item.isRemoved() == false)
       {
-         // Remote node doesn't have file, just needs to add a missing RepositoryItemMetadata
-         handleRemovalMetadata(rootName, item, mods);
+         handleRemoval(rootName, item, mods);
       }
       else 
       {
-         handleRemoval(rootName, item, mods);
+         // Remote node doesn't have file, just needs to add a missing RepositoryItemMetadata
+
+         // This is a removal, so it can't be a child of an earlier attempted add.
+         // So, drain any remaining prerejected adds
+         drainPrerejectedAdds(mods);
+         // A removal negates any preapprovedAdd as well
+         mods.setPreapprovedAddParent(null);
+         
+         // 
+         RepositoryItemMetadata prerejectedRemove = mods.getPrerejectedRemoveParent();
+         if (prerejectedRemove != null && item.isChildOf(prerejectedRemove) == false)
+         {
+            mods.setPrerejectedRemoveParent(null);
+         }
+         
+         // Don't lose track of pre-approval stack if there is one
+         ContentModification preapprovedRemove = mods.peekPreapprovedRemoveParent();
+         while (preapprovedRemove != null)
+         {
+            if (item.isChildOf(preapprovedRemove.getItem()))
+            {
+               // we're at the right level
+               break;
+            }
+            else
+            {
+               // We're done with children of preapproved parent so add the cached
+               // modification to the overall list. This will cause it to
+               // get executed *after* its children 
+               // (i.e. remove parent after removing children)
+               mods.addModification(mods.popPreapprovedRemoveParent());
+               // Start checking grandparent
+               preapprovedRemove = mods.peekPreapprovedRemoveParent();
+            }
+         }
+         
+         ContentModification mod = new ContentModification(Type.REMOVAL_METADATA_FROM_CLUSTER, rootName, item);
+         if (item.isDirectory())
+         {
+            mods.pushPreapprovedRemoveParent(mod);
+         }
+         else
+         {
+            mods.addModification(mod);
+         }
       }
    }
    
@@ -275,46 +318,6 @@
       }
    }
    
-   private void handleRemovalMetadata(String rootName, 
-         RepositoryItemMetadata item, GeneratedModifications mods)
-   {
-      // This is a removal, so it can't be a child of an earlier attempted add.
-      // So, drain any remaining prerejected adds
-      drainPrerejectedAdds(mods);
-      mods.setPreapprovedAddParent(null);
-      
-      // Don't lose track of pre-approval stack if there is one
-      ContentModification preapprovedRemove = mods.peekPreapprovedRemoveParent();
-      while (preapprovedRemove != null)
-      {
-         if (item.isChildOf(preapprovedRemove.getItem()))
-         {
-            // we're at the right level
-            break;
-         }
-         else
-         {
-            // We're done with children of preapproved parent so add the cached
-            // modification to the overall list. This will cause it to
-            // get executed *after* its children 
-            // (i.e. remove parent after removing children)
-            mods.addModification(mods.popPreapprovedRemoveParent());
-            // Start checking grandparent
-            preapprovedRemove = mods.peekPreapprovedRemoveParent();
-         }
-      }
-      
-      ContentModification mod = new ContentModification(Type.REMOVAL_METADATA_FROM_CLUSTER, rootName, item);
-      if (item.isDirectory())
-      {
-         mods.pushPreapprovedRemoveParent(mod);
-      }
-      else
-      {
-         mods.addModification(mod);
-      }
-   }
-   
    @Override
    protected void handleRemoval(String rootName, RepositoryItemMetadata item, GeneratedModifications mods)
    {

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemoteRemovalAction.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -22,6 +22,7 @@
 
 package org.jboss.system.server.profileservice.repository.clustered.sync;
 
+import org.jboss.logging.Logger;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryRootMetadata;
 
@@ -36,6 +37,7 @@
 public class RemoteRemovalAction<T extends SynchronizationActionContext> 
    extends SimpleSynchronizationRemoteAction<T>
 {
+   private static final Logger log = Logger.getLogger(RemoteRemovalAction.class);
 
    public RemoteRemovalAction(T context, ContentModification modification)
    {
@@ -49,6 +51,12 @@
       RepositoryContentMetadata contentMetadata = getContext().getInProgressMetadata();
       RepositoryRootMetadata rmd = contentMetadata.getRepositoryRootMetadata(mod.getRootName());
       rmd.addItemMetadata(getMarkedRemovedItem(mod));
+      
+      if (log.isTraceEnabled())
+      {
+         log.trace("doCommit(): added removal metadata for " + mod.getType() + 
+               " for " + mod.getItem().getRelativePath());
+      }
    }
   
 }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/RemovalMetadataInsertionAction.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -22,6 +22,7 @@
 
 package org.jboss.system.server.profileservice.repository.clustered.sync;
 
+import org.jboss.logging.Logger;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryContentMetadata;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryItemMetadata;
 import org.jboss.system.server.profileservice.repository.clustered.metadata.RepositoryRootMetadata;
@@ -38,6 +39,8 @@
 public class RemovalMetadataInsertionAction<T extends SynchronizationActionContext> 
       extends NoOpSynchronizationAction<T>
 {
+   private static final Logger log = Logger.getLogger(RemovalMetadataInsertionAction.class);
+   
    private RepositoryItemMetadata replaced;
    
    /**
@@ -68,11 +71,17 @@
       if (rmd != null)
       {
          replaced = rmd.getItemMetadata(mod.getItem().getRelativePathElements());
-         if (replaced == null)
-         {
+         // BES 2009/04/20 I see no reason not to do this if replaced != null
+//         if (replaced == null)
+//         {
             rmd.addItemMetadata(mod.getItem());
             ok = true;
-         }
+//         }
+            
+            if (log.isTraceEnabled())
+            {
+               log.trace("added removal metadata for " + mod.getItem().getRelativePath());
+            }
       }
       return ok;
    }

Modified: trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/SynchronizationActionContext.java
===================================================================
--- trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/SynchronizationActionContext.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/system/src/main/org/jboss/system/server/profileservice/repository/clustered/sync/SynchronizationActionContext.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -49,7 +49,8 @@
          throw new IllegalArgumentException("Null inProgressMetadata");
       }
       this.id = id;
-      this.inProgressMetadata = inProgressMetadata;
+      // Defensive copy
+      this.inProgressMetadata = new RepositoryContentMetadata(inProgressMetadata);
    }
 
    public SynchronizationId<?> getId()

Modified: trunk/testsuite/imports/sections/cluster.xml
===================================================================
--- trunk/testsuite/imports/sections/cluster.xml	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/testsuite/imports/sections/cluster.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -65,6 +65,11 @@
          file="${build.resources}/cluster/profileservice/farm-addedcontent-service.xml"
          overwrite="true"/>
       
+      <!-- MBeans for testing Clustered DeploymentRepository additions -->
+      <copy todir="${build.lib}" overwrite="true">
+         <fileset dir="${build.resources}/cluster/farm/hotdeploy"/>
+      </copy>
+      
       <!-- MC beans for testing partition restart -->
       <copy todir="${build.lib}"
          file="${build.resources}/cluster/partition/partition-restart-jboss-beans.xml"
@@ -99,8 +104,8 @@
    	<copy todir="${build.lib}"
    	     file="${build.resources}/cluster/hasingleton/ha-singleton-jboss-beans.xml"
    	     overwrite="true"/>
-     
-    <!--beans for testing HAServiceUnitTestCase, HASingletonUnitTestCase -->
+      
+   	<!--beans for testing HAServiceUnitTestCase, HASingletonUnitTestCase -->
     <jar destfile="${build.lib}/ha-service.sar">
        <metainf dir="${build.resources}/cluster/haservice">
           <include name="*.xml"/>

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ReadWriteClusteredLockManagerUnitTestCase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ReadWriteClusteredLockManagerUnitTestCase.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/defaultcfg/test/ReadWriteClusteredLockManagerUnitTestCase.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -145,6 +145,22 @@
       verify(handler);      
    }
    
+   /**
+    * Test for handling concurrent calls to remoteLock when the lock
+    * is in UNLOCKED state. Calls should get passed to the local lock handler,
+    * which allows one to succeed and the other to throw a TimeoutException;
+    * testee should react correctly.
+    * 
+    * FIXME We are using a MockObject for the LocalLockHandler impl, and with
+    * that approach we can't really get concurrent calls to it. Effect is 
+    * sometimes the thread that acquires the lock has already done so before
+    * the other thread even invokes remoteLock, defeating the purpose of this
+    * test and turning it into a variant of testContestedRemoteLock. Need to redo
+    * this test with a true multithreaded local lock handler, updating the latches
+    * such that both threads are in BlockingAnswer.answer at the same time.
+    * 
+    * @throws Exception
+    */   
    public void testConcurrentRemoteLock() throws Exception
    { 
       TesteeSet<NonGloballyExclusiveClusterLockSupport> testeeSet = getTesteeSet(node1, 1, 3);
@@ -169,7 +185,13 @@
       handler.lockFromCluster("test", caller1, 1000);
       expectLastCall().andAnswer(caller1Answer); 
       handler.lockFromCluster("test", caller2, 1000); 
-      expectLastCall().andAnswer(caller2Answer);    
+
+      
+      // There is a race where t1 may have already marked the lock as LOCKED in 
+      // which case t2 will not call handler.lockFromCluster("test", caller2, 1000);
+      // See FIXME in method javadoc. So, we use times(0, 1) to specify no
+      // calls are OK
+      expectLastCall().andAnswer(caller2Answer).times(0, 1);    
       replay(handler);
       
       CountDownLatch startLatch1 = new CountDownLatch(1);
@@ -209,8 +231,11 @@
          assertEquals(RemoteLockResponse.Flag.OK, rsp.flag);
          assertNull(rsp.holder);
          
-         rsp = loser.getResult();         
-         assertEquals(RemoteLockResponse.Flag.FAIL, rsp.flag);
+         rsp = loser.getResult();     
+         if (rsp.flag != RemoteLockResponse.Flag.REJECT)
+         {
+            assertEquals(RemoteLockResponse.Flag.FAIL, rsp.flag);
+         }
          assertEquals(caller1, rsp.holder);
       }
       finally

Modified: trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java	2009-05-01 20:10:48 UTC (rev 88109)
+++ trunk/testsuite/src/main/org/jboss/test/cluster/lock/ClusteredLockManagerTestBase.java	2009-05-01 21:41:24 UTC (rev 88110)
@@ -34,7 +34,6 @@
 import org.jboss.ha.framework.interfaces.HAPartition;
 import org.jboss.ha.framework.server.ClusterNodeImpl;
 import org.jboss.ha.framework.server.lock.AbstractClusterLockSupport;
-import org.jboss.ha.framework.server.lock.YieldingGloballyExclusiveClusterLockSupport;
 import org.jboss.ha.framework.server.lock.LocalLockHandler;
 import org.jboss.ha.framework.server.lock.RemoteLockResponse;
 import org.jboss.ha.framework.server.lock.AbstractClusterLockSupport.RpcTarget;
@@ -123,21 +122,21 @@
       
       try
       {
-         new YieldingGloballyExclusiveClusterLockSupport(null, haPartition, handler);
+         createClusteredLockManager(null, haPartition, handler);
          fail("Null serviceHAName should prevent construction");
       }
       catch (IllegalArgumentException good) {}
       
       try
       {
-         new YieldingGloballyExclusiveClusterLockSupport("test", null, handler);
+         createClusteredLockManager("test", null, handler);
          fail("Null HAPartition should prevent construction");
       }
       catch (IllegalArgumentException good) {}     
       
       try
       {
-         new YieldingGloballyExclusiveClusterLockSupport("test", haPartition, null);
+         createClusteredLockManager("test", haPartition, null);
          fail("Null LocalLockHandler should prevent construction");
       }
       catch (IllegalArgumentException good) {}  
@@ -148,7 +147,7 @@
       replay(haPartition);
       replay(handler);
       
-      YieldingGloballyExclusiveClusterLockSupport testee = new YieldingGloballyExclusiveClusterLockSupport("test", haPartition, handler);
+      T testee = createClusteredLockManager("test", haPartition, handler);
       
       assertEquals("test", testee.getServiceHAName());
       assertEquals("TestPartition", testee.getPartitionName());
@@ -164,7 +163,7 @@
       replay(haPartition);
       replay(handler);      
       
-      YieldingGloballyExclusiveClusterLockSupport testee = new YieldingGloballyExclusiveClusterLockSupport("test", haPartition, handler);
+      T testee = createClusteredLockManager("test", haPartition, handler);
       
       try
       {
@@ -306,7 +305,7 @@
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andReturn(rspList);
       
       handler.lockFromCluster(eq("test"), eq(node1), anyLong());
@@ -341,7 +340,7 @@
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andReturn(rspList).atLeastOnce();
       
       replay(partition);
@@ -374,7 +373,7 @@
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andReturn(rspList);
 
       
@@ -391,7 +390,7 @@
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andReturn(rspList);
       
       handler.lockFromCluster(eq("test"), eq(node1), anyLong());      
@@ -429,21 +428,21 @@
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andReturn(rspList);
       
       // When caller 1 invokes, block before giving response 
       CountDownLatch answerAwaitLatch = new CountDownLatch(1);
       CountDownLatch answerStartLatch = new CountDownLatch(1);
       CountDownLatch answerDoneLatch = new CountDownLatch(1);
-      BlockingAnswer<Boolean> caller1Answer = new BlockingAnswer<Boolean>(Boolean.TRUE, answerAwaitLatch, answerStartLatch, answerDoneLatch);
+      BlockingAnswer<Boolean> caller1Answer = new BlockingAnswer<Boolean>(Boolean.TRUE, answerAwaitLatch, answerStartLatch, null);
       handler.lockFromCluster(eq("test"), eq(node1), anyLong());
       expectLastCall().andAnswer(caller1Answer);
       
       replay(partition);
       replay(handler);
       
-      LocalLockCaller winner = new LocalLockCaller(testee, null, null, null);
+      LocalLockCaller winner = new LocalLockCaller(testee, null, null, answerDoneLatch, 500);
       
       Thread t1 = new Thread(winner);
       t1.setDaemon(true);
@@ -462,7 +461,7 @@
          answerAwaitLatch.countDown();
          
          // wait for t1 to complete
-         assertTrue(answerDoneLatch.await(2, TimeUnit.SECONDS));
+         assertTrue(answerDoneLatch.await(5, TimeUnit.SECONDS));
          
          verify(handler);
          
@@ -507,7 +506,7 @@
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andAnswer(caller1Answer).atLeastOnce();
       
       handler.lockFromCluster(eq("test"), eq(superiorCaller), anyLong());   
@@ -540,7 +539,7 @@
          answerAwaitLatch.countDown();
          
          // wait for t1 to complete
-         assertTrue(finishedLatch.await(1, TimeUnit.SECONDS));
+         assertTrue(finishedLatch.await(5, TimeUnit.SECONDS));
          
          verify(handler);
          
@@ -564,8 +563,11 @@
       LocalLockHandler handler = testee.getLocalHandler();
       final RpcTarget target = testeeSet.target;
       
-      ClusterNode inferiorCaller = testee.getCurrentView().get(2);
-      assertFalse(node1.equals(inferiorCaller));
+      ClusterNode inferiorNode = testee.getCurrentView().get(2);
+      assertFalse(node1.equals(inferiorNode));
+      
+      ClusterNode superiorNode = testee.getCurrentView().get(0);
+      assertFalse(node1.equals(superiorNode));
 
       resetToStrict(partition);    
       makeThreadSafe(partition, true);
@@ -577,15 +579,16 @@
       CountDownLatch answerStartLatch = new CountDownLatch(1);
       
       ArrayList<RemoteLockResponse> rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.REJECT, inferiorCaller));
+      rspList.add(new RemoteLockResponse(superiorNode, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(inferiorNode, RemoteLockResponse.Flag.REJECT, inferiorNode));
       
-      BlockingAnswer<ArrayList<RemoteLockResponse>> caller1Answer = new BlockingAnswer<ArrayList<RemoteLockResponse>>(rspList, answerAwaitLatch, answerStartLatch, null);
+      BlockingAnswer<ArrayList<RemoteLockResponse>> caller1Answer = 
+         new BlockingAnswer<ArrayList<RemoteLockResponse>>(rspList, answerAwaitLatch, answerStartLatch, null);
       
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andAnswer(caller1Answer);  
       
       expect(partition.callMethodOnCluster(eq("test"), 
@@ -595,13 +598,13 @@
             eq(true))).andReturn(new ArrayList<Object>()); 
       
       rspList = new ArrayList<RemoteLockResponse>();
-      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
-      rspList.add(new RemoteLockResponse(null, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(superiorNode, RemoteLockResponse.Flag.OK));
+      rspList.add(new RemoteLockResponse(inferiorNode, RemoteLockResponse.Flag.OK));
       
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andReturn(rspList);  
       
       handler.lockFromCluster(eq("test"), eq(node1), anyLong());
@@ -610,9 +613,9 @@
       replay(handler);
 
       CountDownLatch finishedLatch = new CountDownLatch(1);
-      LocalLockCaller loser = new LocalLockCaller(testee, null, null, finishedLatch);
+      LocalLockCaller winner = new LocalLockCaller(testee, null, null, finishedLatch);
       
-      Thread t1 = new Thread(loser);
+      Thread t1 = new Thread(winner);
       t1.setDaemon(true);
       
       try
@@ -621,7 +624,7 @@
          assertTrue(answerStartLatch.await(1, TimeUnit.SECONDS));
          // t1 should now be blocking in caller1Answer
          
-         RemoteLockResponse rsp = target.remoteLock("test", inferiorCaller, 1);
+         RemoteLockResponse rsp = target.remoteLock("test", inferiorNode, 1);
          assertEquals(RemoteLockResponse.Flag.REJECT, rsp.flag);
          assertEquals(node1, rsp.holder);
          
@@ -629,13 +632,13 @@
          answerAwaitLatch.countDown();
          
          // wait for t1 to complete
-         assertTrue(finishedLatch.await(1, TimeUnit.SECONDS));
+         assertTrue(finishedLatch.await(5, TimeUnit.SECONDS));
          
          verify(handler);
          
-         rethrow("winner had an exception", loser.getException());
+         rethrow("winner had an exception", winner.getException());
          
-         Boolean locked = loser.getResult();         
+         Boolean locked = winner.getResult();         
          assertEquals(Boolean.TRUE, locked);
       }
       finally
@@ -668,7 +671,7 @@
       expect(partition.callMethodOnCluster(eq("test"), 
                                            eq("remoteLock"), 
                                            eqLockParams(node1, 200000), 
-                                           aryEq(YieldingGloballyExclusiveClusterLockSupport.REMOTE_LOCK_TYPES), 
+                                           aryEq(AbstractClusterLockSupport.REMOTE_LOCK_TYPES), 
                                            eq(true))).andReturn(rspList);
       
       handler.lockFromCluster(eq("test"), eq(node1), anyLong());
@@ -910,17 +913,25 @@
    protected class LocalLockCaller extends AbstractCaller<Boolean>
    {
       private final AbstractClusterLockSupport target;
+      private final long timeout;
       
       public LocalLockCaller(AbstractClusterLockSupport target, CountDownLatch startLatch, 
             CountDownLatch proceedLatch, CountDownLatch finishLatch)
       {
+         this(target, startLatch, proceedLatch, finishLatch, 3000);
+      }
+      
+      public LocalLockCaller(AbstractClusterLockSupport target, CountDownLatch startLatch, 
+            CountDownLatch proceedLatch, CountDownLatch finishLatch, long timeout)
+      {
          super(startLatch, proceedLatch, finishLatch);
          this.target = target;
+         this.timeout = timeout;
       }
       
       protected Boolean execute()
       {         
-         return Boolean.valueOf(target.lock("test", 20));
+         return Boolean.valueOf(target.lock("test", timeout));
       }
    }
 

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-mod-deployment-service.xml (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-mod-deployment-service.xml)
===================================================================
--- trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-mod-deployment-service.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-mod-deployment-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=HDModifyTestThreadPool">
+      <attribute name="Name">UnmodifiedFarmThreadPool</attribute>
+      <attribute name="ThreadGroupName">ModifyFarmThreads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">1000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">1</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">10</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">abort</attribute>
+   </mbean>
+
+</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd)

Deleted: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml	2009-05-01 18:10:38 UTC (rev 88106)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
-
-   <!-- A Thread pool service -->
-   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
-      name="jboss.system:service=HDMarkerTestThreadPool">
-      <attribute name="Name">MarkerFarmThreadPool</attribute>
-      <attribute name="ThreadGroupName">MarkerFarmThreads</attribute>
-      <!-- How long a thread will live without any tasks in MS -->
-      <attribute name="KeepAliveTime">1000</attribute>
-      <!-- The max number of threads in the pool -->
-      <attribute name="MaximumPoolSize">1</attribute>
-      <!-- The max number of tasks before the queue is full -->
-      <attribute name="MaximumQueueSize">10</attribute>
-      <!-- The behavior of the pool when a task is added and the queue is full.
-      abort - a RuntimeException is thrown
-      run - the calling thread executes the task
-      wait - the calling thread blocks until the queue has room
-      discard - the task is silently discarded without being run
-      discardOldest - check to see if a task is about to complete and enque
-         the new task if possible, else run the task in the calling thread
-      -->
-      <attribute name="BlockingMode">abort</attribute>
-   </mbean>
-
-</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml)
===================================================================
--- trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedAdd/hd-marker-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=HDMarkerTestThreadPool">
+      <attribute name="Name">MarkerFarmThreadPool</attribute>
+      <attribute name="ThreadGroupName">MarkerFarmThreads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">1000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">1</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">10</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">abort</attribute>
+   </mbean>
+
+</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar)

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF)

Deleted: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml	2009-05-01 18:10:38 UTC (rev 88106)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
-
-   <!-- A Thread pool service -->
-   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
-      name="jboss.system:service=HDModifyNestedTestThreadPool">
-      <attribute name="Name">UnmodifiedNestedFarmThreadPool</attribute>
-      <attribute name="ThreadGroupName">ModifyNestedFarmThreads</attribute>
-      <!-- How long a thread will live without any tasks in MS -->
-      <attribute name="KeepAliveTime">1000</attribute>
-      <!-- The max number of threads in the pool -->
-      <attribute name="MaximumPoolSize">1</attribute>
-      <!-- The max number of tasks before the queue is full -->
-      <attribute name="MaximumQueueSize">10</attribute>
-      <!-- The behavior of the pool when a task is added and the queue is full.
-      abort - a RuntimeException is thrown
-      run - the calling thread executes the task
-      wait - the calling thread blocks until the queue has room
-      discard - the task is silently discarded without being run
-      discardOldest - check to see if a task is about to complete and enque
-         the new task if possible, else run the task in the calling thread
-      -->
-      <attribute name="BlockingMode">abort</attribute>
-   </mbean>
-
-</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml)
===================================================================
--- trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedMod.sar/META-INF/jboss-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=HDModifyNestedTestThreadPool">
+      <attribute name="Name">UnmodifiedNestedFarmThreadPool</attribute>
+      <attribute name="ThreadGroupName">ModifyNestedFarmThreads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">1000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">1</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">10</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">abort</attribute>
+   </mbean>
+
+</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove)

Deleted: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml	2009-05-01 18:10:38 UTC (rev 88106)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
-
-   <!-- A Thread pool service -->
-   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
-      name="jboss.system:service=HDNestedRemoveTestThreadPool">
-      <attribute name="Name">NestedRemoveFarmThreadPool</attribute>
-      <attribute name="ThreadGroupName">NestedRemoveFarmThreads</attribute>
-      <!-- How long a thread will live without any tasks in MS -->
-      <attribute name="KeepAliveTime">1000</attribute>
-      <!-- The max number of threads in the pool -->
-      <attribute name="MaximumPoolSize">1</attribute>
-      <!-- The max number of tasks before the queue is full -->
-      <attribute name="MaximumQueueSize">10</attribute>
-      <!-- The behavior of the pool when a task is added and the queue is full.
-      abort - a RuntimeException is thrown
-      run - the calling thread executes the task
-      wait - the calling thread blocks until the queue has room
-      discard - the task is silently discarded without being run
-      discardOldest - check to see if a task is about to complete and enque
-         the new task if possible, else run the task in the calling thread
-      -->
-      <attribute name="BlockingMode">abort</attribute>
-   </mbean>
-
-</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml)
===================================================================
--- trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-nestedRemove/hd-nested-remove-deployment-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=HDNestedRemoveTestThreadPool">
+      <attribute name="Name">NestedRemoveFarmThreadPool</attribute>
+      <attribute name="ThreadGroupName">NestedRemoveFarmThreads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">1000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">1</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">10</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">abort</attribute>
+   </mbean>
+
+</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-remove-deployment-service.xml (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-remove-deployment-service.xml)
===================================================================
--- trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-remove-deployment-service.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-remove-deployment-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=HDRemoveTestThreadPool">
+      <attribute name="Name">RemoveFarmThreadPool</attribute>
+      <attribute name="ThreadGroupName">RemoveFarmThreads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">1000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">1</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">10</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">abort</attribute>
+   </mbean>
+
+</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir)

Deleted: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml
===================================================================
--- branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml	2009-05-01 18:10:38 UTC (rev 88106)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<server>
-
-   <!-- A Thread pool service -->
-   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
-      name="jboss.system:service=HDRemoveDirFarmTestThreadPool">
-      <attribute name="Name">RemoveDirFarmThreadPool</attribute>
-      <attribute name="ThreadGroupName">RemoveDirFarmThreads</attribute>
-      <!-- How long a thread will live without any tasks in MS -->
-      <attribute name="KeepAliveTime">1000</attribute>
-      <!-- The max number of threads in the pool -->
-      <attribute name="MaximumPoolSize">1</attribute>
-      <!-- The max number of tasks before the queue is full -->
-      <attribute name="MaximumQueueSize">10</attribute>
-      <!-- The behavior of the pool when a task is added and the queue is full.
-      abort - a RuntimeException is thrown
-      run - the calling thread executes the task
-      wait - the calling thread blocks until the queue has room
-      discard - the task is silently discarded without being run
-      discardOldest - check to see if a task is about to complete and enque
-         the new task if possible, else run the task in the calling thread
-      -->
-      <attribute name="BlockingMode">abort</attribute>
-   </mbean>
-
-</server>

Copied: trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml (from rev 88106, branches/Branch_5_x/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml)
===================================================================
--- trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/test-configs/cluster-profilesvc-0/farm/hd-removeDir/hd-remove-dir-deployment-service.xml	2009-05-01 21:41:24 UTC (rev 88110)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<server>
+
+   <!-- A Thread pool service -->
+   <mbean code="org.jboss.util.threadpool.BasicThreadPool"
+      name="jboss.system:service=HDRemoveDirFarmTestThreadPool">
+      <attribute name="Name">RemoveDirFarmThreadPool</attribute>
+      <attribute name="ThreadGroupName">RemoveDirFarmThreads</attribute>
+      <!-- How long a thread will live without any tasks in MS -->
+      <attribute name="KeepAliveTime">1000</attribute>
+      <!-- The max number of threads in the pool -->
+      <attribute name="MaximumPoolSize">1</attribute>
+      <!-- The max number of tasks before the queue is full -->
+      <attribute name="MaximumQueueSize">10</attribute>
+      <!-- The behavior of the pool when a task is added and the queue is full.
+      abort - a RuntimeException is thrown
+      run - the calling thread executes the task
+      wait - the calling thread blocks until the queue has room
+      discard - the task is silently discarded without being run
+      discardOldest - check to see if a task is about to complete and enque
+         the new task if possible, else run the task in the calling thread
+      -->
+      <attribute name="BlockingMode">abort</attribute>
+   </mbean>
+
+</server>




More information about the jboss-cvs-commits mailing list