commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r696331 - in /commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring: ./ impl/repositories/ support/java13/java/lang/management/
Date Wed, 17 Sep 2008 14:50:58 GMT
Author: nicolas
Date: Wed Sep 17 07:50:57 2008
New Revision: 696331

URL: http://svn.apache.org/viewvc?rev=696331&view=rev
Log:
fix java 1.3 compatibility issue

Modified:
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/ConfigurableImplementationsRepository.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ManagementFactory_.java
    commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ThreadMXBean_.java

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java?rev=696331&r1=696330&r2=696331&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Metric.java
Wed Sep 17 07:50:57 2008
@@ -17,6 +17,8 @@
 
 package org.apache.commons.monitoring;
 
+import java.util.EventListener;
+
 
 /**
  * A <code>Metric</code> is a numerical indicator of some monitored
@@ -100,6 +102,7 @@
      * Listener for Metric events
      */
     public static interface Listener
+        extends EventListener
     {
         void onValueChanged( Metric value, long l );
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java?rev=696331&r1=696330&r2=696331&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Monitor.java
Wed Sep 17 07:50:57 2008
@@ -18,6 +18,7 @@
 package org.apache.commons.monitoring;
 
 import java.util.Collection;
+import java.util.EventListener;
 
 /**
  * A <code>Monitor</code> is an abstraction of some application resource that
is instrumented with a set of indicators
@@ -257,6 +258,7 @@
      * Listener interface to get notified on montor events
      */
     public static interface Listener
+    extends EventListener
     {
         void onMetricRegistered( Metric metric );
     }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java?rev=696331&r1=696330&r2=696331&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/Repository.java
Wed Sep 17 07:50:57 2008
@@ -18,6 +18,7 @@
 package org.apache.commons.monitoring;
 
 import java.util.Collection;
+import java.util.EventListener;
 import java.util.Set;
 
 /**
@@ -77,6 +78,7 @@
      * Listener interface to get notified on repository events
      */
     public static interface Listener
+        extends EventListener
     {
         /**
          * A monitor has just been created. Can be used to add custom Metrics or

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/ConfigurableImplementationsRepository.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/ConfigurableImplementationsRepository.java?rev=696331&r1=696330&r2=696331&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/ConfigurableImplementationsRepository.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/impl/repositories/ConfigurableImplementationsRepository.java
Wed Sep 17 07:50:57 2008
@@ -18,6 +18,7 @@
 package org.apache.commons.monitoring.impl.repositories;
 
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
 
 import org.apache.commons.monitoring.Monitor;
 import org.apache.commons.monitoring.StopWatch;
@@ -83,6 +84,10 @@
         {
             return monitorConstructor.newInstance( key );
         }
+        catch ( InvocationTargetException e )
+        {
+            throw new IllegalStateException( "Failed to user configured stopWatchConstructor
", e.getTargetException() );
+        }
         catch ( Exception e )
         {
             throw new IllegalStateException( "Invalid stopWatchConstructor configured in
repository "
@@ -101,10 +106,14 @@
         {
             return stopWatchConstructor.newInstance( monitor );
         }
+        catch ( InvocationTargetException e )
+        {
+            throw new IllegalStateException( "Failed to user configured stopWatchConstructor
", e.getTargetException() );
+        }
         catch ( Exception e )
         {
             throw new IllegalStateException( "Invalid stopWatchConstructor configured in
repository "
-                + stopWatchConstructor );
+                + stopWatchConstructor, e );
         }
     }
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ManagementFactory_.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ManagementFactory_.java?rev=696331&r1=696330&r2=696331&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ManagementFactory_.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ManagementFactory_.java
Wed Sep 17 07:50:57 2008
@@ -25,6 +25,14 @@
 {
     public static ThreadMXBean_ getThreadMXBean()
     {
-        return ThreadMXBean_.instance;
+        return instance;
     }
+
+    private static ThreadMXBean_ instance = new ThreadMXBean_()
+    {
+        public boolean isCurrentThreadCpuTimeSupported()
+        {
+            return false;
+        }
+    };
 }

Modified: commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ThreadMXBean_.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ThreadMXBean_.java?rev=696331&r1=696330&r2=696331&view=diff
==============================================================================
--- commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ThreadMXBean_.java
(original)
+++ commons/sandbox/monitoring/trunk/src/main/java/org/apache/commons/monitoring/support/java13/java/lang/management/ThreadMXBean_.java
Wed Sep 17 07:50:57 2008
@@ -21,12 +21,7 @@
  *
  * @author <a href="mailto:nicolas@apache.org">Nicolas De Loof</a>
  */
-public class ThreadMXBean_
+public interface ThreadMXBean_
 {
-    static ThreadMXBean_ instance = new ThreadMXBean_();
-
-    public static boolean isCurrentThreadCpuTimeSupported( ThreadMXBean_ mx )
-    {
-        return false;
-    }
+    boolean isCurrentThreadCpuTimeSupported();
 }



Mime
View raw message