geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1060654 - /geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
Date Wed, 19 Jan 2011 02:37:03 GMT
Author: xuhaihong
Date: Wed Jan 19 02:37:02 2011
New Revision: 1060654

URL: http://svn.apache.org/viewvc?rev=1060654&view=rev
Log:
No need to stop the connector if it is managed by server and current GBean is just a wrapped

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

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java?rev=1060654&r1=1060653&r2=1060654&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
(original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorGBean.java
Wed Jan 19 02:37:02 2011
@@ -58,9 +58,9 @@ public abstract class ConnectorGBean ext
     private String name;
 
     private boolean wrappedConnector;
-    
+
     private String tomcatProtocol;
-    
+
     private Map<String, String> initParams;
 
     public ConnectorGBean(@ParamAttribute(manageable=false, name = "name") String name,
@@ -76,7 +76,7 @@ public abstract class ConnectorGBean ext
 
         }
         initParams  = (_initParams == null)?new HashMap<String, String>():_initParams;
-        
+
 
         // Do we really need this?? For Tomcat I don't think so...
         // validateProtocol(protocol);
@@ -101,28 +101,28 @@ public abstract class ConnectorGBean ext
 
         // Create the Connector object
         if (conn == null) {
-           
-            //create a connector in connector management portlet will reach here. 
+
+            //create a connector in connector management portlet will reach here.
             this.connector = new Connector(tomcatProtocol);
             for (LifecycleListener listener : TomcatServerGBean.LifecycleListeners) {
                 this.connector.addLifecycleListener(listener);
             }
             wrappedConnector = false;
         } else if (conn.getState().equals(LifecycleState.DESTROYED)) {
-           
+
             //restarting a connector in connector management portlet will reach here.
             this.connector = new Connector(tomcatProtocol);
             for (LifecycleListener listener : TomcatServerGBean.LifecycleListeners) {
                 this.connector.addLifecycleListener(listener);
             }
         } else {
-            
+
           //the connectors defined in server.xml will reach here.
             connector = conn;
             wrappedConnector = true;
 
         }
-        
+
 
         setParameters(connector, initParams);
 
@@ -205,16 +205,14 @@ public abstract class ConnectorGBean ext
     public void doStop() {
         if (!wrappedConnector) {
             container.removeConnector(connector);
+            try {
+                connector.stop();
+                connector.destroy();
+            } catch (LifecycleException e) {
+                log.error("fail to stop connector", e);
+            }
+            log.debug("{} connector stopped", name);
         }
-        
-        try {
-            connector.stop();
-            connector.destroy();
-        } catch (LifecycleException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        log.debug("{} connector stopped", name);
     }
 
     /**
@@ -246,14 +244,14 @@ public abstract class ConnectorGBean ext
     public boolean getAllowTrace() {
         return connector.getAllowTrace();
     }
-    
+
     public long getAsyncTimeout() {
         return  connector.getAsyncTimeout();
     }
 
     public void setAsyncTimeout(long asyncTimeout) {
         connector.setAsyncTimeout(asyncTimeout);
-    }    
+    }
 
     public void setEnableLookups(boolean enabled) {
         connector.setEnableLookups(enabled);



Mime
View raw message