geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r278562 - in /geronimo/trunk: applications/console-standard/ applications/console-standard/src/java/org/apache/geronimo/console/jsr77/ applications/console-standard/src/java/org/apache/geronimo/console/util/ applications/console-standard/sr...
Date Sun, 04 Sep 2005 06:23:31 GMT
Author: ammulder
Date: Sat Sep  3 23:23:14 2005
New Revision: 278562

URL: http://svn.apache.org/viewcvs?rev=278562&view=rev
Log:
Add some JSR-77 statistics implementations to management module
Add unit constants to JSR-77 Statistics interface
Add first JSR-77 StatisticsProvider implementation (for the JVM)
Remove some unused JSR-77 stuff from the kernel & core
GBeanInstance is no longer responsible for J2EEManagedObject or
  EventProvider
Use JVMStats to dynamically update the console (AJAX just so f'n rocks!)

Added:
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java   (with props)
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/EventProvider.java
      - copied, changed from r267473, geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/EventProvider.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/StatisticsProvider.java
      - copied, changed from r267473, geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/StatisticsProvider.java
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundedRangeImpl.java   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/CountStatisticImpl.java   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/JVMStatsImpl.java   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java   (with props)
    geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatsImpl.java   (with props)
Removed:
    geronimo/trunk/modules/core/src/java/org/apache/geronimo/core/service/ManagedComponent.java
    geronimo/trunk/modules/core/src/java/org/apache/geronimo/core/service/ManagedContainer.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/EventProvider.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/ManagedObject.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/StatisticsProvider.java
Modified:
    geronimo/trunk/applications/console-standard/project.xml
    geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp
    geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml
    geronimo/trunk/etc/project.properties
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
    geronimo/trunk/modules/management/project.xml
    geronimo/trunk/specs/j2ee-management/src/java/javax/management/j2ee/statistics/Statistic.java

Modified: geronimo/trunk/applications/console-standard/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/project.xml?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/project.xml (original)
+++ geronimo/trunk/applications/console-standard/project.xml Sat Sep  3 23:23:14 2005
@@ -21,6 +21,11 @@
              <version>${pom.currentVersion}</version>
          </dependency>
         <dependency>
+             <groupId>geronimo-spec</groupId>
+             <artifactId>geronimo-spec-j2ee-management</artifactId>
+             <version>${geronimo_spec_j2ee_management_version}</version>
+         </dependency>
+        <dependency>
              <groupId>geronimo</groupId>
              <artifactId>geronimo-connector</artifactId>
              <version>${pom.currentVersion}</version>
@@ -226,6 +231,14 @@
             <groupId>tomcat</groupId>
             <artifactId>jasper-compiler</artifactId>
             <version>${jasper_version}</version>
+            <properties>
+                <war.bundle>true</war.bundle>
+            </properties>
+        </dependency>
+        <dependency>
+            <groupId>dwr</groupId>
+            <artifactId>dwr</artifactId>
+            <version>${dwr_version}</version>
             <properties>
                 <war.bundle>true</war.bundle>
             </properties>

Added: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java (added)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,50 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.console.jsr77;
+
+import javax.servlet.http.HttpSession;
+import javax.management.j2ee.statistics.JVMStats;
+import javax.management.j2ee.statistics.BoundedRangeStatistic;
+import uk.ltd.getahead.dwr.ExecutionContext;
+import org.apache.geronimo.console.util.PortletManager;
+import org.apache.geronimo.console.util.ManagementHelper;
+import org.apache.geronimo.management.J2EEDomain;
+import org.apache.geronimo.management.StatisticsProvider;
+import org.apache.geronimo.management.geronimo.J2EEServer;
+import org.apache.geronimo.management.geronimo.JVM;
+
+/**
+ * Looks up JSR-77 statistics in response to AJAX calls from portlets.
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class Jsr77Lookup {
+    public BoundedRangeStatistic getJavaVMStatistics() {
+        HttpSession session = ExecutionContext.get().getSession();
+        ManagementHelper helper = PortletManager.getManagementHelper(session);
+        J2EEDomain[] domains = helper.getDomains();
+        J2EEServer[] servers = helper.getServers(domains[0]);
+        JVM[] jvms = helper.getJavaVMs(servers[0]);
+        if(jvms[0].isStatisticsProvider()) {
+            JVMStats stats = (JVMStats) ((StatisticsProvider)jvms[0]).getStats();
+            BoundedRangeStatistic heap = stats.getHeapSize();
+            return heap;
+        } else {
+            return null;
+        }
+    }
+}

Propchange: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/jsr77/Jsr77Lookup.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java (original)
+++ geronimo/trunk/applications/console-standard/src/java/org/apache/geronimo/console/util/PortletManager.java Sat Sep  3 23:23:14 2005
@@ -20,6 +20,7 @@
 import javax.portlet.PortletSession;
 import javax.naming.InitialContext;
 import javax.naming.NamingException;
+import javax.servlet.http.HttpSession;
 import org.apache.geronimo.kernel.KernelRegistry;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.proxy.GeronimoManagedBean;
@@ -55,7 +56,7 @@
     // The following may change based on the user's selections
         // nothing yet
 
-    private static ManagementHelper createHelper(PortletRequest request) {
+    private static ManagementHelper createHelper() {
         //todo: consider making this configurable; we could easily connect to a remote kernel if we wanted to
         Kernel kernel = null;
         try {
@@ -73,8 +74,17 @@
     public static ManagementHelper getManagementHelper(PortletRequest request) {
         ManagementHelper helper = (ManagementHelper) request.getPortletSession(true).getAttribute(HELPER_KEY, PortletSession.APPLICATION_SCOPE);
         if(helper == null) {
-            helper = createHelper(request);
+            helper = createHelper();
             request.getPortletSession().setAttribute(HELPER_KEY, helper, PortletSession.APPLICATION_SCOPE);
+        }
+        return helper;
+    }
+
+    public static ManagementHelper getManagementHelper(HttpSession session) {
+        ManagementHelper helper = (ManagementHelper) session.getAttribute(HELPER_KEY);
+        if(helper == null) {
+            helper = createHelper();
+            session.setAttribute(HELPER_KEY, helper);
         }
         return helper;
     }

Added: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml (added)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml Sat Sep  3 23:23:14 2005
@@ -0,0 +1,12 @@
+<!DOCTYPE dwr PUBLIC
+    "-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"
+    "http://www.getahead.ltd.uk/dwr/dwr10.dtd">
+
+<dwr>
+  <allow>
+    <convert converter="bean" match="javax.management.j2ee.statistics.BoundedRangeStatistic"/>
+    <create creator="new" javascript="Jsr77Stats">
+      <param name="class" value="org.apache.geronimo.console.jsr77.Jsr77Lookup"/>
+    </create>
+  </allow>
+</dwr>
\ No newline at end of file

Propchange: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/dwr.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/view/infomanager/svrInfoNormal.jsp Sat Sep  3 23:23:14 2005
@@ -1,5 +1,10 @@
 <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
 <%@ taglib uri="http://java.sun.com/portlet" prefix="portlet"%>
+
+<script type='text/javascript' src='/console-standard/dwr/interface/Jsr77Stats.js'></script>
+<script type='text/javascript' src='/console-standard/dwr/engine.js'></script>
+<script type='text/javascript' src='/console-standard/dwr/util.js'></script>
+
 <portlet:defineObjects/>
 
 <table width="100%"> 
@@ -80,16 +85,16 @@
     <td class="LightBackground">${jvmProps['Node']}</td> 
   </tr> 
   <tr> 
-    <td class="MediumBackground">Max Memory</td> 
-    <td class="MediumBackground">${jvmProps['Max Memory']}</td> 
+    <td class="MediumBackground">Current Memory Used</td>
+    <td class="MediumBackground"><div id="<portlet:namespace/>CurrentMemory">Not Yet Available</div></td>
   </tr> 
   <tr> 
-    <td class="LightBackground">Total Memory</td> 
-    <td class="LightBackground">${jvmProps['Total Memory']}</td> 
+    <td class="LightBackground">Most Memory Used</td>
+    <td class="LightBackground"><div id="<portlet:namespace/>MostMemory">Not Yet Available</div></td>
   </tr> 
   <tr> 
-    <td class="MediumBackground">Free Memory</td> 
-    <td class="MediumBackground">${jvmProps['Free Memory']}</td> 
+    <td class="MediumBackground">Total Memory Allocated</td>
+    <td class="MediumBackground"><div id="<portlet:namespace/>AvailableMemory">Not Yet Available</div></td>
   </tr> 
   <tr> 
     <td class="LightBackground">Available Processors</td> 
@@ -97,9 +102,20 @@
   </tr> 
   <tr> 
     <td colspan="2" align="center">
-      <form name="<portlet:namespace/>" action="<portlet:actionURL/>"">
+      <form name="<portlet:namespace/>" action="<portlet:actionURL/>">
         <input type="submit" value="Refresh"/>
       </form>
     </td>
-  </tr>  
-</table>
\ No newline at end of file
+  </tr>
+</table>
+
+<script>
+function <portlet:namespace/>showNext(jvmStats) {
+    DWRUtil.setValue("<portlet:namespace/>CurrentMemory", jvmStats.current);
+    DWRUtil.setValue("<portlet:namespace/>MostMemory", jvmStats.highWaterMark);
+    DWRUtil.setValue("<portlet:namespace/>AvailableMemory", jvmStats.upperBound);
+    setTimeout("Jsr77Stats.getJavaVMStatistics(<portlet:namespace/>showNext)", 1000);
+}
+Jsr77Stats.getJavaVMStatistics(<portlet:namespace/>showNext);
+</script>
+

Modified: geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml (original)
+++ geronimo/trunk/applications/console-standard/src/webapp/WEB-INF/web.xml Sat Sep  3 23:23:14 2005
@@ -649,6 +649,23 @@
 
 
 
+<servlet>
+  <display-name>DWR Servlet</display-name>
+  <servlet-name>dwr-invoker</servlet-name>
+  <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class>
+  <init-param>
+     <param-name>debug</param-name>
+     <param-value>true</param-value>
+  </init-param>
+</servlet>
+
+<servlet-mapping>
+  <servlet-name>dwr-invoker</servlet-name>
+  <url-pattern>/dwr/*</url-pattern>
+</servlet-mapping>
+
+
+
     <servlet-mapping>
         <servlet-name>EJBServer</servlet-name>
         <url-pattern>/EJBServer/*</url-pattern>
@@ -848,7 +865,7 @@
     <welcome-file-list>
         <welcome-file>index.html</welcome-file>
     </welcome-file-list>
-    
+
     <jsp-config>
         <taglib>
             <taglib-uri>http://java.sun.com/portlet</taglib-uri>

Modified: geronimo/trunk/etc/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/etc/project.properties?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/etc/project.properties (original)
+++ geronimo/trunk/etc/project.properties Sat Sep  3 23:23:14 2005
@@ -93,7 +93,7 @@
 geronimo_spec_j2ee_connector_version=1.5-rc4
 geronimo_spec_j2ee_deployment_version=1.1-rc4
 geronimo_spec_j2ee_jacc_version=1.0-rc5-SNAPSHOT
-geronimo_spec_j2ee_management_version=1.0-rc4
+geronimo_spec_j2ee_management_version=1.0-rc5
 geronimo_spec_javamail_version=1.3.1-rc6-SNAPSHOT
 geronimo_spec_jaxr_version=1.0-rc4
 geronimo_spec_jaxrpc_version=1.1-rc4
@@ -133,6 +133,7 @@
 concurrent_version=1.3.4
 derby_version=10.1.1.0
 dom4j_version=1.4
+dwr_version=1.0
 eclipse_compiler_version=3.0.1
 howl_version=0.1.8
 #security:

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java (original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java Sat Sep  3 23:23:14 2005
@@ -24,10 +24,14 @@
 import java.util.Hashtable;
 
 import javax.management.ObjectName;
+import javax.management.j2ee.statistics.Stats;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.geronimo.JVM;
+import org.apache.geronimo.management.StatisticsProvider;
+import org.apache.geronimo.management.stats.JVMStatsImpl;
+import org.apache.geronimo.management.stats.BoundedRangeImpl;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.commons.logging.LogFactory;
@@ -38,7 +42,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class JVMImpl implements JVM {
+public class JVMImpl implements JVM, StatisticsProvider {
     private final static Log log = LogFactory.getLog(JVMImpl.class);
     public static final String JAVA_VERSION = System.getProperty("java.version");
     public static final String JAVA_VENDOR = System.getProperty("java.vendor");
@@ -58,6 +62,7 @@
     private final String objectName;
     private final Kernel kernel;
     private final String baseName;
+    private JVMStatsImpl stats;
 
     public JVMImpl(String objectName, Kernel kernel) {
         this.objectName = objectName;
@@ -104,7 +109,7 @@
     }
 
     public boolean isStatisticsProvider() {
-        return false;
+        return true;
     }
 
     public boolean isEventProvider() {
@@ -162,6 +167,23 @@
         return kernel.getBootTime();
     }
 
+    public Stats getStats() {
+        if(stats == null) {
+            stats = new JVMStatsImpl();
+            long start = kernel.getBootTime().getTime();
+            stats.getUpTimeImpl().setCount(start);
+            stats.getUpTimeImpl().setStartTime(start);
+            stats.getHeapSizeImpl().setStartTime(start);
+        }
+        final BoundedRangeImpl heap = stats.getHeapSizeImpl();
+        long now = System.currentTimeMillis();
+        stats.getUpTimeImpl().setLastSampleTime(now);
+        heap.setLastSampleTime(now);
+        heap.setBounds(0, runtime.totalMemory());
+        heap.setCurrent(heap.getUpperBound() - runtime.freeMemory());
+        return stats;
+    }
+
     public Properties getSystemProperties() {
         return System.getProperties();
     }
@@ -183,6 +205,7 @@
 //        infoFactory.addAttribute("objectName", String.class, false);
         infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addInterface(JVM.class);
+        infoFactory.addInterface(StatisticsProvider.class);
         infoFactory.setConstructor(new String[] {"objectName", "kernel"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java (original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/gbean/runtime/GBeanInstance.java Sat Sep  3 23:23:14 2005
@@ -39,9 +39,6 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ManageableAttributeStore;
 import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.management.EventProvider;
-import org.apache.geronimo.kernel.management.ManagedObject;
-import org.apache.geronimo.kernel.management.NotificationType;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.management.StateManageable;
 
@@ -50,7 +47,7 @@
  *
  * @version $Rev: 106387 $ $Date: 2004-11-23 22:16:54 -0800 (Tue, 23 Nov 2004) $
  */
-public final class GBeanInstance implements ManagedObject, StateManageable, EventProvider {
+public final class GBeanInstance implements StateManageable {
     private static final Log log = LogFactory.getLog(GBeanInstance.class);
 
     private static final int DESTROYED = 0;
@@ -422,22 +419,6 @@
      */
     public synchronized final void setEnabled(boolean enabled) {
         this.enabled = enabled;
-    }
-
-    public final boolean isStateManageable() {
-        return true;
-    }
-
-    public boolean isStatisticsProvider() {
-        return false;
-    }
-
-    public final boolean isEventProvider() {
-        return true;
-    }
-
-    public final String[] getEventTypes() {
-        return NotificationType.TYPES;
     }
 
     public synchronized final long getStartTime() {

Modified: geronimo/trunk/modules/management/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/project.xml?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/modules/management/project.xml (original)
+++ geronimo/trunk/modules/management/project.xml Sat Sep  3 23:23:14 2005
@@ -1,108 +1 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
-    Copyright 2004 The Apache Software Foundation
-
-    Licensed 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.
--->
-
-<!-- $Rev: 57362 $ $Date: 2004-11-10 15:40:05 -0500 (Wed, 10 Nov 2004) $ -->
-
-<project>
-    <pomVersion>3</pomVersion>
-    <extend>../../etc/project.xml</extend>
-
-    <!-- ===================== -->
-    <!-- Module Identification -->
-    <!-- ===================== -->
-
-    <name>Geronimo :: Management API</name>
-    <id>geronimo-management</id>
-    <shortDescription>Geronimo Management API</shortDescription>
-    <description>Contains interfaces that define the management API for
-      Geronimo</description>
-    <package>org.apache.geronimo.management</package>
-
-    <!-- ============ -->
-    <!-- Dependencies -->
-    <!-- ============ -->
-
-    <dependencies>
-        <!-- Module Dependencies -->
-<!--
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-kernel</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-common</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-system</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-deployment</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-service-builder</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-connector-builder</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-web-builder</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo</groupId>
-            <artifactId>geronimo-j2ee</artifactId>
-            <version>${pom.currentVersion}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>geronimo-spec</groupId>
-            <artifactId>geronimo-spec-j2ee-deployment</artifactId>
-            <version>${geronimo_spec_j2ee_deployment_version}</version>
-        </dependency>
--->
-    </dependencies>
-
-    <build>
-        <resources>
-        </resources>
-        <unitTest>
-            <includes>
-                <include>**/*Test.java</include>
-            </includes>
-        </unitTest>
-    </build>
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
<!--

    Copyright 2004 The Apache Software Foundation

    Licensed 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.
-->

<!-- $Rev: 57362 $ $Date: 2004-11-10 15:40:05 -0500 (Wed, 10 Nov 2004) $ -->

<project>
    <pomVersion>3</pomVersion>
    <extend>../../etc/project.xml</extend>

    <!-- ===================== -->
    <!-- Module Identification -->
    <!-- ===================== -->

    <name>Geronimo :: Management API</name>
    <id>geronimo
 -management</id>
    <shortDescription>Geronimo Management API</shortDescription>
    <description>Contains interfaces that define the management API for
      Geronimo</description>
    <package>org.apache.geronimo.management</package>

    <!-- ============ -->
    <!-- Dependencies -->
    <!-- ============ -->

    <dependencies>
        <!-- Module Dependencies -->
        <dependency>
            <groupId>geronimo-spec</groupId>
            <artifactId>geronimo-spec-j2ee-management</artifactId>
            <version>${geronimo_spec_j2ee_management_version}</version>
        </dependency>
    </dependencies>

    <build>
        <resources>
        </resources>
        <unitTest>
            <includes>
                <include>**/*Test.java</include>
            </includes>
        </unitTest>
    </build>
</project>
\ No newline at end of file

Copied: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/EventProvider.java (from r267473, geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/EventProvider.java)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/EventProvider.java?p2=geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/EventProvider.java&p1=geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/EventProvider.java&r1=267473&r2=278562&rev=278562&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/EventProvider.java (original)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/EventProvider.java Sat Sep  3 23:23:14 2005
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.kernel.management;
+package org.apache.geronimo.management;
 
 /**
  * This is a representation of the EventProvider type defined in the J2EE Management specification.

Copied: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/StatisticsProvider.java (from r267473, geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/StatisticsProvider.java)
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/StatisticsProvider.java?p2=geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/StatisticsProvider.java&p1=geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/StatisticsProvider.java&r1=267473&r2=278562&rev=278562&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/management/StatisticsProvider.java (original)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/StatisticsProvider.java Sat Sep  3 23:23:14 2005
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.kernel.management;
+package org.apache.geronimo.management;
 
 import javax.management.j2ee.statistics.Stats;
 

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,66 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.management.stats;
+
+import javax.management.j2ee.statistics.BoundaryStatistic;
+
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class BoundaryStatisticImpl extends StatisticImpl implements BoundaryStatistic {
+    private long upperBound;
+    private long lowerBound;
+
+    public BoundaryStatisticImpl(String name, String unit, String description) {
+        super(name, unit, description);
+    }
+
+    public BoundaryStatisticImpl(String name, String unit, String description, long lower, long upper) {
+        super(name, unit, description);
+        setBounds(lower, upper);
+    }
+
+    public long getUpperBound() {
+        return upperBound;
+    }
+
+    public long getLowerBound() {
+        return lowerBound;
+    }
+
+    public void setBounds(long value) {
+        if(value < lowerBound) {
+            lowerBound = value;
+        }
+        if(value > upperBound) {
+            upperBound = value;
+        }
+    }
+
+    public void setBounds(long lower, long upper) {
+        upperBound = upper;
+        lowerBound = lower;
+    }
+
+    public void setUpperBound(long upperBound) {
+        this.upperBound = upperBound;
+    }
+
+    public void setLowerBound(long lowerBound) {
+        this.lowerBound = lowerBound;
+    }
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundaryStatisticImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundedRangeImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundedRangeImpl.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundedRangeImpl.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundedRangeImpl.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,68 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.management.stats;
+
+import javax.management.j2ee.statistics.BoundedRangeStatistic;
+
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class BoundedRangeImpl extends RangeStatisticImpl implements BoundedRangeStatistic {
+    private long upperBound;
+    private long lowerBound;
+
+    public BoundedRangeImpl(String name, String unit, String description) {
+        super(name, unit, description);
+    }
+
+    public BoundedRangeImpl(String name, String unit, String description, long currentValue, long lowerBound, long upperBound) {
+        super(name, unit, description, currentValue);
+        this.upperBound = upperBound;
+        this.lowerBound = lowerBound;
+    }
+
+    public long getUpperBound() {
+        return upperBound;
+    }
+
+    public void setUpperBound(long upperBound) {
+        this.upperBound = upperBound;
+    }
+
+    public long getLowerBound() {
+        return lowerBound;
+    }
+
+    public void setLowerBound(long lowerBound) {
+        this.lowerBound = lowerBound;
+    }
+
+    public void setBounds(long lower, long upper) {
+        upperBound = upper;
+        lowerBound = lower;
+    }
+
+    public void setCurrent(long current) {
+        super.setCurrent(current);
+        if(current < lowerBound) {
+            lowerBound = current;
+        }
+        if(current > upperBound) {
+            upperBound = current;
+        }
+    }
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/BoundedRangeImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/CountStatisticImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/CountStatisticImpl.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/CountStatisticImpl.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/CountStatisticImpl.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,43 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.management.stats;
+
+import javax.management.j2ee.statistics.CountStatistic;
+
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class CountStatisticImpl extends StatisticImpl implements CountStatistic {
+    private long count;
+
+    public CountStatisticImpl(String name, String unit, String description) {
+        super(name, unit, description);
+    }
+
+    public CountStatisticImpl(String name, String unit, String description, long count) {
+        super(name, unit, description);
+        setCount(count);
+    }
+
+    public long getCount() {
+        return count;
+    }
+
+    public void setCount(long count) {
+        this.count = count;
+    }
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/CountStatisticImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/JVMStatsImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/JVMStatsImpl.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/JVMStatsImpl.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/JVMStatsImpl.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,63 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.management.stats;
+
+import javax.management.j2ee.statistics.JVMStats;
+import javax.management.j2ee.statistics.CountStatistic;
+import javax.management.j2ee.statistics.BoundedRangeStatistic;
+import javax.management.j2ee.statistics.Statistic;
+
+/**
+ * Geronimo implementation of the JSR-77 JVMStats interface.
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class JVMStatsImpl extends StatsImpl implements JVMStats {
+    private final CountStatisticImpl upTime;
+    private final BoundedRangeImpl heapSize;
+
+    public JVMStatsImpl() {
+        upTime = new CountStatisticImpl("JVM Up Time", Statistic.UNIT_TIME_MILLISECOND,
+                "The length of time that the JVM has been running", 0);
+        heapSize = new BoundedRangeImpl("JVM Heap Size", StatisticImpl.UNIT_MEMORY_BYTES,
+                "The memory usage of the JVM");
+        addStat("UpTime", upTime);
+        addStat("HeapSize", heapSize);
+    }
+
+    public CountStatistic getUpTime() {
+        return upTime;
+    }
+
+    public BoundedRangeStatistic getHeapSize() {
+        return heapSize;
+    }
+
+    /**
+     * Used to access the native implementation in order to call setters
+     */
+    public CountStatisticImpl getUpTimeImpl() {
+        return upTime;
+    }
+
+    /**
+     * Used to access the native implementation in order to call setters
+     */
+    public BoundedRangeImpl getHeapSizeImpl() {
+        return heapSize;
+    }
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/JVMStatsImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,67 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.management.stats;
+
+import javax.management.j2ee.statistics.RangeStatistic;
+
+/**
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class RangeStatisticImpl extends StatisticImpl implements RangeStatistic {
+    private long highWaterMark;
+    private long lowWaterMark;
+    private long current;
+
+    public RangeStatisticImpl(String name, String unit, String description) {
+        super(name, unit, description);
+    }
+
+    public RangeStatisticImpl(String name, String unit, String description, long currentValue) {
+        super(name, unit, description);
+        highWaterMark = lowWaterMark = current = currentValue;
+    }
+
+    public long getHighWaterMark() {
+        return highWaterMark;
+    }
+
+    public long getLowWaterMark() {
+        return lowWaterMark;
+    }
+
+    public long getCurrent() {
+        return current;
+    }
+
+    public void setCurrent(long current) {
+        this.current = current;
+        if(current < lowWaterMark) {
+            lowWaterMark = current;
+        }
+        if(current > highWaterMark) {
+            highWaterMark = current;
+        }
+    }
+
+    public void setHighWaterMark(long highWaterMark) {
+        this.highWaterMark = highWaterMark;
+    }
+
+    public void setLowWaterMark(long lowWaterMark) {
+        this.lowWaterMark = lowWaterMark;
+    }
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/RangeStatisticImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,81 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.management.stats;
+
+import java.io.Serializable;
+import javax.management.j2ee.statistics.Statistic;
+
+/**
+ * Implementation of the JSR-77 Statistic interface (JSR77.6.4)
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class StatisticImpl implements Statistic, Serializable {
+    // Units that are not defined in JSR-77
+    public final static String UNIT_MEMORY_BYTES = "BYTES";
+    public final static String UNIT_MEMORY_KILOBYTES = "KILOBYTES";
+    public final static String UNIT_MEMORY_MEGABYTES = "MEGABYTES";
+    public final static String UNIT_MEMORY_GIGABYTES = "GIGABYTES";
+
+    private String name;
+    private String unit;
+    private String description;
+    private long startTime;
+    private long lastSampleTime;
+
+    public StatisticImpl(String name, String unit, String description) {
+        this.name = name;
+        this.unit = unit;
+        this.description = description;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getUnit() {
+        return unit;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public long getStartTime() {
+        return startTime;
+    }
+
+    public void setStartTime() {
+        this.startTime = System.currentTimeMillis();
+    }
+
+    public void setStartTime(long startTime) {
+        this.startTime = startTime;
+    }
+
+    public long getLastSampleTime() {
+        return lastSampleTime;
+    }
+
+    public void setLastSampleTime(long lastSampleTime) {
+        this.lastSampleTime = lastSampleTime;
+    }
+
+    public void setLastSampleTime() {
+        this.lastSampleTime = System.currentTimeMillis();
+    }
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatisticImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatsImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatsImpl.java?rev=278562&view=auto
==============================================================================
--- geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatsImpl.java (added)
+++ geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatsImpl.java Sat Sep  3 23:23:14 2005
@@ -0,0 +1,59 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.geronimo.management.stats;
+
+import java.io.Serializable;
+import java.util.Map;
+import java.util.HashMap;
+import javax.management.j2ee.statistics.Stats;
+import javax.management.j2ee.statistics.Statistic;
+
+/**
+ * Geronimo implementation of the JSR-77 Stats interface.  Dynamically tracks
+ * available statistics for its subclasses, to make it easy to iterate
+ * available statistics without knowing exactly what kind of class you're
+ * looking at.  Not sure when you'd want to do that, but hey.
+ *
+ * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
+ */
+public class StatsImpl implements Stats, Serializable {
+    private final Map stats = new HashMap();
+
+    public StatsImpl() {
+    }
+
+    protected void addStat(String name, Statistic value) {
+        stats.put(name, value);
+    }
+
+    public Statistic getStatistic(String statisticName) {
+        return (Statistic)stats.get(statisticName);
+    }
+
+    public String[] getStatisticNames() {
+        return (String[]) stats.keySet().toArray(new String[stats.size()]);
+    }
+
+    public Statistic[] getStatistics() {
+        String[] names = getStatisticNames();
+        Statistic[] result = new Statistic[names.length];
+        for (int i = 0; i < names.length; i++) {
+            result[i] = (Statistic) stats.get(names[i]);
+        }
+        return result;
+    }
+}

Propchange: geronimo/trunk/modules/management/src/java/org/apache/geronimo/management/stats/StatsImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: geronimo/trunk/specs/j2ee-management/src/java/javax/management/j2ee/statistics/Statistic.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/specs/j2ee-management/src/java/javax/management/j2ee/statistics/Statistic.java?rev=278562&r1=278561&r2=278562&view=diff
==============================================================================
--- geronimo/trunk/specs/j2ee-management/src/java/javax/management/j2ee/statistics/Statistic.java (original)
+++ geronimo/trunk/specs/j2ee-management/src/java/javax/management/j2ee/statistics/Statistic.java Sat Sep  3 23:23:14 2005
@@ -30,6 +30,14 @@
  * @version $Rev$
  */
 public interface Statistic {
+    // Defined in JSR77.6.4.1.2
+    public final static String UNIT_TIME_HOUR = "HOUR";
+    public final static String UNIT_TIME_MINUTE = "MINUTE";
+    public final static String UNIT_TIME_SECOND = "SECOND";
+    public final static String UNIT_TIME_MILLISECOND = "MILLISECOND";
+    public final static String UNIT_TIME_MICROSECOND = "MICROSECOND";
+    public final static String UNIT_TIME_NANOSECOND = "NANOSECOND";
+
     public String getName();
 
     public String getUnit();



Mime
View raw message