db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r632448 - in /db/derby/code/trunk/java/drda/org/apache/derby: impl/drda/NetworkServerMBeanImpl.java mbeans/drda/NetworkServerMBean.java
Date Fri, 29 Feb 2008 21:28:16 GMT
Author: djd
Date: Fri Feb 29 13:28:14 2008
New Revision: 632448

URL: http://svn.apache.org/viewvc?rev=632448&view=rev
Log:
DERBY-3435 Add StartTime and Uptime attributes to NetworkServerMBean, identical to the Runtime
platform MBean.

Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java
    db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java?rev=632448&r1=632447&r2=632448&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerMBeanImpl.java Fri
Feb 29 13:28:14 2008
@@ -45,8 +45,11 @@
     /* The instrumented server implementation */
     private NetworkServerControlImpl server;
     
+    private final long startTime;
+    
     NetworkServerMBeanImpl(NetworkServerControlImpl nsc) {
         this.server = nsc;
+        startTime = System.currentTimeMillis();
     }
 
     // Some of the code is disabled (commented out) due to security concerns,
@@ -258,6 +261,21 @@
         }
         return sentResult;
     }
+    
+    /**
+     * Return start time.
+     */
+    public long getStartTime() {
+        return startTime;
+    }
+
+    /**
+     * Return time server has been running.
+     */
+    public long getUptime() {
+        return System.currentTimeMillis() - startTime;
+        
+    }
 
     // ------------------------- MBEAN OPERATIONS  ----------------------------
     
@@ -360,5 +378,4 @@
    private String getServerProperty(String property) {
         return server.getPropertyValues().getProperty(property);     
    }
-
 }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java?rev=632448&r1=632447&r2=632448&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/mbeans/drda/NetworkServerMBean.java Fri
Feb 29 13:28:14 2008
@@ -189,6 +189,19 @@
     
     public int getBytesSentPerSecond();
     
+    /**
+     * Return the start time of the network server.
+     * @return Time in milli-seconds since the epoch that the network server started.
+     * @see System#currentTimeMillis()
+     */
+    public long getStartTime();
+    
+    /**
+     * Return the time the network server has been running.
+     * @return Time in milli-seconds the server has been running.
+     */
+    public long getUptime(); 
+    
     
     
     // ---



Mime
View raw message