[jboss-cvs] JBossAS SVN: r74166 - trunk/cluster/src/main/org/jboss/proxy/ejb.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 5 17:08:20 EDT 2008


Author: bstansberry at jboss.com
Date: 2008-06-05 17:08:20 -0400 (Thu, 05 Jun 2008)
New Revision: 74166

Modified:
   trunk/cluster/src/main/org/jboss/proxy/ejb/ProxyFactoryHA.java
Log:
[JBAS-5593] Undo in stop() what you do in start()
Handle a start()/stop()/start() of just the container

Modified: trunk/cluster/src/main/org/jboss/proxy/ejb/ProxyFactoryHA.java
===================================================================
--- trunk/cluster/src/main/org/jboss/proxy/ejb/ProxyFactoryHA.java	2008-06-05 21:08:03 UTC (rev 74165)
+++ trunk/cluster/src/main/org/jboss/proxy/ejb/ProxyFactoryHA.java	2008-06-05 21:08:20 UTC (rev 74166)
@@ -71,6 +71,15 @@
    protected InvokerHA jrmp;
    protected HATarget target;
    
+   /** 
+    * Track whether we're in a start()/stop()/start() cycle not driven
+    * by our EjbModule, in which case we will not get a JMX start 
+    * notification from EjbModule
+    */
+   private boolean containerRestart = true;
+   /** Are we in the middle of an EjbModule stop and thus not a containerRestart?*/
+   private boolean ejbModuleStopping = false;
+   
    protected DistributedReplicantManager drm = null;
    
    public void create () throws Exception
@@ -99,6 +108,12 @@
    public void start () throws Exception
    {
       super.start ();
+      
+      if (containerRestart)
+      {
+         containerIsFullyStarted();
+         containerRestart = false;
+      }
    }
    
    protected void setupInvokers() throws Exception
@@ -161,10 +176,31 @@
       JRMPInvokerProxyHA.colocation.add(new Integer(jmxNameHash));
    }
    
-   public void destroy ()
+   
+   @Override
+   public void stop()
    {
-      super.destroy ();
+      super.stop();
       
+      teardownInvokers();
+      
+      if (!ejbModuleStopping)
+         containerRestart = true;
+      else
+         ejbModuleStopping = false;
+   }
+
+   @Override
+   public void destroy()
+   {
+      super.destroy();
+      
+      containerRestart = false;
+      ejbModuleStopping = false;
+   }
+
+   private void teardownInvokers()
+   {
       try
       {
          JRMPInvokerProxyHA.colocation.remove(new Integer(jmxNameHash));
@@ -211,6 +247,8 @@
          target.setInvocationsAuthorization (HATarget.DISABLE_INVOCATIONS);
          target.disable ();
       }
+      
+      this.ejbModuleStopping = true;
    }
 
    // synchronized keyword added when it became possible for DRM to issue




More information about the jboss-cvs-commits mailing list