tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1042850 - in /tomcat/trunk/java/org/apache: coyote/ coyote/ajp/ coyote/http11/ tomcat/util/net/
Date Mon, 06 Dec 2010 23:22:44 GMT
Author: markt
Date: Mon Dec  6 23:22:44 2010
New Revision: 1042850

URL: http://svn.apache.org/viewvc?rev=1042850&view=rev
Log:
Re-factoring in support of https://issues.apache.org/bugzilla/show_bug.cgi?id=50360
Add the necessary plumbing for the AbstractProtocolHandler to perform the JMX registration

Modified:
    tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
    tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
    tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
    tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
    tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java

Modified: tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java (original)
+++ tomcat/trunk/java/org/apache/coyote/AbstractProtocolHandler.java Mon Dec  6 23:22:44 2010
@@ -27,6 +27,7 @@ import javax.management.ObjectName;
 
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.net.AbstractEndpoint;
+import org.apache.tomcat.util.net.AbstractEndpoint.Handler;
 import org.apache.tomcat.util.res.StringManager;
 
 public abstract class AbstractProtocolHandler implements ProtocolHandler,
@@ -288,6 +289,12 @@ public abstract class AbstractProtocolHa
     protected abstract String getNamePrefix();
 
 
+    /**
+     * Obtain the handler associated with the underlying Endpoint
+     */
+    protected abstract Handler getHandler();
+
+
     // ----------------------------------------------------- JMX related methods
 
     protected String domain;

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpAprProtocol.java Mon Dec  6 23:22:44 2010
@@ -30,6 +30,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.modeler.Registry;
+import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.AprEndpoint;
 import org.apache.tomcat.util.net.AprEndpoint.Handler;
 import org.apache.tomcat.util.net.SocketStatus;
@@ -52,6 +53,13 @@ public class AjpAprProtocol extends Abst
     @Override
     protected Log getLog() { return log; }
 
+
+    @Override
+    protected AbstractEndpoint.Handler getHandler() {
+        return cHandler;
+    }
+
+
     // ------------------------------------------------------------ Constructor
 
 
@@ -143,6 +151,10 @@ public class AjpAprProtocol extends Abst
         protected AjpAprProtocol proto;
         protected AtomicLong registerCount = new AtomicLong(0);
         protected RequestGroupInfo global = new RequestGroupInfo();
+        @Override
+        public RequestGroupInfo getGlobal() {
+            return global;
+        }
 
         protected ConcurrentHashMap<SocketWrapper<Long>, AjpAprProcessor> connections
=
             new ConcurrentHashMap<SocketWrapper<Long>, AjpAprProcessor>();

Modified: tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/ajp/AjpProtocol.java Mon Dec  6 23:22:44 2010
@@ -31,7 +31,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.modeler.Registry;
-import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
+import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.JIoEndpoint;
 import org.apache.tomcat.util.net.JIoEndpoint.Handler;
 import org.apache.tomcat.util.net.SocketStatus;
@@ -54,6 +54,13 @@ public class AjpProtocol extends Abstrac
     @Override
     protected Log getLog() { return log; }
 
+
+    @Override
+    protected AbstractEndpoint.Handler getHandler() {
+        return cHandler;
+    }
+
+
     // ------------------------------------------------------------ Constructor
 
 
@@ -133,6 +140,11 @@ public class AjpProtocol extends Abstrac
         protected AjpProtocol proto;
         protected AtomicLong registerCount = new AtomicLong(0);
         protected RequestGroupInfo global = new RequestGroupInfo();
+        @Override
+        public RequestGroupInfo getGlobal() {
+            return global;
+        }
+
         protected ConcurrentHashMap<SocketWrapper<Socket>, AjpProcessor> connections
=
             new ConcurrentHashMap<SocketWrapper<Socket>, AjpProcessor>();
 

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11AprProtocol.java Mon Dec  6 23:22:44
2010
@@ -32,6 +32,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.modeler.Registry;
+import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.AprEndpoint;
 import org.apache.tomcat.util.net.AprEndpoint.Handler;
 import org.apache.tomcat.util.net.SocketStatus;
@@ -51,9 +52,17 @@ public class Http11AprProtocol extends A
 
     private static final Log log = LogFactory.getLog(Http11AprProtocol.class);
 
+
     @Override
     protected Log getLog() { return log; }
 
+
+    @Override
+    protected AbstractEndpoint.Handler getHandler() {
+        return cHandler;
+    }
+
+
     /**
      * The string manager for this package.
      */
@@ -236,6 +245,10 @@ public class Http11AprProtocol extends A
         protected Http11AprProtocol proto;
         protected AtomicLong registerCount = new AtomicLong(0);
         protected RequestGroupInfo global = new RequestGroupInfo();
+        @Override
+        public RequestGroupInfo getGlobal() {
+            return global;
+        }
         
         protected ConcurrentHashMap<SocketWrapper<Long>, Http11AprProcessor>
connections =
             new ConcurrentHashMap<SocketWrapper<Long>, Http11AprProcessor>();

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11NioProtocol.java Mon Dec  6 23:22:44
2010
@@ -33,6 +33,7 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.modeler.Registry;
+import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.NioChannel;
 import org.apache.tomcat.util.net.NioEndpoint;
 import org.apache.tomcat.util.net.NioEndpoint.Handler;
@@ -53,10 +54,18 @@ import org.apache.tomcat.util.net.jsse.J
 public class Http11NioProtocol extends AbstractHttp11JsseProtocol {
     
     private static final Log log = LogFactory.getLog(Http11NioProtocol.class);
-    
+
+
     @Override
     protected Log getLog() { return log; }
     
+
+    @Override
+    protected AbstractEndpoint.Handler getHandler() {
+        return cHandler;
+    }
+
+
     public Http11NioProtocol() {
         endpoint=new NioEndpoint();
         cHandler = new Http11ConnectionHandler( this );
@@ -198,6 +207,10 @@ public class Http11NioProtocol extends A
         protected Http11NioProtocol proto;
         protected static int count = 0;
         protected RequestGroupInfo global = new RequestGroupInfo();
+        @Override
+        public RequestGroupInfo getGlobal() {
+            return global;
+        }
 
         protected ConcurrentHashMap<NioChannel, Http11NioProcessor> connections =
             new ConcurrentHashMap<NioChannel, Http11NioProcessor>();

Modified: tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/Http11Protocol.java Mon Dec  6 23:22:44 2010
@@ -33,7 +33,7 @@ import org.apache.coyote.RequestInfo;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.ExceptionUtils;
 import org.apache.tomcat.util.modeler.Registry;
-import org.apache.tomcat.util.net.AbstractEndpoint.Handler.SocketState;
+import org.apache.tomcat.util.net.AbstractEndpoint;
 import org.apache.tomcat.util.net.JIoEndpoint;
 import org.apache.tomcat.util.net.JIoEndpoint.Handler;
 import org.apache.tomcat.util.net.SSLImplementation;
@@ -60,6 +60,12 @@ public class Http11Protocol extends Abst
     protected Log getLog() { return log; }
 
 
+    @Override
+    protected AbstractEndpoint.Handler getHandler() {
+        return cHandler;
+    }
+
+
     // ------------------------------------------------------------ Constructor
 
 
@@ -185,6 +191,11 @@ public class Http11Protocol extends Abst
         protected Http11Protocol proto;
         protected AtomicLong registerCount = new AtomicLong(0);
         protected RequestGroupInfo global = new RequestGroupInfo();
+        @Override
+        public RequestGroupInfo getGlobal() {
+            return global;
+        }
+            
         protected ConcurrentHashMap<SocketWrapper<Socket>, Http11Processor> connections
=
             new ConcurrentHashMap<SocketWrapper<Socket>, Http11Processor>();
 

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AbstractEndpoint.java Mon Dec  6 23:22:44
2010
@@ -27,6 +27,7 @@ import java.util.concurrent.TimeUnit;
 import javax.net.ssl.KeyManagerFactory;
 
 import org.apache.catalina.Globals;
+import org.apache.coyote.RequestGroupInfo;
 import org.apache.juli.logging.Log;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.net.jsse.JSSESocketFactory;
@@ -73,13 +74,19 @@ public abstract class AbstractEndpoint {
      */
     public static final String SESSION_MGR = "javax.servlet.request.ssl_session_mgr";
 
-    /**
-     * Different types of socket states to react upon
-     */
     public static interface Handler {
+        /**
+         * Different types of socket states to react upon
+         */
         public enum SocketState {
             OPEN, CLOSED, LONG, ASYNC_END
         }
+        
+
+        /**
+         * Obtain the GlobalRequestProcessor associated with the handler
+         */
+        public RequestGroupInfo getGlobal();
     }
 
     // Standard SSL Configuration attributes

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java?rev=1042850&r1=1042849&r2=1042850&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/JIoEndpoint.java Mon Dec  6 23:22:44 2010
@@ -117,7 +117,7 @@ public class JIoEndpoint extends Abstrac
      * stored in the ThreadWithAttributes extra folders, or alternately in
      * thread local fields.
      */
-    public interface Handler {
+    public interface Handler extends AbstractEndpoint.Handler {
         public SocketState process(SocketWrapper<Socket> socket);
         public SocketState process(SocketWrapper<Socket> socket, SocketStatus status);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message