[jboss-cvs] JBossAS SVN: r57254 - branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/server

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Sep 27 23:17:27 EDT 2006


Author: bstansberry at jboss.com
Date: 2006-09-27 23:17:24 -0400 (Wed, 27 Sep 2006)
New Revision: 57254

Modified:
   branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java
Log:
[JBAS-3713] Relookup deployer in createService() if its not available 

Modified: branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java
===================================================================
--- branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java	2006-09-28 03:08:01 UTC (rev 57253)
+++ branches/Branch_4_0/cluster/src/main/org/jboss/ha/framework/server/FarmMemberService.java	2006-09-28 03:17:24 UTC (rev 57254)
@@ -53,6 +53,7 @@
 public class FarmMemberService extends URLDeploymentScanner implements FarmMemberServiceMBean
 {
    private MBeanServer mServer;
+   protected ObjectName mDeployerName = null;
    protected ObjectName mClusterPartitionName = null;
    protected ClusterPartitionMBean mClusterPartition = null; 
    protected String mBackgroundPartition = ServerConfigUtil.getDefaultPartitionName();
@@ -108,6 +109,16 @@
       log.warn("ScannerName does nothing");
    }
 
+   public void setDeployer(ObjectName deployerName)
+   {
+      super.setDeployer(deployerName);
+      
+      // Cache the deployer name so we can reset it in case of restart
+      this.mDeployerName = deployerName;
+   }
+   
+   
+
    // Service implementation ----------------------------------------
 
    public String getName()
@@ -132,12 +143,19 @@
     **/
    protected void createService() throws Exception
    {
+      // AbstractDeploymentScanner drops ref to the deployer in destroyService(),
+      // so if this is a "re-create" following a destroy, reestablish it
+      if (deployer == null && mDeployerName != null)
+         setDeployer(mDeployerName); // causes JMX lookup of deployer
+      
       super.createService();
+      
       ServerConfig lConfig = ServerConfigLocator.locate();
       mTempDirectory = lConfig.getServerTempDir();
       
       createUnexistingLocalDir ();
    }
+   
    /**
     * Register itself as RPC-Handler to the HA-Partition
     * and add the farm deployment directory to the scanner




More information about the jboss-cvs-commits mailing list