Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 8 Dec 2010 14:51:10 +0000 (14:51 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 8 Dec 2010 14:51:10 +0000 (14:51 +0000)
Pull up start()

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1043441 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/AbstractProtocolHandler.java
java/org/apache/coyote/LocalStrings.properties
java/org/apache/coyote/ajp/AjpAprProtocol.java
java/org/apache/coyote/ajp/AjpProtocol.java
java/org/apache/coyote/http11/Http11AprProtocol.java
java/org/apache/coyote/http11/Http11NioProtocol.java
java/org/apache/coyote/http11/Http11Protocol.java

index 19f697d..43eaf90 100644 (file)
@@ -379,6 +379,21 @@ public abstract class AbstractProtocolHandler implements ProtocolHandler,
 
 
     @Override
+    public void start() throws Exception {
+        if (getLog().isInfoEnabled())
+            getLog().info(sm.getString("abstractProtocolHandler.start",
+                    getName()));
+        try {
+            endpoint.start();
+        } catch (Exception ex) {
+            getLog().error(sm.getString("abstractProtocolHandler.startError",
+                    getName()), ex);
+            throw ex;
+        }
+    }
+
+
+    @Override
     public void pause() throws Exception {
         if(getLog().isInfoEnabled())
             getLog().info(sm.getString("abstractProtocolHandler.pause",
index bd98a31..94a44ad 100644 (file)
@@ -18,6 +18,8 @@ abstractProtocolHandler.setAttribute=Set attribute [{0}] with value [{1}]
 abstractProtocolHandler.init=Initializing ProtocolHandler [{0}]
 abstractProtocolHandler.initError=Failed to initialize end point associated with ProtocolHandler [{0}]
 abstractProtocolHandler.mbeanRegistrationFailed=Failed to register MBean [{0}] for ProtocolHandler [{1}]
+abstractProtocolHandler.start=Starting ProtocolHandler [{0}]
+abstractProtocolHandler.startError=Failed to start end point associated with ProtocolHandler [{0}]
 abstractProtocolHandler.pause=Pausing ProtocolHandler [{0}]
 abstractProtocolHandler.pauseError=Failed to pause end point associated with ProtocolHandler [{0}]
 abstractProtocolHandler.resume=Resuming ProtocolHandler [{0}]
index 69141ac..53bf3ba 100644 (file)
@@ -86,19 +86,6 @@ public class AjpAprProtocol extends AbstractAjpProtocol {
     // --------------------------------------------------------- Public Methods
 
 
-    @Override
-    public void start() throws Exception {
-        try {
-            endpoint.start();
-        } catch (Exception ex) {
-            log.error(sm.getString("ajpprotocol.endpoint.starterror"), ex);
-            throw ex;
-        }
-        if (log.isInfoEnabled())
-            log.info(sm.getString("ajpprotocol.start", getName()));
-    }
-
-
     public boolean getUseSendfile() { return endpoint.getUseSendfile(); }
     public void setUseSendfile(@SuppressWarnings("unused") boolean useSendfile) {
         /* No sendfile for AJP */
index cab4984..5ec65ca 100644 (file)
@@ -83,22 +83,6 @@ public class AjpProtocol extends AbstractAjpProtocol {
     private AjpConnectionHandler cHandler;
 
 
-    // --------------------------------------------------------- Public Methods
-
-
-    @Override
-    public void start() throws Exception {
-        try {
-            endpoint.start();
-        } catch (Exception ex) {
-            log.error(sm.getString("ajpprotocol.endpoint.starterror"), ex);
-            throw ex;
-        }
-        if (log.isInfoEnabled())
-            log.info(sm.getString("ajpprotocol.start", getName()));
-    }
-
-
     // --------------------------------------  AjpConnectionHandler Inner Class
 
 
index 3bd8809..2480aea 100644 (file)
@@ -79,18 +79,6 @@ public class Http11AprProtocol extends AbstractHttp11Protocol {
         setProcessorCache(-1);
     }
 
-    @Override
-    public void start() throws Exception {
-        try {
-            endpoint.start();
-        } catch (Exception ex) {
-            log.error(sm.getString("http11protocol.endpoint.starterror"), ex);
-            throw ex;
-        }
-        if(log.isInfoEnabled())
-            log.info(sm.getString("http11protocol.start", getName()));
-    }
-
     private final Http11ConnectionHandler cHandler;
 
     public boolean getUseSendfile() { return ((AprEndpoint)endpoint).getUseSendfile(); }
index 8e90bd1..a0f4017 100644 (file)
@@ -81,19 +81,6 @@ public class Http11NioProtocol extends AbstractHttp11JsseProtocol {
     }
 
 
-    @Override
-    public void start() throws Exception {
-        try {
-            endpoint.start();
-        } catch (Exception ex) {
-            log.error(sm.getString("http11protocol.endpoint.starterror"), ex);
-            throw ex;
-        }
-        if(log.isInfoEnabled())
-            log.info(sm.getString("http11protocol.start", getName()));
-    }
-
-
     // -------------------- Properties--------------------
     
 
index fc3391b..00a61cf 100644 (file)
@@ -82,21 +82,6 @@ public class Http11Protocol extends AbstractHttp11JsseProtocol {
     protected Http11ConnectionHandler cHandler;
 
 
-    // ----------------------------------------- ProtocolHandler Implementation
-
-    @Override
-    public void start() throws Exception {
-        try {
-            endpoint.start();
-        } catch (Exception ex) {
-            log.error(sm.getString("http11protocol.endpoint.starterror"), ex);
-            throw ex;
-        }
-        if (log.isInfoEnabled())
-            log.info(sm.getString("http11protocol.start", getName()));
-    }
-
-
     // -----------------------------------  Http11ConnectionHandler Inner Class
 
     protected static class Http11ConnectionHandler implements Handler {