geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r559536 - /geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java
Date Wed, 25 Jul 2007 17:46:48 GMT
Author: jgenender
Date: Wed Jul 25 10:46:47 2007
New Revision: 559536

URL: http://svn.apache.org/viewvc?view=rev&rev=559536
Log:
Ensure AJP gets stats

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

Modified: geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java?view=diff&rev=559536&r1=559535&r2=559536
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6/src/main/java/org/apache/geronimo/tomcat/connector/AJP13ConnectorGBean.java
Wed Jul 25 10:46:47 2007
@@ -20,12 +20,21 @@
 
 import java.net.InetAddress;
 
+import javax.management.j2ee.statistics.Stats;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
 import org.apache.geronimo.tomcat.TomcatContainer;
+import org.apache.geronimo.tomcat.stats.ConnectorStats;
 
 public class AJP13ConnectorGBean extends ConnectorGBean implements Ajp13Protocol{
+    
+    // JSR77 stats
+    private ConnectorStats connStatsProvider = new ConnectorStats();
+
+    private boolean reset = true;
+
 
     public AJP13ConnectorGBean(String name, String address, int port, TomcatContainer container,
ServerInfo serverInfo) throws Exception {
         super(name, "AJP/1.3", container, serverInfo);
@@ -136,6 +145,21 @@
 
     public void setTomcatAuthentication(boolean tomcatAuthentication) {
         connector.setAttribute("tomcatAuthentication", new Boolean(tomcatAuthentication));
+    }
+    
+    // Statistics Provider
+
+    public Stats getStats() {
+        String port = String.valueOf(getPort());
+        if (reset) {
+            reset = false;
+            return connStatsProvider.getStats(port);
+        } else
+            return connStatsProvider.updateStats(port);
+    }
+
+    public void resetStats() {
+        reset = true;
     }
     
     public static final GBeanInfo GBEAN_INFO;



Mime
View raw message