geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akulshresh...@apache.org
Subject svn commit: r603614 - in /geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor: MasterRemoteControl.java snapshot/SnapshotProcessor.java
Date Wed, 12 Dec 2007 13:59:31 GMT
Author: akulshreshtha
Date: Wed Dec 12 05:59:30 2007
New Revision: 603614

URL: http://svn.apache.org/viewvc?rev=603614&view=rev
Log:
GERONIMO-3697 Fix tag used for TimeStatistics
              Turn off annoying 'could not turn Stats on for ...' message

Modified:
    geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MasterRemoteControl.java
    geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java

Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MasterRemoteControl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MasterRemoteControl.java?rev=603614&r1=603613&r2=603614&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MasterRemoteControl.java
(original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MasterRemoteControl.java
Wed Dec 12 05:59:30 2007
@@ -16,14 +16,6 @@
  */
 package org.apache.geronimo.monitor;
 
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.Statement;
-import java.sql.SQLException;
-import javax.naming.NamingException;
-import javax.sql.DataSource;
-
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -33,50 +25,36 @@
 import java.util.Set;
 import java.util.TreeMap;
 
-import javax.annotation.Resource;
 import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
+import javax.annotation.Resource;
 import javax.annotation.security.PermitAll;
 import javax.annotation.security.RolesAllowed;
-import javax.annotation.security.RunAs;
 import javax.ejb.Local;
 import javax.ejb.Remote;
 import javax.ejb.Stateless;
 import javax.ejb.Timeout;
 import javax.ejb.Timer;
-import javax.ejb.TimedObject;
 import javax.ejb.TimerService;
-
 import javax.management.Attribute;
 import javax.management.MBeanServer;
 import javax.management.MBeanServerFactory;
 import javax.management.ObjectName;
 import javax.management.j2ee.Management;
 import javax.management.j2ee.ManagementHome;
-import javax.management.j2ee.statistics.BoundedRangeStatistic;
-import javax.management.j2ee.statistics.RangeStatistic;
-import javax.management.j2ee.statistics.Stats;
 import javax.management.j2ee.statistics.CountStatistic;
+import javax.management.j2ee.statistics.RangeStatistic;
 import javax.management.j2ee.statistics.Statistic;
+import javax.management.j2ee.statistics.Stats;
 import javax.management.j2ee.statistics.TimeStatistic;
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.sql.DataSource;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.GBeanLifecycle;
-
-import org.apache.geronimo.monitor.MBeanHelper;
-
-import org.apache.geronimo.management.geronimo.stats.WebModuleStats;
-import org.apache.geronimo.management.stats.WebModuleStatsImpl;
+import org.apache.geronimo.monitor.snapshot.SnapshotConfigXMLBuilder;
 import org.apache.geronimo.monitor.snapshot.SnapshotDBHelper;
 import org.apache.geronimo.monitor.snapshot.SnapshotProcessor;
-import org.apache.geronimo.monitor.snapshot.SnapshotConfigXMLBuilder; 
 
 /**
  * This is a Stateful Session Bean that will be the bottleneck for the communication
@@ -483,7 +461,7 @@
                     } else if(aStat instanceof CountStatistic) {
                         mbeanStatsList.add(stts[i].getName());
                     } else if(aStat instanceof TimeStatistic) {
-                        mbeanStatsList.add(stts[i].getName() + " CurrentTime");
+                        mbeanStatsList.add(stts[i].getName() + " Count");
                         mbeanStatsList.add(stts[i].getName() + " MaxTime");
                         mbeanStatsList.add(stts[i].getName() + " MinTime");
                         mbeanStatsList.add(stts[i].getName() + " TotalTime");

Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java?rev=603614&r1=603613&r2=603614&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java
(original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java
Wed Dec 12 05:59:30 2007
@@ -17,6 +17,7 @@
 package org.apache.geronimo.monitor.snapshot;
 
 import java.io.File;
+import java.lang.reflect.UndeclaredThrowableException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -108,12 +109,11 @@
                 ObjectName objName = new ObjectName(mbeanList.get(i));
                 mrc.invoke(objName, methodName, params, signatures);
                 log.info("Stats for " + mbeanList.get(i) + " was turned on.");
-            } catch(MalformedObjectNameException e) {
-                log.error(e.getMessage(), e);
-            } catch(Exception e) {
-                // an exception will be thrown if the methodName is not found for this class,
-                // which is very possible.
-                log.warn("Could not turn on stats for " + mbeanList.get(i));
+            }catch (UndeclaredThrowableException e) {
+        	// HACK : this will happen for components that always collect statistics
+        	// and do not have StatsOn method.
+            } catch(Exception e) { 
+        	log.error(e.getMessage(), e);
             }
         }
     }



Mime
View raw message