You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by va...@apache.org on 2009/01/09 11:58:55 UTC

svn commit: r733006 - in /geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat: GeronimoServletHost.java ServletWrapper.java

Author: vamsic007
Date: Fri Jan  9 02:58:55 2009
New Revision: 733006

URL: http://svn.apache.org/viewvc?rev=733006&view=rev
Log:
Adding a servlet mapping to an already started context requires explicit JMX registration without which the mapping info does not get updated in the connector.

Modified:
    geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java
    geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/ServletWrapper.java

Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java?rev=733006&r1=733005&r2=733006&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java (original)
+++ geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/GeronimoServletHost.java Fri Jan  9 02:58:55 2009
@@ -190,7 +190,12 @@
         } catch (LifecycleException e) {
             log.fatal("The context named " + context.getName() + " failed to start",e);
             throw new IllegalArgumentException("The context named " + context.getName() + " failed to start");
-        }                          
+        }
+        if(!newContext) {
+            // Adding a servlet mapping to an already started context requires explicit JMX registration
+            // without which the mapping info does not get updated in the connector.
+            wrapper.registerJMX(context);
+        }
         log.debug("End of addServletMapping() method");
     }
 

Modified: geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/ServletWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/ServletWrapper.java?rev=733006&r1=733005&r2=733006&view=diff
==============================================================================
--- geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/ServletWrapper.java (original)
+++ geronimo/plugins/tuscany/trunk/geronimo-tuscany-http-tomcat/src/main/java/org/apache/geronimo/tuscany/http/tomcat/ServletWrapper.java Fri Jan  9 02:58:55 2009
@@ -21,6 +21,7 @@
 import javax.servlet.Servlet;
 import javax.servlet.ServletException;
 
+import org.apache.catalina.core.StandardContext;
 import org.apache.catalina.core.StandardWrapper;
 
 /**
@@ -52,4 +53,12 @@
     public void destroyServlet() {
         servlet.destroy();
     }
+    
+    /**
+     * This method is added since adding a servlet mapping to an already started context requires explicit
+     * JMX registration without which the mapping info does not get updated in the connector.
+     */
+    public void registerJMX(StandardContext context) {
+        super.registerJMX(context);
+    }
 }