[jboss-cvs] JBossAS SVN: r83701 - in branches/Branch_5_0: cluster/src/main/org/jboss/ha/singleton and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 30 13:12:55 EST 2009


Author: bstansberry at jboss.com
Date: 2009-01-30 13:12:54 -0500 (Fri, 30 Jan 2009)
New Revision: 83701

Modified:
   branches/Branch_5_0/cluster/src/etc/deploy-hasingleton-jboss-beans.xml
   branches/Branch_5_0/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java
   branches/Branch_5_0/testsuite/src/resources/cluster/hasingleton/deployer/test-deploy-hasingleton-jboss-beans.xml
Log:
[JBAS-6440] Dependency inject the DeploymentManager
[JBAS-6441] Handle no-content case

Modified: branches/Branch_5_0/cluster/src/etc/deploy-hasingleton-jboss-beans.xml
===================================================================
--- branches/Branch_5_0/cluster/src/etc/deploy-hasingleton-jboss-beans.xml	2009-01-30 18:12:16 UTC (rev 83700)
+++ branches/Branch_5_0/cluster/src/etc/deploy-hasingleton-jboss-beans.xml	2009-01-30 18:12:54 UTC (rev 83701)
@@ -20,7 +20,7 @@
          
       <property name="profileService"><inject bean="ProfileService"/></property>
       <property name="filterInstance"><inject bean="DeploymentFilter"/></property>
-      <property name="mainDeployer"><inject bean="MainDeployer"/></property>
+      <property name="deploymentManager"><inject bean="DeploymentManager"/></property>
    </bean>
  
    <!--

Modified: branches/Branch_5_0/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java
===================================================================
--- branches/Branch_5_0/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java	2009-01-30 18:12:16 UTC (rev 83700)
+++ branches/Branch_5_0/cluster/src/main/org/jboss/ha/singleton/HASingletonDeploymentScanner.java	2009-01-30 18:12:54 UTC (rev 83701)
@@ -85,16 +85,32 @@
       super.setProfileService(profileService);
       if (profileService != null)
       {
-         this.deploymentManager = profileService.getDeploymentManager();
+         // In case someone forgot to dependency inject DeploymentManager
+         // AND we're lucky enough that the DeploymentManager is already
+         // installed into the ProfileService
+         if (this.deploymentManager == null)
+         {
+            this.deploymentManager = profileService.getDeploymentManager();
+         }
       }
       else
       {
          this.deploymentManager = null;
       }
    }
+   
+   public DeploymentManager getDeploymentManager()
+   {
+      return deploymentManager;
+   }
 
+   public void setDeploymentManager(DeploymentManager deploymentManager)
+   {
+      this.deploymentManager = deploymentManager;
+   }
+
    // -----------------------------------------------------------------  Public
-   
+
    /**
     * Deploy the content under the given URIs. Called by the 
     * HASingletonController when we become the singleton master.
@@ -130,8 +146,11 @@
          else
          {
             String[] allUploaded = getAllUploadedNames();
-            DeploymentProgress progress = this.deploymentManager.start(DEPLOYMENT_PHASE, allUploaded);
-            progress.run();
+            if (allUploaded.length > 0) // JBAS-6441
+            {
+               DeploymentProgress progress = this.deploymentManager.start(DEPLOYMENT_PHASE, allUploaded);
+               progress.run();
+            }
          }
          
          this.deployed = true;
@@ -176,10 +195,13 @@
             
             this.uploadedNames.clear();
             
-            DeploymentProgress progress = this.deploymentManager.stop(DEPLOYMENT_PHASE, allUploaded);
-            progress.run();
-            progress = this.deploymentManager.undeploy(DEPLOYMENT_PHASE, allUploaded);
-            progress.run();
+            if (allUploaded.length > 0) // JBAS-6441
+            {
+               DeploymentProgress progress = this.deploymentManager.stop(DEPLOYMENT_PHASE, allUploaded);
+               progress.run();
+               progress = this.deploymentManager.undeploy(DEPLOYMENT_PHASE, allUploaded);
+               progress.run();
+            }
          }
          
          this.deployed = false;

Modified: branches/Branch_5_0/testsuite/src/resources/cluster/hasingleton/deployer/test-deploy-hasingleton-jboss-beans.xml
===================================================================
--- branches/Branch_5_0/testsuite/src/resources/cluster/hasingleton/deployer/test-deploy-hasingleton-jboss-beans.xml	2009-01-30 18:12:16 UTC (rev 83700)
+++ branches/Branch_5_0/testsuite/src/resources/cluster/hasingleton/deployer/test-deploy-hasingleton-jboss-beans.xml	2009-01-30 18:12:54 UTC (rev 83701)
@@ -14,8 +14,8 @@
       <annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name="jboss:service=TestHASingletonDeploymentScanner,partition=${jboss.partition.name:DefaultPartition}", exposedInterface=org.jboss.ha.singleton.HASingletonDeploymentScannerMBean.class, registerDirectly=true)</annotation>
          
       <property name="profileService"><inject bean="ProfileService"/></property>
-      <property name="filterInstance"><inject bean="DeploymentFilter"/></property>
-      <property name="mainDeployer"><inject bean="MainDeployer"/></property>
+      <property name="filterInstance"><inject bean="DeploymentFilter"/></property>
+      <property name="deploymentManager"><inject bean="DeploymentManager"/></property>
    </bean>
  
    <bean name="TestHASingletonDeployer" 




More information about the jboss-cvs-commits mailing list