[jboss-cvs] JBossAS SVN: r62449 - branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Apr 20 16:52:16 EDT 2007


Author: fnasser at redhat.com
Date: 2007-04-20 16:52:16 -0400 (Fri, 20 Apr 2007)
New Revision: 62449

Modified:
   branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java
   branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5MBean.java
Log:
Merge of JBAS-3344 one-off branch (ASPATCH-195)

Modified: branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java
===================================================================
--- branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java	2007-04-20 20:26:27 UTC (rev 62448)
+++ branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5.java	2007-04-20 20:52:16 UTC (rev 62449)
@@ -39,7 +39,8 @@
  *
  * @author Scott.Stark at jboss.org
  * @author Costin Manolache
- * @author wonne.keysers at realsoftware.be
+ * @author Wonne.Keysers at realsoftware.be
+ * @author Dimitris.Andreadis at jboss.org
  * @version $Revision$
  * @see org.jboss.web.AbstractWebContainer
  */
@@ -392,15 +393,33 @@
       PolicyContext.registerHandler(HttpServletRequestPolicyContextHandler.WEB_REQUEST_KEY,
          handler, false);
 
-      // Register for notification of the overall server startup
-      server.addNotificationListener(ServerImplMBean.OBJECT_NAME, this, null, null);
-
       // Invoke the super method to register as a deployer
+      // This will cause waiting deployments to be deployed 
       super.startService();
 
+      // If we are hot-deployed *after* the overall server is started 
+      // we'll never receive Server.START_NOTIFICATION_TYPE, so check 
+      // with the Server and start the connectors immediately, if this is the case. 
+      // Otherwise register to receive the server start-up notification. 
+      Boolean started = (Boolean)server.getAttribute(ServerImplMBean.OBJECT_NAME, "Started"); 
+      if (started.booleanValue() == true) 
+      { 
+         log.debug("Server '" + ServerImplMBean.OBJECT_NAME + 
+               "' already started, starting connectors now");          
+          
+         startConnectors(); 
    }
+      else 
+      { 
+         // Register for notification of the overall server startup 
+         log.debug("Server '" + ServerImplMBean.OBJECT_NAME + 
+               "' not started, registering for start-up notification"); 
 
+         server.addNotificationListener(ServerImplMBean.OBJECT_NAME, this, null, null);          
+      }       
+   }
 
+
    public void stopService()
       throws Exception
    {
@@ -461,6 +480,9 @@
          Lifecycle lc = (Lifecycle) connectors[n];
          lc.start();
       }
+      // Notify listeners that connectors have started processing requests 
+      sendNotification(new Notification(TOMCAT_CONNECTORS_STARTED, 
+            this, getNextNotificationSequenceNumber())); 
    }
 
    public void stopConnectors() throws Exception

Modified: branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5MBean.java
===================================================================
--- branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5MBean.java	2007-04-20 20:26:27 UTC (rev 62448)
+++ branches/JBoss_4_0_1_SP1_CP/tomcat/src/main/org/jboss/web/tomcat/tc5/Tomcat5MBean.java	2007-04-20 20:52:16 UTC (rev 62449)
@@ -23,6 +23,9 @@
  */
 public interface Tomcat5MBean extends AbstractWebContainerMBean
 {
+   /** JMX notification type to signal after-start connector event */  
+   public final String TOMCAT_CONNECTORS_STARTED  = "jboss.tomcat.connectors.started"; 
+       
    /**
     * @return the jmx domain for the tomcat management mbeans
     */




More information about the jboss-cvs-commits mailing list