You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by xu...@apache.org on 2009/09/25 08:15:40 UTC

svn commit: r818732 - /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java

Author: xuhaihong
Date: Fri Sep 25 06:15:40 2009
New Revision: 818732

URL: http://svn.apache.org/viewvc?rev=818732&view=rev
Log:
GERONIMO-4876 "java.net.ConnectException" when I shutdown the server

Modified:
    geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java?rev=818732&r1=818731&r2=818732&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java Fri Sep 25 06:15:40 2009
@@ -56,7 +56,8 @@
 
     private String name;
     
-
+    private boolean wrappedConnector;
+    
     public ConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
                         @ParamAttribute(manageable=false, name = "initParams") Map<String, String> initParams,
                         @ParamAttribute(manageable=false, name = "protocol") String tomcatProtocol,
@@ -93,13 +94,14 @@
 
         // Create the Connector object
         if (conn == null) {
-            this.connector= new Connector(tomcatProtocol);
-           
-            for(LifecycleListener listener:TomcatServerGBean.LifecycleListeners){
+            this.connector = new Connector(tomcatProtocol);
+            for (LifecycleListener listener : TomcatServerGBean.LifecycleListeners) {
                 this.connector.addLifecycleListener(listener);
             }
-        }else{
-            connector=conn;
+            wrappedConnector = false;
+        } else {
+            connector = conn;
+            wrappedConnector = true;
         }
         
         setParameters(connector, initParams);
@@ -112,7 +114,11 @@
     }
 
     public void doStart() throws LifecycleException {
-        
+
+        if (wrappedConnector) {
+            return;
+        }
+
         String executorName=null;
         Executor executor=null;
         
@@ -174,12 +180,13 @@
 
     }
 
-    public void doStop() {
-
-        container.removeConnector(connector);
+    public void doStop() {        
+        if (!wrappedConnector) {
+            container.removeConnector(connector);
+        }
         log.debug("{} connector stopped", name);
     }
-    
+
     /**
      * Ensures that this implementation can handle the requested protocol.
      * @param protocol