commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nico...@apache.org
Subject svn commit: r745851 - /commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/monitors/AbstractMonitor.java
Date Thu, 19 Feb 2009 13:19:41 GMT
Author: nicolas
Date: Thu Feb 19 13:19:41 2009
New Revision: 745851

URL: http://svn.apache.org/viewvc?rev=745851&view=rev
Log:
fix retreive metrics by name / role

Modified:
    commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/monitors/AbstractMonitor.java

Modified: commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/monitors/AbstractMonitor.java
URL: http://svn.apache.org/viewvc/commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/monitors/AbstractMonitor.java?rev=745851&r1=745850&r2=745851&view=diff
==============================================================================
--- commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/monitors/AbstractMonitor.java
(original)
+++ commons/sandbox/monitoring/branches/modules/core/src/main/java/org/apache/commons/monitoring/monitors/AbstractMonitor.java
Thu Feb 19 13:19:41 2009
@@ -36,7 +36,6 @@
 public abstract class AbstractMonitor implements Monitor
 {
 
-    @SuppressWarnings("unchecked")
     private final ConcurrentMap<Role, Metric> metrics;
     private final Key key;
 
@@ -53,7 +52,6 @@
      *
      * @return the ConcurrentMap implementation to use for storing metrics
      */
-    @SuppressWarnings("unchecked")
     protected ConcurrentHashMap<Role, Metric> createConcurrentMap()
     {
         return new ConcurrentHashMap<Role, Metric>();
@@ -72,7 +70,7 @@
      */
     public final Metric getMetric( String role )
     {
-        return metrics.get( role );
+        return metrics.get( Role.getRole( role ) );
     }
 
     public final Metric getMetric( Role role )
@@ -80,7 +78,6 @@
         return metrics.get( role );
     }
 
-    @SuppressWarnings("unchecked")
     public final Collection<Role> getRoles()
     {
         return Collections.unmodifiableCollection( metrics.keySet() );
@@ -115,13 +112,11 @@
         }
     }
 
-    @SuppressWarnings("unchecked")
     public Counter getCounter( String role )
     {
         return getCounter( Role.getRole( role ) );
     }
 
-    @SuppressWarnings("unchecked")
     public Gauge getGauge( String role )
     {
         return getGauge( Role.getRole( role ) );



Mime
View raw message