geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r790765 - in /geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector: Connector.java MapperListener.java
Date Fri, 03 Jul 2009 00:06:03 GMT
Author: kevan
Date: Fri Jul  3 00:06:02 2009
New Revision: 790765

URL: http://svn.apache.org/viewvc?rev=790765&view=rev
Log:
GERONIMO-4685 Merge of 783305 from tomcat/tc6.0.x/trunk/. Fixes NPE in MapperListener.registerHost().
I would expect that this fix would be in 6.0.22. So prolly won't require merging in the future

Modified:
    geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/Connector.java
    geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/MapperListener.java

Modified: geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/Connector.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/Connector.java?rev=790765&r1=790764&r2=790765&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/Connector.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/Connector.java
Fri Jul  3 00:06:02 2009
@@ -263,7 +263,7 @@
      /**
       * Mapper listener.
       */
-     protected MapperListener mapperListener = new MapperListener(mapper);
+     protected MapperListener mapperListener = new MapperListener(mapper, this);
 
 
      /**

Modified: geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/MapperListener.java
URL: http://svn.apache.org/viewvc/geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/MapperListener.java?rev=790765&r1=790764&r2=790765&view=diff
==============================================================================
--- geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/MapperListener.java
(original)
+++ geronimo/external/trunk/tomcat-parent-6.0.20/catalina/src/main/java/org/apache/catalina/connector/MapperListener.java
Fri Jul  3 00:06:02 2009
@@ -29,7 +29,6 @@
 import org.apache.catalina.ContainerEvent;
 import org.apache.catalina.ContainerListener;
 import org.apache.catalina.Host;
-import org.apache.catalina.ServerFactory;
 import org.apache.catalina.core.StandardContext;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
@@ -64,6 +63,11 @@
     protected Mapper mapper = null;
 
     /**
+     * Associated connector.
+     */
+    protected Connector connector = null;
+
+    /**
      * MBean server.
      */
     protected MBeanServer mBeanServer = null;
@@ -85,8 +89,9 @@
     /**
      * Create mapper listener.
      */
-    public MapperListener(Mapper mapper) {
+    public MapperListener(Mapper mapper, Connector connector) {
         this.mapper = mapper;
+        this.connector = connector;
     }
 
 
@@ -329,9 +334,9 @@
         String name=objectName.getKeyProperty("host");
         if( name != null ) {        
 
-            Host host = (Host) ServerFactory.getServer().findService(
-                    domain).getContainer().findChild(name);
-        
+            Host host =
+                (Host) connector.getService().getContainer().findChild(name);
+
             String[] aliases = host.findAliases();
             mapper.addHost(name, aliases, objectName);
             host.addContainerListener(this);
@@ -349,8 +354,8 @@
         throws Exception {
         String name=objectName.getKeyProperty("host");
         if( name != null ) { 
-            Host host = (Host) ServerFactory.getServer().findService(
-                domain).getContainer().findChild(name);
+            Host host = 
+                (Host) connector.getService().getContainer().findChild(name);
         
             mapper.removeHost(name);
             host.removeContainerListener(this);



Mime
View raw message