You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ak...@apache.org on 2007/12/16 17:11:32 UTC
svn commit: r604644 [1/4] - in /geronimo/sandbox/monitoring: ./ agent-ds/
agent-ear/ agent-ejb/ agent-ejb/src/main/java/org/apache/geronimo/monitor/
agent-ejb/src/main/java/org/apache/geronimo/monitoring/
agent-ejb/src/main/java/org/apache/geronimo/mon...
Author: akulshreshtha
Date: Sun Dec 16 08:11:29 2007
New Revision: 604644
URL: http://svn.apache.org/viewvc?rev=604644&view=rev
Log:
GERONIMO-3697 Pom dependency pruning, clean up and beautification
Added:
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/
- copied from r604639, geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitor/
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java (with props)
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java (with props)
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MonitoringPortlet.java (with props)
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/StatsGraph.java (with props)
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/util/
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/util/DBManager.java (with props)
Removed:
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitor/
geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/plugins/
Modified:
geronimo/sandbox/monitoring/agent-ds/pom.xml
geronimo/sandbox/monitoring/agent-ear/pom.xml
geronimo/sandbox/monitoring/agent-ejb/pom.xml
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MBeanHelper.java
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControl.java
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlLocal.java
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlRemote.java
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotDBHelper.java
geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotProcessor.java
geronimo/sandbox/monitoring/agent-sql/pom.xml
geronimo/sandbox/monitoring/agent/pom.xml
geronimo/sandbox/monitoring/mconsole-ds/pom.xml
geronimo/sandbox/monitoring/mconsole-ear/pom.xml
geronimo/sandbox/monitoring/mconsole-jetty/pom.xml
geronimo/sandbox/monitoring/mconsole-tomcat/pom.xml
geronimo/sandbox/monitoring/mconsole-war/pom.xml
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/portlet.xml
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddGraph.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddServer.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringAddView.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditGraph.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditServer.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringEditView.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringGraphs.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringNormal.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringPage.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringServers.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViewServer.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/WEB-INF/view/monitoringViews.jsp
geronimo/sandbox/monitoring/mconsole-war/src/main/webapp/monitoringPopUpGraph.jsp
geronimo/sandbox/monitoring/pom.xml
Modified: geronimo/sandbox/monitoring/agent-ds/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ds/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ds/pom.xml (original)
+++ geronimo/sandbox/monitoring/agent-ds/pom.xml Sun Dec 16 08:11:29 2007
@@ -18,9 +18,12 @@
<!-- $Rev$ $Date$ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.geronimo.plugins.monitoring</groupId>
<artifactId>monitoring</artifactId>
@@ -50,10 +53,10 @@
<type>car</type>
</dependency>
<dependency>
- <groupId>org.apache.geronimo.plugins.monitoring</groupId>
- <artifactId>agent-sql</artifactId>
- <version>${monitoringConsoleVersion}</version>
- </dependency>
+ <groupId>org.apache.geronimo.plugins.monitoring</groupId>
+ <artifactId>agent-sql</artifactId>
+ <version>${monitoringConsoleVersion}</version>
+ </dependency>
</dependencies>
<build>
@@ -70,7 +73,6 @@
<module>
<groupId>org.tranql</groupId>
<artifactId>tranql-connector-derby-embed-local</artifactId>
- <!-- <version>1.3</version> -->
<type>rar</type>
</module>
</configuration>
Modified: geronimo/sandbox/monitoring/agent-ear/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ear/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ear/pom.xml (original)
+++ geronimo/sandbox/monitoring/agent-ear/pom.xml Sun Dec 16 08:11:29 2007
@@ -50,8 +50,8 @@
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<configuration>
- <displayName>Geronimo Sample EAR for MRC</displayName>
- <description>Geronimo Sample EAR for MRC</description>
+ <displayName>Geronimo Monitoring Agent EAR </displayName>
+ <description>Geronimo Monitoring Agent EAR</description>
<version>5</version>
<modules>
<ejbModule>
@@ -69,7 +69,6 @@
</plugin>
</plugins>
</build>
-
</project>
Modified: geronimo/sandbox/monitoring/agent-ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/pom.xml (original)
+++ geronimo/sandbox/monitoring/agent-ejb/pom.xml Sun Dec 16 08:11:29 2007
@@ -64,7 +64,6 @@
<version>1.0.4</version>
</dependency> -->
</dependencies>
-
</project>
Modified: geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MBeanHelper.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MBeanHelper.java?rev=604644&r1=604639&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MBeanHelper.java (original)
+++ geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MBeanHelper.java Sun Dec 16 08:11:29 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.monitor;
+package org.apache.geronimo.monitoring;
import java.net.URI;
import java.util.HashSet;
Modified: geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControl.java?rev=604644&r1=604639&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControl.java (original)
+++ geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControl.java Sun Dec 16 08:11:29 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.monitor;
+package org.apache.geronimo.monitoring;
import java.util.ArrayList;
import java.util.Collection;
@@ -52,9 +52,9 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-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.monitoring.snapshot.SnapshotConfigXMLBuilder;
+import org.apache.geronimo.monitoring.snapshot.SnapshotDBHelper;
+import org.apache.geronimo.monitoring.snapshot.SnapshotProcessor;
/**
* This is a Stateful Session Bean that will be the bottleneck for the communication
@@ -296,7 +296,7 @@
@RolesAllowed("mejbuser")
public ArrayList<HashMap<String, HashMap<String, Object>>> fetchSnapshotData(Integer numberOfSnapshot, Integer everyNthSnapshot) {
ArrayList<HashMap<String, HashMap<String, Object>>> retval =
- (ArrayList<HashMap<String, HashMap<String, Object>>>)org.apache.geronimo.monitor.snapshot.SnapshotDBHelper.fetchData(numberOfSnapshot, everyNthSnapshot);
+ (ArrayList<HashMap<String, HashMap<String, Object>>>)org.apache.geronimo.monitoring.snapshot.SnapshotDBHelper.fetchData(numberOfSnapshot, everyNthSnapshot);
return retval;
}
@@ -310,7 +310,7 @@
@RolesAllowed("mejbuser")
public HashMap<String, HashMap<String, Long>> fetchMaxSnapshotData(Integer numberOfSnapshot) {
HashMap<String, HashMap<String, Long>> retval =
- (HashMap<String, HashMap<String, Long>>)org.apache.geronimo.monitor.snapshot.SnapshotDBHelper.fetchMaxSnapshotData(numberOfSnapshot);
+ (HashMap<String, HashMap<String, Long>>)org.apache.geronimo.monitoring.snapshot.SnapshotDBHelper.fetchMaxSnapshotData(numberOfSnapshot);
return retval;
}
@@ -324,7 +324,7 @@
@RolesAllowed("mejbuser")
public HashMap<String, HashMap<String, Long>> fetchMinSnapshotData(Integer numberOfSnapshot) {
HashMap<String, HashMap<String, Long>> retval =
- (HashMap<String, HashMap<String, Long>>)org.apache.geronimo.monitor.snapshot.SnapshotDBHelper.fetchMinSnapshotData(numberOfSnapshot);
+ (HashMap<String, HashMap<String, Long>>)org.apache.geronimo.monitoring.snapshot.SnapshotDBHelper.fetchMinSnapshotData(numberOfSnapshot);
return retval;
}
@@ -373,7 +373,7 @@
@RolesAllowed("mejbuser")
public Long getSnapshotCount() {
- return org.apache.geronimo.monitor.snapshot.SnapshotDBHelper.getSnapshotCount();
+ return org.apache.geronimo.monitoring.snapshot.SnapshotDBHelper.getSnapshotCount();
}
/**
Modified: geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlLocal.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlLocal.java?rev=604644&r1=604639&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlLocal.java (original)
+++ geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlLocal.java Sun Dec 16 08:11:29 2007
@@ -1,4 +1,4 @@
-package org.apache.geronimo.monitor;
+package org.apache.geronimo.monitoring;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
Modified: geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlRemote.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlRemote.java?rev=604644&r1=604639&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlRemote.java (original)
+++ geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/MasterRemoteControlRemote.java Sun Dec 16 08:11:29 2007
@@ -1,4 +1,4 @@
-package org.apache.geronimo.monitor;
+package org.apache.geronimo.monitoring;
/**
* Licensed to the Apache Software Foundation (ASF) under one or more
Modified: geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java?rev=604644&r1=604639&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java (original)
+++ geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotConfigXMLBuilder.java Sun Dec 16 08:11:29 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.monitor.snapshot;
+package org.apache.geronimo.monitoring.snapshot;
import java.io.File;
import java.io.FileInputStream;
Modified: geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotDBHelper.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotDBHelper.java?rev=604644&r1=604639&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotDBHelper.java (original)
+++ geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotDBHelper.java Sun Dec 16 08:11:29 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.monitor.snapshot;
+package org.apache.geronimo.monitoring.snapshot;
import java.sql.Connection;
import java.sql.DriverManager;
Modified: geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotProcessor.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotProcessor.java?rev=604644&r1=604639&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotProcessor.java (original)
+++ geronimo/sandbox/monitoring/agent-ejb/src/main/java/org/apache/geronimo/monitoring/snapshot/SnapshotProcessor.java Sun Dec 16 08:11:29 2007
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.geronimo.monitor.snapshot;
+package org.apache.geronimo.monitoring.snapshot;
import java.io.File;
import java.lang.reflect.UndeclaredThrowableException;
@@ -24,16 +24,14 @@
import java.util.Properties;
import java.util.Set;
+import javax.management.ObjectName;
import javax.naming.Context;
import javax.naming.InitialContext;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import org.apache.geronimo.monitor.MasterRemoteControlLocal;
-import org.apache.geronimo.monitor.MBeanHelper;
+import org.apache.geronimo.monitoring.MBeanHelper;
+import org.apache.geronimo.monitoring.MasterRemoteControlLocal;
/**
* Thread that is in charge of executing every x milliseconds. Upon each
Modified: geronimo/sandbox/monitoring/agent-sql/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent-sql/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent-sql/pom.xml (original)
+++ geronimo/sandbox/monitoring/agent-sql/pom.xml Sun Dec 16 08:11:29 2007
@@ -15,7 +15,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.geronimo.plugins.monitoring</groupId>
Modified: geronimo/sandbox/monitoring/agent/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/agent/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/agent/pom.xml (original)
+++ geronimo/sandbox/monitoring/agent/pom.xml Sun Dec 16 08:11:29 2007
@@ -18,9 +18,12 @@
<!-- $Rev$ $Date$ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.geronimo.plugins.monitoring</groupId>
<artifactId>monitoring</artifactId>
@@ -59,7 +62,6 @@
<build>
<plugins>
<plugin>
-
<groupId>org.apache.geronimo.plugins</groupId>
<artifactId>car-maven-plugin</artifactId>
<configuration>
Modified: geronimo/sandbox/monitoring/mconsole-ds/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mconsole-ds/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mconsole-ds/pom.xml (original)
+++ geronimo/sandbox/monitoring/mconsole-ds/pom.xml Sun Dec 16 08:11:29 2007
@@ -18,9 +18,12 @@
<!-- $Rev: 592158 $ $Date: 2007-11-05 16:46:54 -0500 (Mon, 05 Nov 2007) $ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<parent>
<groupId>org.apache.geronimo.plugins.monitoring</groupId>
<artifactId>monitoring</artifactId>
@@ -28,7 +31,6 @@
<relativePath>../pom.xml</relativePath>
</parent>
-
<groupId>org.apache.geronimo.plugins</groupId>
<artifactId>mconsole-ds</artifactId>
<name>Geronimo Plugins :: Monitoring Console :: DataSource</name>
@@ -55,7 +57,6 @@
<build>
<plugins>
<plugin>
-
<groupId>org.apache.geronimo.plugins</groupId>
<artifactId>car-maven-plugin</artifactId>
<configuration>
@@ -66,7 +67,6 @@
<module>
<groupId>org.tranql</groupId>
<artifactId>tranql-connector-derby-embed-local</artifactId>
- <!-- <version>1.3</version> -->
<type>rar</type>
</module>
</configuration>
Modified: geronimo/sandbox/monitoring/mconsole-ear/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mconsole-ear/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mconsole-ear/pom.xml (original)
+++ geronimo/sandbox/monitoring/mconsole-ear/pom.xml Sun Dec 16 08:11:29 2007
@@ -18,7 +18,9 @@
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
Modified: geronimo/sandbox/monitoring/mconsole-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mconsole-jetty/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mconsole-jetty/pom.xml (original)
+++ geronimo/sandbox/monitoring/mconsole-jetty/pom.xml Sun Dec 16 08:11:29 2007
@@ -18,7 +18,9 @@
<!-- $Rev: 592158 $ $Date: 2007-11-05 16:46:54 -0500 (Mon, 05 Nov 2007) $ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -55,14 +57,7 @@
<version>${monitoringConsoleVersion}</version>
<type>ear</type>
</dependency>
-<!--
- <dependency>
- <groupId>org.apache.geronimo.configs</groupId>
- <artifactId>jetty6</artifactId>
- <version>${geronimoVersion}</version>
- <type>car</type>
- </dependency>
--->
+
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
<artifactId>dojo-jetty6</artifactId>
Modified: geronimo/sandbox/monitoring/mconsole-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mconsole-tomcat/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mconsole-tomcat/pom.xml (original)
+++ geronimo/sandbox/monitoring/mconsole-tomcat/pom.xml Sun Dec 16 08:11:29 2007
@@ -18,7 +18,9 @@
<!-- $Rev: 592158 $ $Date: 2007-11-05 16:46:54 -0500 (Mon, 05 Nov 2007) $ -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -62,20 +64,14 @@
<version>${geronimoVersion}</version>
<type>car</type>
</dependency>
-<!--
- <dependency>
- <groupId>org.apache.geronimo.configs</groupId>
- <artifactId>tomcat6</artifactId>
- <version>${geronimoVersion}</version>
- <type>car</type>
- </dependency>
--->
+
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
<artifactId>dojo-tomcat</artifactId>
<version>${geronimoVersion}</version>
<type>car</type>
</dependency>
+
<!-- see if openejb-client can be used -->
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
@@ -88,7 +84,6 @@
<build>
<plugins>
<plugin>
-
<groupId>org.apache.geronimo.plugins</groupId>
<artifactId>car-maven-plugin</artifactId>
<configuration>
Modified: geronimo/sandbox/monitoring/mconsole-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mconsole-war/pom.xml?rev=604644&r1=604643&r2=604644&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mconsole-war/pom.xml (original)
+++ geronimo/sandbox/monitoring/mconsole-war/pom.xml Sun Dec 16 08:11:29 2007
@@ -18,7 +18,9 @@
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -34,13 +36,8 @@
<packaging>war</packaging>
<description>Geronimo Monitorin Console :: WEB Module</description>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.plugins</groupId>
- <artifactId>console-core</artifactId>
- </dependency>
+ <dependencies>
<dependency>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-management</artifactId>
@@ -50,7 +47,7 @@
<dependency>
<groupId>org.directwebremoting</groupId>
<artifactId>dwr</artifactId>
- <version>2.0.1</version>
+ <version>2.0.1</version>
</dependency>
<dependency>
@@ -63,14 +60,14 @@
<groupId>javax.annotation</groupId>
<artifactId>jsr250-api</artifactId>
<scope>provided</scope>
- </dependency>
+ </dependency>
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<scope>provided</scope>
</dependency>
-
+
<dependency>
<groupId>org.apache.geronimo.plugins.monitoring</groupId>
<artifactId>agent-ejb</artifactId>
Added: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java?rev=604644&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java (added)
+++ geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java Sun Dec 16 08:11:29 2007
@@ -0,0 +1,236 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.monitoring.console;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.Statement;
+import java.text.DecimalFormat;
+import java.text.Format;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.TreeMap;
+
+import org.apache.geronimo.monitoring.console.util.DBManager;
+
+public class GraphsBuilder {
+ private String ip = new String();
+ private int timeFrame;
+ private int snapCount;
+ private MRCConnector mrc = new MRCConnector();
+ private Connection con;
+
+ // constructor
+ public GraphsBuilder(Connection con) {
+ // TODO: Database pull stuff may go here... based on server ID...\
+ this.con = con;
+ }
+
+ public StatsGraph buildOneDB(int graph_id) throws Exception {
+ con = (new DBManager()).getConnection();
+ StatsGraph graph = null;
+ PreparedStatement pStmt = null;
+ ResultSet rsServer = null;
+ pStmt = con
+ .prepareStatement("SELECT * from graphs WHERE enabled=1 AND graph_id="
+ + graph_id);
+ ResultSet rs = pStmt.executeQuery();
+ if (rs.next()) {
+ String mBeanName = rs.getString("mbean");
+ String dataName1 = rs.getString("dataname1");
+ String dataName2 = rs.getString("dataname2");
+ String graphName1 = rs.getString("dataname1");
+ String graphName2 = rs.getString("dataname2");
+ timeFrame = rs.getInt("timeframe");
+ String server_id = rs.getString("server_id");
+ String xlabel = rs.getString("xlabel");
+ String ylabel = rs.getString("ylabel");
+ String data1operation = rs.getString("data1operation");
+ String data2operation = rs.getString("data2operation");
+ String operation = rs.getString("operation");
+ String color = rs.getString("color");
+ float warninglevel1 = rs.getFloat("warninglevel1");
+ String description = rs.getString("description");
+ boolean showArchive = rs.getInt("archive") == 1 ? true : false;
+
+ pStmt = con
+ .prepareStatement("SELECT * from servers WHERE enabled=1 AND server_id="
+ + server_id);
+ rsServer = pStmt.executeQuery();
+ if (rsServer.next()) {
+ ip = rsServer.getString("ip");
+ String username = rsServer.getString("username");
+ String password = rsServer.getString("password");
+ int port = rsServer.getInt("port");
+ // close the connection before calling the MRCConnector because
+ // it opens another
+ // connection to the db to update the SERVERS.last_seen
+ // attribute
+ try {
+ con.close();
+ } catch (Exception e) {
+ throw e;
+ }
+ mrc = new MRCConnector(ip, username, password, port);
+
+ snapCount = timeFrame
+ / java.lang.Integer
+ .valueOf(java.lang.Long
+ .toString((mrc.getSnapshotDuration() / new Long(
+ 60000))));
+ HashMap<String, ArrayList<Object>> DataList = new HashMap<String, ArrayList<Object>>();
+
+ DataList.put(graphName1, new ArrayList<Object>());
+ if ((dataName2 != null) && !dataName2.equals("time")
+ && !dataName2.equals("null") && !dataName2.equals("")) {
+ DataList.put(graphName2, new ArrayList<Object>());
+ }
+ if ((timeFrame / 1440 >= 30))
+ snapCount = 17;
+ else {
+ if (((timeFrame / 1440) == 7) && ((timeFrame / 60) > 24)
+ && snapCount >= 14) {
+ snapCount = 16;
+ } else {
+ snapCount = 12; // default for anything else
+ }
+ }
+
+ ArrayList<Object> snapshot_time = new ArrayList<Object>();
+
+ ArrayList<Object> PrettyTime = new ArrayList<Object>();
+
+ String prettyTimeFrame = new String();
+ DecimalFormat fmt = new DecimalFormat("0.##");
+ if (timeFrame / 60 > 24) {
+ prettyTimeFrame = fmt.format((float) (timeFrame / 1440))
+ + " day";
+ } else {
+ if (timeFrame > 60) {
+ prettyTimeFrame = fmt.format((float) timeFrame / 60)
+ + " hour";
+ } else {
+ prettyTimeFrame = fmt.format(timeFrame) + " minute";
+ }
+ }
+
+ int skipCount = (int) ((timeFrame / (mrc.getSnapshotDuration() / 60000)))
+ / (snapCount - 2);
+ snapCount = snapCount + 2;
+ TreeMap<Long, Long> snapshotList1 = mrc
+ .getSpecificStatistics(mBeanName, dataName1, snapCount,
+ skipCount, showArchive);
+ TreeMap<Long, Long> snapshotList2 = mrc
+ .getSpecificStatistics(mBeanName, dataName2, snapCount,
+ skipCount, showArchive);
+ // Check if snapshotList is empty
+ if (snapshotList1.size() == 0) {
+ snapshotList1.put(System.currentTimeMillis(), new Long(0));
+ snapshotList2.put(System.currentTimeMillis(), new Long(0));
+ /*
+ * If there are not enough snapshots available to fill the
+ * requested number, insert some with values of 0 and the
+ * proper times.
+ */
+ while (snapshotList1.size() < snapCount) {
+ // Temporary, always is first element (oldest)
+ Long timeFix = snapshotList1.firstKey();
+ // Calculate appropriate time, add it to the submap,
+ // then
+ // add
+ // that to the tempMap
+ snapshotList1.put(
+ (timeFix - (mrc.getSnapshotDuration() * skipCount)), new Long(0));
+ snapshotList2.put(
+ (timeFix - (mrc.getSnapshotDuration() * skipCount)), new Long(0));
+ }
+ }
+
+ for (Iterator<Long> it = snapshotList1.keySet().iterator(); it.hasNext();) {
+ Long current = it.next();
+ snapshot_time.add(current);
+ ArrayList<Object> ArrayListTemp = DataList.get(graphName1);
+ ArrayListTemp.add(snapshotList1.get(current));
+ DataList.put(graphName1, ArrayListTemp);
+ if ((dataName2 != null) && !dataName2.equals("time")
+ && !dataName2.equals("null")
+ && !dataName2.equals("")) {
+ ArrayList<Object> ArrayListTemp2 = DataList
+ .get(graphName2);
+ ArrayListTemp2.add(snapshotList2.get(current));
+ DataList.put(graphName2, ArrayListTemp2);
+ }
+ PrettyTime.add((Long) current / 1000);
+ }
+
+ if (dataName2.equals("time")) {
+ graph = (new StatsGraph(graph_id, ip + " - " + xlabel
+ + " - " + prettyTimeFrame, description, "Time - "
+ + prettyTimeFrame, ylabel,
+ data1operation.charAt(0), DataList.get(graphName1),
+ operation, data2operation.charAt(0), PrettyTime,
+ snapshot_time,
+ (int) (mrc.getSnapshotDuration() / 1000),
+ timeFrame, color, warninglevel1, warninglevel1));
+ } else if (!dataName2.equals("time") && (dataName2 != null)
+ && !dataName2.equals("null") && !dataName2.equals("")) {
+ graph = (new StatsGraph(graph_id, ip + " - " + xlabel
+ + " - " + prettyTimeFrame, description, "Time - "
+ + prettyTimeFrame, ylabel,
+ data1operation.charAt(0), DataList.get(graphName1),
+ operation, data2operation.charAt(0), DataList
+ .get(graphName2), snapshot_time, (int) (mrc
+ .getSnapshotDuration() / 1000), timeFrame,
+ color, warninglevel1, warninglevel1));
+ } else if (dataName2 == null || dataName2.equals("null")
+ || dataName2.equals("")) {
+ graph = (new StatsGraph(graph_id, ip + " - " + xlabel
+ + " - " + prettyTimeFrame, description, "Time - "
+ + prettyTimeFrame, ylabel,
+ data1operation.charAt(0), DataList.get(graphName1),
+ operation, snapshot_time, (int) (mrc
+ .getSnapshotDuration() / 1000), timeFrame,
+ color, warninglevel1, warninglevel1));
+ } else {
+ graph = (new StatsGraph());
+ }
+ }
+ }
+
+ // check to see if graph was successfully populated
+ if (graph != null) {
+ // get the current date
+ Format formatter = null;
+ formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date date = new Date(System.currentTimeMillis());
+ String currentTime = formatter.format(date);
+ // the graph was successfully operated on,
+ // so update the last_seen attribute
+ DBManager dbManager = new DBManager();
+ Connection conn = dbManager.getConnection();
+ Statement stmt = conn.createStatement();
+ stmt.executeUpdate("UPDATE GRAPHS SET LAST_SEEN='" + currentTime
+ + "' WHERE GRAPH_ID=" + graph_id);
+ conn.close();
+ }
+ return graph;
+ }
+}
Propchange: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/GraphsBuilder.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java?rev=604644&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java (added)
+++ geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java Sun Dec 16 08:11:29 2007
@@ -0,0 +1,645 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geronimo.monitoring.console;
+
+import java.sql.Connection;
+import java.sql.Statement;
+import java.text.Format;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+
+import org.apache.geronimo.monitoring.MasterRemoteControlRemote;
+import org.apache.geronimo.monitoring.console.util.DBManager;
+
+import org.apache.geronimo.util.EncryptionManager;
+
+public class MRCConnector
+{
+
+ private MasterRemoteControlRemote mrc = null;
+
+ MRCConnector()
+ {
+
+ }
+
+ /**
+ * @param ip -
+ * IP address of mrc-server to connect to
+ * @param userName -
+ * Username for JMX connection to the host
+ * @param password -
+ * Password for JMX connection to the host
+ * @throws Exception -
+ * If the connection to mrc-server fails
+ */
+ public MRCConnector(String ip, String userName, String password, int port)
+ throws Exception
+ {
+ // decrypt the password
+ password = (String)EncryptionManager.decrypt(password);
+ try {
+ Properties props = new Properties();
+ props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
+ "org.apache.openejb.client.RemoteInitialContextFactory");
+ props.setProperty(Context.PROVIDER_URL, "ejbd://" + ip + ":" + port);
+ props.setProperty(Context.SECURITY_PRINCIPAL, userName);
+ props.setProperty(Context.SECURITY_CREDENTIALS, password);
+ props.setProperty("openejb.authentication.realmName", "geronimo-admin");
+ Context ic = new InitialContext(props);
+ mrc = (MasterRemoteControlRemote) ic.lookup("ejb/mgmt/MRCRemote");
+ mrc.setUpMEJB(userName, password);
+ } catch(Exception e) {
+ throw e;
+ }
+ // when the code has reach this point, a connection was successfully established
+ // so we need to update the last_seen attribute for the server
+ Format formatter = null;
+ formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date date = new Date(System.currentTimeMillis());
+ String currentTime = formatter.format(date);
+
+ Connection conn = DBManager.createConnection();
+ try {
+ Statement stmt = conn.createStatement();
+ stmt.executeUpdate("UPDATE SERVERS SET LAST_SEEN = '" + currentTime + "' WHERE IP='" + ip + "'");
+ } catch(Exception e) {
+ throw e;
+ } finally {
+ try {
+ if(conn != null){
+ conn.close();
+ }
+ } catch(Exception e) {
+
+ }
+ }
+ }
+
+ /**
+ * @return - Returns an Long representing the current snapshot duration set
+ * on the server side
+ * @throws Exception -
+ * If the connection to the MRC-Server fails
+ */
+ public Long getSnapshotDuration() throws Exception
+ {
+ return mrc.getSnapshotDuration();
+ }
+
+ /**
+ * @return - Returns an ArrayList of String objects containing a listing of
+ * all statistics values being collected
+ * @throws Exception -
+ * If the connection to the MRC-Server fails
+ */
+ @SuppressWarnings("unchecked")
+ public HashMap<String, ArrayList<String>> getDataNameList()
+ throws Exception
+ {
+
+ HashMap<String, ArrayList<String>> DataNameList = new HashMap<String, ArrayList<String>>();
+
+ try
+ {
+ DataNameList = mrc.getAllSnapshotStatAttributes();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ // Strip out snapshot_date and snapshot_time, we know these exist
+ for (Iterator<String> it = DataNameList.keySet().iterator(); it
+ .hasNext();)
+ {
+ String mbeanName = it.next();
+ DataNameList.get(mbeanName).remove("snapshot_date");
+ DataNameList.get(mbeanName).remove("snapshot_time");
+ }
+ return DataNameList;
+ }
+
+ /**
+ * @param snapCount -
+ * Number of snapshots to request from the server
+ * @param skipCount -
+ * Every nth snapshot. A value of 1 will be every 1. A value of 2
+ * will be every other.
+ * @return - Returns an ArrayList of Map objects.
+ * @throws Exception -
+ * If the connection to the MRC-Server fails
+ */
+ @SuppressWarnings("unchecked")
+ public ArrayList<HashMap<String, HashMap<String, Object>>> getSnapshots(
+ int snapCount, int skipCount) throws Exception
+ {
+ ArrayList<HashMap<String, HashMap<String, Object>>> snapshotList = mrc
+ .fetchSnapshotData(snapCount, skipCount);
+ // Check if snapshotList is empty
+ if (snapshotList.size() == 0)
+ {
+ return snapshotList;
+ }
+ /*
+ * If there are not enough snapshots available to fill the requested
+ * number, insert some with values of 0 and the proper times.
+ */
+ while (snapshotList.size() < snapCount)
+ {
+ // Temporary, always is first element (oldest)
+ HashMap<String, HashMap<String, Object>> mapTimeFix = snapshotList
+ .get(0);
+
+ // Temporary map, used to generate blank data to be added to
+ // the
+ // list at position 0
+ HashMap<String, HashMap<String, Object>> tempMap = new HashMap<String, HashMap<String, Object>>();
+
+ // Temporary submap, used to store 0 elements to be added to
+ // the
+ // tempmap
+ HashMap<String, Object> subMap = new HashMap<String, Object>();
+
+ // Calculate appropriate time, add it to the submap, then
+ // add
+ // that to the tempMap
+ subMap
+ .put("snapshot_time", ((Long) mapTimeFix.get("times").get(
+ "snapshot_time") - (getSnapshotDuration() * skipCount)));
+ Format formatter = null;
+ formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date date = new Date((Long) subMap.get("snapshot_time"));
+ subMap.put("snapshot_date", formatter.format(date));
+
+ // Add the submap back to the tempmap
+ tempMap.put("times", new HashMap<String, Object>(subMap));
+
+ // Clear out the subMap for use again
+ subMap.clear();
+
+ // Run through the mbeans
+
+ // Run through the mbeans
+ for (Iterator<String> it = mapTimeFix.keySet().iterator(); it
+ .hasNext();)
+ {
+ // get the mbean name
+ String mbeanName = it.next();
+ HashMap<String, Object> stats = null;
+ // Verify that it's not times
+
+ if (mbeanName.equals(new String("times")))
+ {
+
+ }
+ else
+ {
+ stats = mapTimeFix.get(mbeanName);
+ // Run through the stats elements for the particular
+ // mbean
+ for (Iterator<String> itt = stats.keySet().iterator(); itt
+ .hasNext();)
+ {
+ String key = itt.next();
+ // Place faux data into the submap
+ subMap.put(key, new Long(0));
+ }
+ // Add the submap to the tempmap, and clear it
+ tempMap.put(mbeanName, new HashMap<String, Object>(subMap));
+ }
+ }
+ snapshotList.add(0, new HashMap<String, HashMap<String, Object>>(
+ tempMap));
+ }
+
+ /*
+ * This is where we will be inserting data to fill 'gaps' in the
+ * snapshots The initial for-loop will travel from the most recent
+ * snapshot to the oldest, checking that the snapshot_time along the
+ * way all align with what they should be
+ */
+ for (int i = snapshotList.size() - 1; i > 0; i--)
+ {
+ if (i > 0)
+ {
+ HashMap<String, HashMap<String, Object>> mapTimeFix = snapshotList
+ .get(i);
+ HashMap<String, HashMap<String, Object>> mapTimeFix2 = snapshotList
+ .get(i - 1);
+ // here is where we will in missing data
+ while (((((Long) mapTimeFix.get("times").get("snapshot_time") / 1000) / 60)
+ - (((Long) mapTimeFix2.get("times")
+ .get("snapshot_time") / 1000) / 60) > (((getSnapshotDuration() / 1000) / 60) * skipCount)))
+ {
+ HashMap<String, HashMap<String, Object>> tempMap = new HashMap<String, HashMap<String, Object>>();
+ HashMap<String, Object> subMap = new HashMap<String, Object>();
+
+ for (Iterator<String> it = mapTimeFix.keySet().iterator(); it
+ .hasNext();)
+ {
+ // get the mbean name
+ String mbeanName = it.next();
+ HashMap<String, Object> stats = null;
+ // Verify that it's not times
+ if (!mbeanName.equals("times"))
+ {
+ stats = mapTimeFix.get(mbeanName);
+ // Run through the stats elements for the
+ // particular
+ // mbean
+ for (Iterator<String> itt = stats.keySet()
+ .iterator(); itt.hasNext();)
+ {
+ String key = itt.next();
+ // Place faux data into the submap
+ subMap.put(key, new Long(0));
+ }
+ // Add the submap to the tempmap, and clear it
+ tempMap.put(mbeanName, new HashMap<String, Object>(
+ subMap));
+ subMap.clear();
+ }
+ }
+
+ subMap
+ .put(
+ "snapshot_time",
+ new Long(
+ (Long) mapTimeFix.get("times").get(
+ "snapshot_time")
+ - (getSnapshotDuration() * skipCount)));
+ Format formatter = null;
+ formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+ Date date = new Date((Long) subMap.get("snapshot_time"));
+ subMap.put("snapshot_date", formatter.format(date));
+ tempMap.put("times", new HashMap<String, Object>(subMap));
+ subMap.clear();
+ snapshotList.add(i,
+ new HashMap<String, HashMap<String, Object>>(
+ tempMap));
+ snapshotList.remove(0);
+ mapTimeFix = tempMap;
+ mapTimeFix2 = snapshotList.get(i - 1);
+ }
+ }
+ }
+ return snapshotList;
+ }
+
+ @SuppressWarnings("unchecked")
+ public TreeMap<Long, Long> getSpecificStatistics(String mbeanName,
+ String statsName, int snapCount, int skipCount, boolean showArchive) throws Exception
+ {
+ TreeMap<Long, Long> snapshotList = mrc.getSpecificStatistics(mbeanName,
+ statsName, snapCount, skipCount, showArchive);
+ // Check if snapshotList is empty
+ if (snapshotList.size() == 0)
+ {
+ return snapshotList;
+ }
+ /*
+ * If there are not enough snapshots available to fill the requested
+ * number, insert some with values of 0 and the proper times.
+ */
+ while (snapshotList.size() < snapCount)
+ {
+ // Temporary, always is first element (oldest)
+ Long timeFix = snapshotList.firstKey();
+
+ // Calculate appropriate time, add it to the submap, then
+ // add
+ // that to the tempMap
+ snapshotList
+ .put(
+ (timeFix - (getSnapshotDuration() * skipCount)),
+ new Long(0));
+ }
+
+ /*
+ * This is where we will be inserting data to fill 'gaps' in the
+ * snapshots The initial for-loop will travel from the most recent
+ * snapshot to the oldest, checking that the snapshot_time along the
+ * way all align with what they should be
+ */
+ Set tempSet = snapshotList.keySet();
+ ArrayList<Long> tempArray = new ArrayList(tempSet);
+
+ for (int i = tempArray.size() - 1; i > 0; i--)
+ {
+ Long tempLong1 = tempArray.get(i);
+ Long tempLong2 = tempArray.get(i - 1);
+ // here is where we will in missing data
+ while (((((Long) tempLong1 / 1000) / 60)
+ - (((Long) tempLong2 / 1000) / 60) > (((getSnapshotDuration() / 1000) / 60) * skipCount))
+ && i > 0)
+ {
+
+ tempLong1 = tempLong1 - (getSnapshotDuration() * skipCount);
+ snapshotList.remove(tempArray.get(0));
+ snapshotList.put(tempLong1, new Long(0));
+ tempArray.remove(0);
+ i--;
+ }
+ }
+ return snapshotList;
+ }
+
+ @SuppressWarnings("unchecked")
+ public HashMap<String, HashMap<String, Object>> getLatestSnapshots()
+ throws Exception
+ {
+ int snapCount = 1;
+ int skipCount = 1;
+ ArrayList<HashMap<String, HashMap<String, Object>>> snapshotList = mrc
+ .fetchSnapshotData(snapCount, skipCount);
+ // Check if snapshotList is empty
+ if (snapshotList.size() == 0)
+ {
+ return null;
+ }
+ else
+ return snapshotList.get(0);
+ }
+
+ /**
+ * @return - Returns a boolean indicating successful stop
+ * @throws Exception -
+ * If the connection to the MRC-Server fails
+ */
+ public boolean stopSnapshotThread() throws Exception
+ {
+ return mrc.stopSnapshot();
+ }
+
+ /**
+ * @return - Returns a boolean indicating successful stop
+ * @throws Exception -
+ * If the connection to the MRC-Server fails
+ */
+ public boolean startSnapshotThread(long time) throws Exception
+ {
+ return mrc.startSnapshot(time);
+ }
+
+ public boolean isSnapshotRunning()
+ {
+ boolean running = false;
+ try
+ {
+ running = mrc.isSnapshotRunning();
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
+ return running;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getAllMbeanNames() throws Exception
+ {
+ return mrc.getAllMBeanNames();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getStatisticsProviderBeanNames() throws Exception
+ {
+ return mrc.getStatisticsProviderMBeanNames();
+ }
+
+ @SuppressWarnings("unchecked")
+ public HashMap<String, ArrayList<String>> getAllSnapshotStatAttributes()
+ throws Exception
+ {
+ return mrc.getAllSnapshotStatAttributes();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getTrackedBeans() throws Exception
+ {
+ return mrc.getTrackedMBeans();
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getStatAttributesOnMBean(String mBean) throws Exception
+ {
+ HashMap<String, ArrayList<String>> allStatAttributes = getAllSnapshotStatAttributes();
+ ArrayList<String> tempArrayList = allStatAttributes.get(mBean);
+ Set<String> tempSet = new TreeSet<String>();
+ Iterator it = tempArrayList.iterator();
+ while (it.hasNext())
+ {
+ tempSet.add(it.next().toString());
+ }
+ return tempSet;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getTrackedBeansPretty() throws Exception
+ {
+ Set trackedBeans = getTrackedBeans();
+ Set prettybeans = new TreeSet();
+ Iterator it = trackedBeans.iterator();
+ while (it.hasNext())
+ {
+ String[] temparray1 = it.next().toString().split("name=");
+ String[] temparray2 = temparray1[1].split(",");
+ String[] temparray3 = temparray2[0].split("/");
+ String mbeanName = null;
+ if (temparray3.length > 1)
+ mbeanName = temparray3[1];
+ else
+ mbeanName = temparray2[0];
+ prettybeans.add(mbeanName);
+ }
+ return prettybeans;
+ }
+
+ @SuppressWarnings("unchecked")
+ public TreeMap<String, String> getTrackedBeansMap() throws Exception
+ {
+ Set trackedBeans = getTrackedBeans();
+ TreeMap<String, String> beanMap = new TreeMap<String, String>();
+ Iterator it = trackedBeans.iterator();
+ while (it.hasNext())
+ {
+ String mbeanName = it.next().toString();
+ String[] temparray1 = mbeanName.split("name=");
+ String[] temparray2 = temparray1[1].split(",");
+ String[] temparray3 = temparray2[0].split("/");
+ String mbeanNamePretty = null;
+ if (temparray3.length > 1)
+ mbeanNamePretty = temparray3[1];
+ else
+ mbeanNamePretty = temparray2[0];
+ beanMap.put(mbeanNamePretty, mbeanName);
+ }
+ return beanMap;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getStatisticsProviderBeanNamesPretty() throws Exception
+ {
+ Set availableBeans = getStatisticsProviderBeanNames();
+ Set prettybeans = new TreeSet();
+ Iterator it = availableBeans.iterator();
+ while (it.hasNext())
+ {
+ String[] temparray1 = it.next().toString().split("name=");
+ String[] temparray2 = temparray1[1].split(",");
+ String[] temparray3 = temparray2[0].split("/");
+ String mbeanName = null;
+ if (temparray3.length > 1)
+ mbeanName = temparray3[1];
+ else
+ mbeanName = temparray2[0];
+ prettybeans.add(mbeanName);
+ }
+ return prettybeans;
+ }
+
+ @SuppressWarnings("unchecked")
+ public TreeMap<String, String> getStatisticsProviderBeanNamesMap()
+ throws Exception
+ {
+ Set availableBeans = getStatisticsProviderBeanNames();
+ TreeMap<String, String> beanMap = new TreeMap<String, String>();
+ Iterator it = availableBeans.iterator();
+ while (it.hasNext())
+ {
+ String mbeanName = it.next().toString();
+ String[] temparray1 = mbeanName.split("name=");
+ String[] temparray2 = temparray1[1].split(",");
+ String[] temparray3 = temparray2[0].split("/");
+ String mbeanNamePretty = null;
+ if (temparray3.length > 1)
+ mbeanNamePretty = temparray3[1];
+ else
+ mbeanNamePretty = temparray2[0];
+ beanMap.put(mbeanNamePretty, mbeanName);
+ }
+ return beanMap;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getFreeStatisticsProviderBeanNamesPretty()
+ throws Exception
+ {
+ Set<String> availableBeans = getStatisticsProviderBeanNamesPretty();
+ Set<String> usedBeans = getTrackedBeansPretty();
+ Set freeBeans = new TreeSet();
+ Iterator it = availableBeans.iterator();
+ while (it.hasNext())
+ {
+ String mbeanName = it.next().toString();
+ if (!usedBeans.contains(mbeanName))
+ freeBeans.add(mbeanName);
+ }
+ return freeBeans;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<String> getFreeStatisticsProviderBeanNames() throws Exception
+ {
+ Set<String> availableBeans = getStatisticsProviderBeanNames();
+ Set<String> usedBeans = getTrackedBeansPretty();
+ Set freeBeans = new TreeSet();
+ Iterator it = availableBeans.iterator();
+ while (it.hasNext())
+ {
+ String mbeanName = it.next().toString();
+ String[] temparray1 = mbeanName.split("name=");
+ String[] temparray2 = temparray1[1].split(",");
+ String[] temparray3 = temparray2[0].split("/");
+ String mbeanNamePretty = null;
+ if (temparray3.length > 1)
+ mbeanNamePretty = temparray3[1];
+ else
+ mbeanNamePretty = temparray2[0];
+ if (!usedBeans.contains(mbeanNamePretty))
+ freeBeans.add(mbeanName);
+ }
+ return freeBeans;
+ }
+
+ @SuppressWarnings("unchecked")
+ public TreeMap<String, String> getFreeStatisticsProviderBeanNamesMap()
+ throws Exception
+ {
+ Set<String> availableBeans = getStatisticsProviderBeanNames();
+ Set<String> usedBeans = getTrackedBeansPretty();
+ TreeMap<String, String> beanMap = new TreeMap<String, String>();
+ Iterator it = availableBeans.iterator();
+ while (it.hasNext())
+ {
+ String mbeanName = it.next().toString();
+ String[] temparray1 = mbeanName.split("name=");
+ String[] temparray2 = temparray1[1].split(",");
+ String[] temparray3 = temparray2[0].split("/");
+ String mbeanNamePretty = null;
+ if (temparray3.length > 1)
+ mbeanNamePretty = temparray3[1];
+ else
+ mbeanNamePretty = temparray2[0];
+ if (!usedBeans.contains(mbeanNamePretty))
+ beanMap.put(mbeanNamePretty, mbeanName);
+ }
+ return beanMap;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean stopTrackingMbean(String MBean) throws Exception
+ {
+ mrc.removeMBeanForSnapshot(MBean);
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ public boolean startTrackingMbean(String MBean) throws Exception
+ {
+ mrc.addMBeanForSnapshot(MBean);
+ return true;
+ }
+
+ @SuppressWarnings("unchecked")
+ public HashMap<String, Long> getStats(String MBean) throws Exception
+ {
+ return mrc.getStats(MBean);
+ }
+
+ public void setSnapshotDuration(long duration) {
+ mrc.setSnapshotDuration(new Long(duration));
+ }
+
+ public long getSnapshotRetention() {
+ return Long.parseLong(mrc.getSnapshotRetention());
+ }
+
+ public void setSnapshotRetention(int duration) {
+ mrc.setSnapshotRetention( duration );
+ }
+}
Propchange: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java
------------------------------------------------------------------------------
svn:keywords = Date Revision
Propchange: geronimo/sandbox/monitoring/mconsole-war/src/main/java/org/apache/geronimo/monitoring/console/MRCConnector.java
------------------------------------------------------------------------------
svn:mime-type = text/plain