geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ammul...@apache.org
Subject svn commit: r224444 - in /geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management: geronimo/JVM.java impl/JVMImpl.java
Date Sat, 23 Jul 2005 05:05:50 GMT
Author: ammulder
Date: Fri Jul 22 22:05:47 2005
New Revision: 224444

URL: http://svn.apache.org/viewcvs?rev=224444&view=rev
Log:
Enhance our JVM API a bit so it can service the server info portlets.

Modified:
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/geronimo/JVM.java
    geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/impl/JVMImpl.java

Modified: geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/geronimo/JVM.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/geronimo/JVM.java?rev=224444&r1=224443&r2=224444&view=diff
==============================================================================
--- geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/geronimo/JVM.java
(original)
+++ geronimo/trunk/modules/j2ee/src/java/org/apache/geronimo/j2ee/management/geronimo/JVM.java
Fri Jul 22 22:05:47 2005
@@ -17,6 +17,9 @@
 
 package org.apache.geronimo.j2ee.management.geronimo;
 
+import java.util.Date;
+import java.util.Properties;
+
 /**
  *
  *
@@ -27,4 +30,7 @@
     long getTotalMemory();
     long getMaxMemory();
     int getAvailableProcessors();
+
+    Date getKernelBootTime();
+    Properties getSystemProperties();
 }

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=224444&r1=224443&r2=224444&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
Fri Jul 22 22:05:47 2005
@@ -19,11 +19,14 @@
 
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.Date;
+import java.util.Properties;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.geronimo.JVM;
+import org.apache.geronimo.kernel.Kernel;
 
 /**
  *
@@ -47,9 +50,11 @@
     }
 
     private final String objectName;
+    private final Kernel kernel;
 
-    public JVMImpl(String objectName) {
+    public JVMImpl(String objectName, Kernel kernel) {
         this.objectName = objectName;
+        this.kernel = kernel;
     }
 
     public String getObjectName() {
@@ -115,21 +120,23 @@
         return runtime.availableProcessors();
     }
 
+    public Date getKernelBootTime() {
+        return kernel.getBootTime();
+    }
+
+    public Properties getSystemProperties() {
+        return System.getProperties();
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(JVMImpl.class, NameFactory.JVM);
 
-        infoFactory.addAttribute("objectName", String.class, false);
-        infoFactory.addAttribute("javaVersion", String.class, false);
-        infoFactory.addAttribute("javaVendor", String.class, false);
-        infoFactory.addAttribute("node", String.class, false);
-        infoFactory.addAttribute("freeMemory", Long.TYPE, false);
-        infoFactory.addAttribute("maxMemory", Long.TYPE, false);
-        infoFactory.addAttribute("totalMemory", Long.TYPE, false);
-        infoFactory.addAttribute("availableProcessors", Integer.TYPE, false);
+//        infoFactory.addAttribute("objectName", String.class, false);
+        infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addInterface(JVM.class);
-        infoFactory.setConstructor(new String[] {"objectName"});
+        infoFactory.setConstructor(new String[] {"objectName", "kernel"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 



Mime
View raw message