geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jboy...@apache.org
Subject svn commit: rev 55978 - geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel
Date Fri, 29 Oct 2004 15:01:06 GMT
Author: jboynes
Date: Fri Oct 29 08:01:04 2004
New Revision: 55978

Modified:
   geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
   geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/KernelMBean.java
Log:
added method to access the time the kernel was started

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java	(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java	Fri Oct
29 08:01:04 2004
@@ -27,6 +27,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Date;
 import javax.management.Attribute;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
@@ -86,6 +87,7 @@
 
     private Log log;
     private boolean running;
+    private Date bootTime;
     private MBeanServer mbServer;
     private LinkedList shutdownHooks = new LinkedList();
 
@@ -392,6 +394,7 @@
         if (running) {
             return;
         }
+        bootTime = new Date();
         log = LogFactory.getLog(Kernel.class.getName());
         log.info("Starting boot");
 
@@ -414,6 +417,10 @@
 
         running = true;
         log.info("Booted");
+    }
+
+    public Date getBootTime() {
+        return bootTime;
     }
 
     public void registerShutdownHook(Runnable hook) {

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/KernelMBean.java
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/KernelMBean.java	(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/KernelMBean.java	Fri
Oct 29 08:01:04 2004
@@ -21,6 +21,7 @@
 import java.net.URI;
 import java.util.List;
 import java.util.Set;
+import java.util.Date;
 import javax.management.InstanceAlreadyExistsException;
 import javax.management.InstanceNotFoundException;
 import javax.management.MBeanServer;
@@ -37,6 +38,12 @@
  * @version $Rev$ $Date$
  */
 public interface KernelMBean {
+    /**
+     * Returns the time this kernel was last booted.
+     * @return the time this kernel was last booted; null if the kernel has not been 
+     */
+    Date getBootTime();
+
     /**
      * Get the MBeanServer used by this kernel
      *

Mime
View raw message