Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Dec 2010 13:36:48 +0000 (13:36 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 6 Dec 2010 13:36:48 +0000 (13:36 +0000)
Implement a common base class for ProtocolHandler implementations that will handle life-cycle/mbean issues (once more re-factoring has been completed)

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

java/org/apache/coyote/AbstractProtocolHandler.java [new file with mode: 0644]
java/org/apache/coyote/ajp/AbstractAjpProtocol.java
java/org/apache/coyote/http11/AbstractHttp11Protocol.java

diff --git a/java/org/apache/coyote/AbstractProtocolHandler.java b/java/org/apache/coyote/AbstractProtocolHandler.java
new file mode 100644 (file)
index 0000000..8cec9bb
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.coyote;
+
+import javax.management.MBeanRegistration;
+
+import org.apache.juli.logging.Log;
+
+public abstract class AbstractProtocolHandler implements ProtocolHandler,
+        MBeanRegistration {
+
+    // Concrete implementations need to provide access to their logger to be
+    // used by the abstract classes.
+    protected abstract Log getLog();
+
+}
index eb3efb5..46ca78b 100644 (file)
@@ -22,25 +22,21 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.concurrent.Executor;
 
-import javax.management.MBeanRegistration;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
+import org.apache.coyote.AbstractProtocolHandler;
 import org.apache.coyote.Adapter;
-import org.apache.coyote.ProtocolHandler;
-import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.res.StringManager;
 
-public abstract class AbstractAjpProtocol implements ProtocolHandler, MBeanRegistration {
+public abstract class AbstractAjpProtocol extends AbstractProtocolHandler {
     /**
      * The string manager for this package.
      */
     protected static final StringManager sm = StringManager.getManager(Constants.Package);
-    
-    protected abstract Log getLog();
-    
+        
     protected ObjectName tpOname = null;
     protected ObjectName rgOname = null;
 
index 6ba9375..74c2eb2 100644 (file)
@@ -22,26 +22,22 @@ import java.util.HashMap;
 import java.util.Iterator;
 import java.util.concurrent.Executor;
 
-import javax.management.MBeanRegistration;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
 
+import org.apache.coyote.AbstractProtocolHandler;
 import org.apache.coyote.Adapter;
-import org.apache.coyote.ProtocolHandler;
-import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.modeler.Registry;
 import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.SSLImplementation;
 import org.apache.tomcat.util.res.StringManager;
 
-public abstract class AbstractHttp11Protocol implements ProtocolHandler, MBeanRegistration {
+public abstract class AbstractHttp11Protocol extends AbstractProtocolHandler {
     /**
      * The string manager for this package.
      */
     protected static final StringManager sm = StringManager.getManager(Constants.Package);
     
-    protected abstract Log getLog();
-    
     protected ObjectName tpOname = null;
     protected ObjectName rgOname = null;