You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2007/11/05 22:46:57 UTC
svn commit: r592158 [1/2] - in /geronimo/sandbox/monitoring: ./
client/client-war/
client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/
mrc-server/ mrc-server/mrc-car/ mrc-server/mrc-ds-car/
mrc-server/mrc-ds-car/src/main/plan...
Author: gawor
Date: Mon Nov 5 13:46:54 2007
New Revision: 592158
URL: http://svn.apache.org/viewvc?rev=592158&view=rev
Log:
Patch from Viet: use TimerService instead of starting a separate thread (GERONIMO-3573)
Added:
geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java (with props)
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/LICENSE.txt (with props)
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/NOTICE.txt (with props)
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/pom.xml (with props)
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/derby/
geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/derby/createTables.sql (with props)
Modified:
geronimo/sandbox/monitoring/client/client-war/pom.xml
geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java
geronimo/sandbox/monitoring/mrc-server/mrc-car/pom.xml
geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/pom.xml
geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/src/main/plan/plan.xml
geronimo/sandbox/monitoring/mrc-server/mrc-ear/pom.xml
geronimo/sandbox/monitoring/mrc-server/mrc-ejb/pom.xml
geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MBeanHelper.java
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/SMP.java
geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java
geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotDBHelper.java
geronimo/sandbox/monitoring/mrc-server/pom.xml
geronimo/sandbox/monitoring/pom.xml
Modified: geronimo/sandbox/monitoring/client/client-war/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/pom.xml?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/pom.xml (original)
+++ geronimo/sandbox/monitoring/client/client-war/pom.xml Mon Nov 5 13:46:54 2007
@@ -91,9 +91,9 @@
</dependency>
<dependency>
- <groupId>org.apache.geronimo.plugins.mrc</groupId>
+ <groupId>org.apache.geronimo.modules</groupId>
<artifactId>mrc-server-ejb</artifactId>
- <version>1.0-SNAPSHOT</version>
+ <version>2.1-SNAPSHOT</version>
<type>jar</type>
</dependency>
Modified: geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java (original)
+++ geronimo/sandbox/monitoring/client/client-war/src/main/java/org/apache/geronimo/plugins/monitoring/client/MRCConnector.java Mon Nov 5 13:46:54 2007
@@ -58,7 +58,7 @@
{
Properties props = new Properties();
props.setProperty(Context.INITIAL_CONTEXT_FACTORY,
- "org.openejb.client.RemoteInitialContextFactory");
+ "org.apache.openejb.client.RemoteInitialContextFactory");
props.setProperty(Context.PROVIDER_URL, "ejbd://" + ServerIP + ":4201");
props.setProperty(Context.SECURITY_PRINCIPAL, userName);
props.setProperty(Context.SECURITY_CREDENTIALS, password);
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-car/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-car/pom.xml?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-car/pom.xml (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-car/pom.xml Mon Nov 5 13:46:54 2007
@@ -21,36 +21,35 @@
<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>
+<!--
+ <parent>
<groupId>org.apache.geronimo.plugins.mrc</groupId>
<artifactId>mrc-server</artifactId>
- <version>2.1-SNAPSHOT</version>
+ <version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
--->
+ -->
<parent>
<groupId>org.apache.geronimo.configs</groupId>
<artifactId>configs</artifactId>
<version>2.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
-
<artifactId>mrc-server-car</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Geronimo Plugins :: Monitoring CAR</name>
<packaging>car</packaging>
<dependencies>
- <dependency>
+ <dependency>
<groupId>org.apache.geronimo.configs</groupId>
- <artifactId>mrc-server-ds-car</artifactId>
+ <artifactId>mrc-ds-car</artifactId>
<version>1.0-SNAPSHOT</version>
<type>car</type>
</dependency>
<dependency>
- <groupId>org.apache.geronimo.plugins.mrc</groupId>
+ <groupId>org.apache.geronimo.plugins</groupId>
<artifactId>mrc-server-ear</artifactId>
<version>1.0-SNAPSHOT</version>
<type>ear</type>
@@ -109,7 +108,7 @@
<deploymentConfig>${openejbDeployer}</deploymentConfig>
</deploymentConfigs>
<module>
- <groupId>org.apache.geronimo.plugins.mrc</groupId>
+ <groupId>org.apache.geronimo.plugins</groupId>
<artifactId>mrc-server-ear</artifactId>
<version>1.0-SNAPSHOT</version>
<type>ear</type>
@@ -123,10 +122,11 @@
<commonInstance>
<plugin-artifact>
<source-repository>~/.m2/repository/</source-repository>
- <source-repository>http://repo1.maven.org/maven2/</source-repository>
<source-repository>http://people.apache.org/repo/m2-snapshot-repository/</source-repository>
<source-repository>http://people.apache.org/repo/m2-incubating-repository/</source-repository>
<source-repository>file:///C:/.m2/</source-repository>
+
+ <source-repository>http://repo1.maven.org/maven2/</source-repository>
</plugin-artifact>
</commonInstance>
</configuration>
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/pom.xml?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/pom.xml (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/pom.xml Mon Nov 5 13:46:54 2007
@@ -21,14 +21,14 @@
<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.mrc</groupId>
+ <groupId>org.apache.geronimo.plugins</groupId>
<artifactId>mrc-server</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
--->
+ -->
<parent>
<groupId>org.apache.geronimo.configs</groupId>
<artifactId>configs</artifactId>
@@ -36,7 +36,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>mrc-server-ds-car</artifactId>
+ <artifactId>mrc-ds-car</artifactId>
<version>1.0-SNAPSHOT</version>
<name>Geronimo Plugins :: Monitoring CAR</name>
<packaging>car</packaging>
@@ -87,6 +87,16 @@
<version>1.3</version>
<type>rar</type>
</module>
+ <commonInstance>
+ <plugin-artifact>
+ <geronimo-version>${geronimoVersion}</geronimo-version>
+ <jvm-version>1.5</jvm-version>
+ <source-repository>~/.m2/repository</source-repository>
+ <source-repository>http://people.apache.org/repo/m2-snapshot-repository</source-repository>
+ <source-repository>http://repo1.maven.org/maven2</source-repository>
+ <source-repository>http://people.apache.org/repo/m2-incubating-repository</source-repository>
+ </plugin-artifact>
+ </commonInstance>
</configuration>
</plugin>
</plugins>
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/src/main/plan/plan.xml?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/src/main/plan/plan.xml (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ds-car/src/main/plan/plan.xml Mon Nov 5 13:46:54 2007
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1">
<environment>
-
<moduleId>
<groupId>org.apache.geronimo.configs</groupId>
- <artifactId>mrc-server-ds-car</artifactId>
+ <artifactId>mrc-ds-car</artifactId>
<version>1.0-SNAPSHOT</version>
<type>car</type>
</moduleId>
-
<dependencies>
<dependency>
<groupId>org.apache.geronimo.configs</groupId>
@@ -16,11 +14,19 @@
<version>2.1-SNAPSHOT</version>
<type>car</type>
</dependency>
+ <!-- SQL files -->
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>mrc-sql-jar</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <type>jar</type>
+ </dependency>
</dependencies>
</environment>
+
<resourceadapter>
<outbound-resourceadapter>
- <!-- Pool for Active Statisitcs -->
+ <!-- Pool for Active Statistics -->
<connection-definition>
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
<connectiondefinition-instance>
@@ -39,8 +45,7 @@
</connectionmanager>
</connectiondefinition-instance>
</connection-definition>
-
- <!-- Pool for Archived Statisitcs -->
+ <!-- Pool for Archived Statistics -->
<connection-definition>
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
<connectiondefinition-instance>
@@ -61,4 +66,20 @@
</connection-definition>
</outbound-resourceadapter>
</resourceadapter>
+
+ <!-- These two GBeans will create the tables for the database automatically -->
+ <gbean name="ActiveDSGBean" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
+ <attribute name="testSQL">SELECT t.tablename FROM SYS.SYSTABLES t WHERE t.tablename='Statistics'</attribute>
+ <attribute name="path">META-INF/database/derby/createTables.sql</attribute>
+ <reference name="DataSource">
+ <name>jdbc/ActiveDS</name>
+ </reference>
+ </gbean>
+ <gbean name="ArchiveDSGBean" class="org.apache.geronimo.connector.DatabaseInitializationGBean">
+ <attribute name="testSQL">SELECT t.tablename FROM SYS.SYSTABLES t WHERE t.tablename='Statistics'</attribute>
+ <attribute name="path">META-INF/database/derby/createTables.sql</attribute>
+ <reference name="DataSource">
+ <name>jdbc/ArchiveDS</name>
+ </reference>
+ </gbean>
</connector>
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ear/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ear/pom.xml?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ear/pom.xml (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ear/pom.xml Mon Nov 5 13:46:54 2007
@@ -1,89 +1,89 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-
-<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.mrc</groupId>
- <artifactId>mrc-server</artifactId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>mrc-server-ear</artifactId>
- <name>Geronimo Stats :: Server :: EAR</name>
- <packaging>ear</packaging>
-
- <description>Geronimo Stats. EAR Module</description>
-
- <dependencies>
- <!--
- <dependency>
- <groupId>org.apache.geronimo.configs</groupId>
- <artifactId>mrc-server-ds-car</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>car</type>
- </dependency>
- -->
- <dependency>
- <groupId>org.apache.geronimo.plugins.mrc</groupId>
- <artifactId>mrc-server-ejb</artifactId>
- <version>1.0-SNAPSHOT</version>
- <type>ejb</type>
- </dependency>
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>src/main/resources</directory>
- <filtering>true</filtering>
- </resource>
- </resources>
- <plugins>
- <plugin>
- <artifactId>maven-ear-plugin</artifactId>
- <configuration>
- <displayName>Geronimo Sample EAR for MRC</displayName>
- <description>Geronimo Sample EAR for MRC</description>
- <version>5</version>
- <modules>
- <ejbModule>
- <groupId>org.apache.geronimo.plugins.mrc</groupId>
- <artifactId>mrc-server-ejb</artifactId>
- <bundleFileName>mrc-server-ejb-1.0-SNAPSHOT.jar</bundleFileName>
- </ejbModule>
- </modules>
- <resourcesDir>${project.build.outputDirectory}</resourcesDir>
- <archive>
- <!-- Do not include META-INF/maven to avoid long file problems on windows -->
- <addMavenDescriptor>false</addMavenDescriptor>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </build>
-
-</project>
-
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<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</groupId>
+ <artifactId>mrc-server</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>mrc-server-ear</artifactId>
+ <name>Geronimo Stats :: Server :: EAR</name>
+ <packaging>ear</packaging>
+
+ <description>Geronimo Stats. EAR Module</description>
+
+ <dependencies>
+ <!--
+ <dependency>
+ <groupId>org.apache.geronimo.configs</groupId>
+ <artifactId>mrc-server-ds-car</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <type>car</type>
+ </dependency>
+ -->
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>mrc-server-ejb</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <type>ejb</type>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <artifactId>maven-ear-plugin</artifactId>
+ <configuration>
+ <displayName>Geronimo Sample EAR for MRC</displayName>
+ <description>Geronimo Sample EAR for MRC</description>
+ <version>5</version>
+ <modules>
+ <ejbModule>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>mrc-server-ejb</artifactId>
+ <bundleFileName>mrc-server-ejb-2.1-SNAPSHOT.jar</bundleFileName>
+ </ejbModule>
+ </modules>
+ <resourcesDir>${project.build.outputDirectory}</resourcesDir>
+ <archive>
+ <!-- Do not include META-INF/maven to avoid long file problems on windows -->
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
+
+
+
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/pom.xml?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/pom.xml (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/pom.xml Mon Nov 5 13:46:54 2007
@@ -1,78 +1,86 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-
-<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.mrc</groupId>
- <artifactId>mrc-server</artifactId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
-
-
-
- <dependencies>
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-j2ee</artifactId>
- <version>${geronimoVersion}</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-management</artifactId>
- <version>${geronimoVersion}</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.modules</groupId>
- <artifactId>geronimo-kernel</artifactId>
- <version>${geronimoVersion}</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.applications</groupId>
- <artifactId>geronimo-mejb</artifactId>
- <version>${geronimoVersion}</version>
- <type>jar</type>
- <scope>provided</scope>
- </dependency>
- </dependencies>
-
- <artifactId>mrc-server-ejb</artifactId>
- <name>Geronimo Stats :: Server :: EJB</name>
- <packaging>jar</packaging>
-
- <description>Geronimo Stats. EJB Module</description>
-
-
-</project>
-
-
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<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</groupId>
+ <artifactId>mrc-server</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+-->
+ <parent>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>modules</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-j2ee</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-management</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.modules</groupId>
+ <artifactId>geronimo-kernel</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.geronimo.applications</groupId>
+ <artifactId>geronimo-mejb</artifactId>
+ <version>${version}</version>
+ <type>jar</type>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </dependency>
+ </dependencies>
+
+ <artifactId>mrc-server-ejb</artifactId>
+ <name>Geronimo Stats :: Server :: EJB</name>
+ <packaging>jar</packaging>
+
+ <description>Geronimo Stats. EJB Module</description>
+
+
+</project>
+
+
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MBeanHelper.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MBeanHelper.java?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MBeanHelper.java (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/MBeanHelper.java Mon Nov 5 13:46:54 2007
@@ -31,16 +31,11 @@
public class MBeanHelper {
- private Kernel kernel;
-
- public MBeanHelper() {
- kernel = KernelRegistry.getSingleKernel();
- }
-
/**
* Return all MBeans that provide stats
*/
- public Set<String> getStatsProvidersMBeans(Set<String> allMBeans) {
+ public static Set<String> getStatsProvidersMBeans(Set<String> allMBeans) {
+ Kernel kernel = KernelRegistry.getSingleKernel();
Set<String> result = new HashSet();
try {
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=592158&r1=592157&r2=592158&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 Mon Nov 5 13:46:54 2007
@@ -25,6 +25,7 @@
import javax.sql.DataSource;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -35,10 +36,15 @@
import javax.annotation.Resource;
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
+import javax.annotation.security.PermitAll;
import javax.annotation.security.RolesAllowed;
import javax.annotation.security.RunAs;
import javax.ejb.Remote;
-import javax.ejb.Stateful;
+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;
@@ -54,7 +60,9 @@
import javax.management.j2ee.statistics.TimeStatistic;
import javax.naming.Context;
import javax.naming.InitialContext;
-import javax.naming.NamingException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.geronimo.gbean.AbstractName;
import org.apache.geronimo.gbean.GBeanInfo;
@@ -66,18 +74,19 @@
import org.apache.geronimo.management.geronimo.stats.WebModuleStats;
import org.apache.geronimo.management.stats.WebModuleStatsImpl;
import org.apache.geronimo.monitor.snapshot.SnapshotDBHelper;
-import org.apache.geronimo.monitor.snapshot.SnapshotThread;
+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
* between the management node and the data in the server node.
*/
-@RolesAllowed("mejbuser")
-@Stateful(name="ejb/mgmt/MRC")
+@Stateless(name="ejb/mgmt/MRC")
@Remote(MasterRemoteControlRemote.class)
-@RunAs("mejbuser")
+@PermitAll
public class MasterRemoteControl {
+ private static Log log = LogFactory.getLog(MasterRemoteControl.class);
+
// constants
private static final String GERONIMO_DEFAULT_DOMAIN = "geronimo";
private static final Long DEFAULT_DURATION = new Long(300000);
@@ -89,18 +98,16 @@
// mangement ejb - use this to do the monitoring
private static Management mejb = null;
- // threads
- private static SnapshotThread snapshotThread = null;
// credentials for snapshot thread
private static String username = null;
- private static String password = null;
-
- // use this to call utility functions pertaining to mbeans
- private static MBeanHelper mbeanHelper;
+ private static String password = null;;
// inject Data Sources
@Resource(name="jdbc/ActiveDS") private DataSource activeDS;
@Resource(name="jdbc/ArchiveDS") private DataSource archiveDS;
+
+ // inject a TimerService
+ @Resource private TimerService timer;
public MasterRemoteControl() {
@@ -124,9 +131,7 @@
if(mbServer == null) {
mbServer = MBeanServerFactory.createMBeanServer(GERONIMO_DEFAULT_DOMAIN);
}
- // instantiate teh mbean helper to query mbean names
- mbeanHelper = new MBeanHelper();
-
+
// set up databases
setUpDatabases();
@@ -138,15 +143,15 @@
* Sets up the ActiveDB and ArchiveDB
*/
private void setUpDatabases() {
- setUpDatabase(activeDS);
- setUpDatabase(archiveDS);
+ setUpDatabase(activeDS, "ActiveMRCDB");
+ setUpDatabase(archiveDS, "ArchiveMRCDB");
}
/**
* Sets up a DB using a given DS
* @param ds
*/
- private void setUpDatabase(DataSource ds) {
+ private void setUpDatabase(DataSource ds, String databaseName) {
Connection conn = null;
try {
conn = ds.getConnection();
@@ -156,26 +161,25 @@
ResultSet allTablesResult = stmt.executeQuery("SELECT t.tablename FROM SYS.SYSTABLES t WHERE t.tablename NOT LIKE 'SYS%'");
boolean hasTables = false;
// determine if there are any tables in the db
- while(allTablesResult.next()) {
+ while(allTablesResult.next() && !hasTables) {
hasTables = true;
- break;
}
// create the tables if there aren't any tables in the db
if( !hasTables ) {
createTables(stmt);
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
} catch(SQLException e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
try {
if(conn!= null) {
conn.close();
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
}
}
@@ -210,11 +214,11 @@
tableStatisticsCreate += "FOREIGN KEY (mbeanId) REFERENCES MBeans(id)";
tableStatisticsCreate += ")";
stmt.executeUpdate(tableMBeansCreate);
- System.out.println("MBeans Table Created");
+ log.info("MBeans Table Created");
stmt.executeUpdate(tableStatisticsCreate);
- System.out.println("Statistics Table Created");
+ log.info("Statistics Table Created");
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
}
@@ -226,7 +230,7 @@
// instantiate the MEJB, which will be our gateway to communicate to MBeans
try {
Properties p = new Properties();
- p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.openejb.client.LocalInitialContextFactory");
+ p.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
InitialContext ctx = new InitialContext(p);
ManagementHome mejbHome = (ManagementHome)ctx.lookup("ejb/mgmt/MEJBRemoteHome");
@@ -237,7 +241,7 @@
this.password = password;
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
}
@@ -296,6 +300,29 @@
mejb.setAttribute(new ObjectName(objectName), attr);
}
+ // This method is called by the EJB container upon Timer expiration.
+ @Timeout
+ @PermitAll
+ public void handleTimeout(Timer theTimer) {
+ SnapshotProcessor.takeSnapshot(this.username, this.password);
+
+ // get the duration of theTimer
+ long duration = Long.parseLong((String)theTimer.getInfo());
+ // if the duration is different than the one in the snapshot-config.xml
+ // we need to get rid of this timer and start a new one with the
+ // correct duration.
+ if(duration != getSnapshotDuration().longValue()) {
+ Collection<Timer> timers = timer.getTimers();
+ for(Iterator<Timer> it = timers.iterator(); it.hasNext(); ) {
+ // cancel all timers
+ it.next().cancel();
+ }
+ // start a new one
+ long newDuration = getSnapshotDuration().longValue();
+ timer.createTimer(newDuration, newDuration, "" + newDuration);
+ }
+ }
+
/**
* Begins the snapshot process given the time interval between snapshots
*
@@ -320,40 +347,20 @@
} else {
retention = Integer.parseInt(retentionStr);
}
- saveDuration(interval.longValue());
- saveRetention(retention);
- // check to make sure that another snaphshot isn't running
- if((snapshotThread == null || (snapshotThread != null && !snapshotThread.isAlive())) &&
- interval.longValue() > 0) {
- snapshotThread = new SnapshotThread(interval.longValue(),
- retention,
- mbServer,
- getStatisticsProviderMBeanNames(),
- username,
- password);
- snapshotThread.start();
- return true;
- } else {
- System.out.println("There is already a snapshot thread running; Duration: " + interval.longValue());
- return false;
- }
+ return startSnapshot(interval, retention);
}
+ @RolesAllowed("mejbuser")
public boolean startSnapshot(Long interval, int retention) {
- saveDuration(interval.longValue());
- saveRetention(retention);
- if((snapshotThread == null || (snapshotThread != null && !snapshotThread.isAlive())) &&
- interval.longValue() > 0) {
- snapshotThread = new SnapshotThread(interval.longValue(),
- retention,
- mbServer,
- getStatisticsProviderMBeanNames(),
- username,
- password);
- snapshotThread.start();
+ Collection<Timer> timers = timer.getTimers();
+ if(timers.size() == 0) {
+ saveDuration(interval.longValue());
+ saveRetention(retention);
+ timer.createTimer(0, interval.longValue(), "" + interval.longValue());
+ log.info("Created timer successfully.");
return true;
} else {
- System.out.println("There is already a snapshot thread running; Duration: " + interval.longValue());
+ log.warn("There is already a snapshot timer running...");
return false;
}
}
@@ -363,22 +370,16 @@
*/
@RolesAllowed("mejbuser")
public boolean stopSnapshot() {
- if(snapshotThread != null) {
- if(snapshotThread.getSnapshotDuration() == Long.MAX_VALUE) {
- saveDuration(DEFAULT_DURATION);
- saveRetention(DEFAULT_RETENTION);
- } else {
- saveRetention(snapshotThread.getSnapshotRetention());
- saveDuration(snapshotThread.getSnapshotDuration());
- }
- snapshotThread.setEnd();
- snapshotThread.interrupt();
- return true;
- } else {
- System.out.println("There is not a snapshot thread running.");
- //log.error("There is not a snapshot thread running. Stopping aborted.");
- return false;
+ Collection<Timer> timers = timer.getTimers();
+ // stop all timers
+ boolean cancelled = false;
+ for(Iterator<Timer> it = timers.iterator(); it.hasNext(); ) {
+ Timer t = it.next();
+ t.cancel();
+ cancelled = true;
+ log.info("Stopped snapshot timer...");
}
+ return cancelled;
}
/**
@@ -436,36 +437,31 @@
*/
@RolesAllowed("mejbuser")
public Long getSnapshotDuration() {
- if(snapshotThread != null) {
- return new Long(snapshotThread.getSnapshotDuration());
- } else {
- // return what is stored in the snapshot-config.xml or default value
- return fetchSnapshotDuration();
+ // return what is stored in the snapshot-config.xml or default value
+ final String DURATION = "duration";
+ try {
+ String returnedDuration = SnapshotConfigXMLBuilder.getAttributeValue( DURATION );
+ return Long.parseLong( returnedDuration );
+ } catch(Exception e) {
+ return DEFAULT_DURATION; // the default
}
}
/**
* Sets the elapsed time in milliseconds between each snapshot.
+ * The duration will be read in each time the handleTimeout()
+ * is called. So the change will be seen when the next
+ * handleTimeout() is called.
*
* @param snapshotDuration
*/
@RolesAllowed("mejbuser")
public void setSnapshotDuration(Long snapshotDuration) {
- if(snapshotThread != null) {
- snapshotThread.setSnapshotDuration(snapshotDuration.longValue());
- saveDuration(snapshotThread.getSnapshotDuration());
- } else {
- System.out.println("There is not a snapshot thread instantiated.");
- }
+ saveDuration(snapshotDuration);
}
public void setSnapshotRetention(int retention) {
- if(snapshotThread != null) {
- snapshotThread.setSnapshotRetention(retention);
- saveRetention(snapshotThread.getSnapshotRetention());
- } else {
- System.out.println("There is not a snapshot thread instantiated.");
- }
+ saveRetention(retention);
}
@RolesAllowed("mejbuser")
@@ -481,7 +477,7 @@
*/
@RolesAllowed("mejbuser")
public Set<String> getStatisticsProviderMBeanNames() {
- return mbeanHelper.getStatsProvidersMBeans( getAllMBeanNames() );
+ return MBeanHelper.getStatsProvidersMBeans( getAllMBeanNames() );
}
/**
@@ -499,7 +495,7 @@
}
return strNames;
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
return new HashSet<String>();
}
}
@@ -512,16 +508,6 @@
SnapshotConfigXMLBuilder.saveRetention(retention);
}
- private Long fetchSnapshotDuration() {
- final String DURATION = "duration";
- try {
- String returnedDuration = SnapshotConfigXMLBuilder.getAttributeValue( DURATION );
- return Long.parseLong( returnedDuration );
- } catch(Exception e) {
- return DEFAULT_DURATION; // the default
- }
- }
-
/**
* Adds a record of the mbean via its name to take snapshots of. As a result
* the mbeanName will be written to snapshot-config.xml
@@ -531,7 +517,6 @@
@RolesAllowed("mejbuser")
public void addMBeanForSnapshot(String mbeanName) {
SnapshotConfigXMLBuilder.addMBeanName(mbeanName);
- snapshotThread.addMBeanForSnapshot(mbeanName);
}
/**
@@ -543,7 +528,6 @@
@RolesAllowed("mejbuser")
public void removeMBeanForSnapshot(String mbeanName) {
SnapshotConfigXMLBuilder.removeMBeanName(mbeanName);
- snapshotThread.removeMBeanForSnapshot(mbeanName);
}
/**
@@ -579,7 +563,7 @@
}
}
} catch (Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
// save attributes to the returning list
snapshotAttributes.put(mbeanName, mbeanStatsList);
@@ -592,11 +576,12 @@
*/
@RolesAllowed("mejbuser")
public boolean isSnapshotRunning() {
- if(snapshotThread == null) {
- return false;
+ Collection<Timer> timers = timer.getTimers();
+ // if there are timers there is something running to collect snapshots
+ if(timers.size() > 0) {
+ return true;
} else {
- // snapshot is running when snapshotThread has not ended
- return !snapshotThread.getEnd();
+ return false;
}
}
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/SMP.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/SMP.java?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/SMP.java (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/SMP.java Mon Nov 5 13:46:54 2007
@@ -51,18 +51,15 @@
public static void main(String[] args) {
try {
Properties props = new Properties();
- props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.openejb.client.RemoteInitialContextFactory");
+ props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
props.setProperty(Context.PROVIDER_URL, "ejbd://localhost:4201");
props.setProperty(Context.SECURITY_PRINCIPAL, username);
props.setProperty(Context.SECURITY_CREDENTIALS, password);
props.setProperty("openejb.authentication.realmName", "geronimo-admin");
Context ic = new InitialContext(props);
- System.out.println("Success: Initialized InitialContext");
MasterRemoteControlRemote mrc = (MasterRemoteControlRemote)ic.lookup("ejb/mgmt/MRCRemote");
- System.out.println("Success: look up MRCRemote");
mrc.setUpMEJB(username, password);
mrc.startSnapshot(new Long(300000));
- System.out.println("Success: setUpMEJB");
/*
JMXServiceURL serviceURL = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:1099/JMXConnector");
Hashtable env = new Hashtable();
@@ -119,6 +116,9 @@
testGetAllSnapshotAttributes(mrc);
testGetSpecificStats(mrc, "geronimo:J2EEServer=geronimo,j2eeType=JVM,name=JVM", "JVM Heap Size Current", 5, 2);
testGetMBeansTracked(mrc);
+// mrc.setSnapshotDuration(new Long(30000));
+// System.out.println("Snapshot Duration: " + mrc.getSnapshotDuration());
+// mrc.stopSnapshot();
} catch (Exception e) {
e.printStackTrace();
}
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotConfigXMLBuilder.java Mon Nov 5 13:46:54 2007
@@ -26,6 +26,9 @@
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -38,6 +41,8 @@
* In charge of dealing with the XML processing of the snapshot's data.
*/
public class SnapshotConfigXMLBuilder {
+ private static Log log = LogFactory.getLog(SnapshotConfigXMLBuilder.class);
+
private static final String pathToXML =
System.getProperty("org.apache.geronimo.home.dir") + "/var/monitoring/snapshot-config.xml";
@@ -174,7 +179,7 @@
} catch(Exception e) {
}
- System.out.println("***saving: " + attrName + " = " + attributeValue);
+ log.info("***saving: " + attrName + " = " + attributeValue);
// save the document to file
saveDocument(doc, pathToXML);
}
@@ -187,7 +192,7 @@
*/
public static String getAttributeValue(String key) throws Exception {
// ensure that there exists the 'monitor' directory
- SnapshotThread.ensureMonitorDir();
+ SnapshotProcessor.ensureMonitorDir();
// get an instance of the document
Document doc = openDocument();
// get the root element node
@@ -238,7 +243,7 @@
// create an instance of DOM
return db.newDocument();
} catch(ParserConfigurationException pce) {
- System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
+ log.error("Error while trying to instantiate DocumentBuilder", pce);
}
return null;
}
@@ -256,7 +261,7 @@
XMLSerializer serializer = new XMLSerializer(new FileOutputStream(new File(path)), format);
serializer.serialize(document);
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
}
@@ -280,7 +285,7 @@
} catch(Exception e) {
// Either this file is being read/written to by snapshot thread
// or there is an UNKNOWN error
- System.out.println(e.getMessage());
+ log.error(e.getMessage(), e);
}
}
}
Modified: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotDBHelper.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotDBHelper.java?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotDBHelper.java (original)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotDBHelper.java Mon Nov 5 13:46:54 2007
@@ -30,7 +30,11 @@
import javax.sql.DataSource;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
public class SnapshotDBHelper {
+ private static Log log = LogFactory.getLog(SnapshotDBHelper.class);
// field attributes for the Statistics table in the DB
private static final String SNAPSHOT_TIME = "snapshot_time";
private static final String MBEANNAME = "mbeanName";
@@ -65,7 +69,7 @@
retval.put(mbeanName, mbeanAttributeList);
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
closeConnection();
}
@@ -86,7 +90,7 @@
rs.next();
retval = rs.getLong(1);
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
closeConnection();
}
@@ -168,7 +172,7 @@
}
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
closeConnection();
}
@@ -226,7 +230,7 @@
closeConnection();
}
} catch(Exception e){
- e.printStackTrace();
+ log.error(e.getMessage(), e);
success = false;
} finally {
closeConnection();
@@ -238,7 +242,7 @@
long retentionMillis = (long)(retentionDays) * 86400000; // convert from days to milliseconds
archiveSnapshots( Long.parseLong(currTime) - retentionMillis );
} catch(Exception e) {
- System.out.println("[WARN] Cannot archive snapshots because attribute 'retention' is not present in snapshot-config.xml.");
+ log.warn("Cannot archive snapshots because attribute 'retention' is not present in snapshot-config.xml.");
}
return success;
}
@@ -310,17 +314,17 @@
closeConnection();
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
closeConnection();
}
// ensure that the transferring was good
if(snapshotsOver != 0) {
- System.out.println("[WARN] Transferred snapshots was completed, but some things were lost.");
+ log.warn("Transferred snapshots was completed, but some things were lost.");
}
if(statisticsOver != 0) {
- System.out.println("[WARN] Transferred statistics was completed, but some things were lost.");
+ log.warn("Transferred statistics was completed, but some things were lost.");
}
}
@@ -334,7 +338,7 @@
String query = "SELECT DISTINCT snapshot_time FROM Statistics WHERE snapshot_time < " + cutOffTime;
return stmt.executeQuery(query);
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
return null;
}
@@ -435,7 +439,7 @@
}
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
closeConnection();
}
@@ -477,7 +481,7 @@
snapshotPkg.put(currMBean, mbeanInfo);
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
closeConnection();
}
@@ -504,7 +508,7 @@
Statement stmt = conn.createStatement();
retval = stmt.executeQuery(query);
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
return retval;
}
@@ -522,7 +526,7 @@
Statement stmt = conn.createStatement();
retval = stmt.executeQuery(query);
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
return retval;
}
@@ -534,7 +538,7 @@
try {
conn = activeDS.getConnection();
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
}
@@ -545,7 +549,7 @@
try {
conn = archiveDS.getConnection();
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
}
@@ -557,7 +561,7 @@
try {
conn.close();
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
}
}
}
@@ -576,7 +580,7 @@
Statement stmt = conn.createStatement();
int mbeanId = getMBeanId(mbeanName);
if(mbeanId == -1) {
- System.out.println("[ERROR] " + mbeanName + " does not exist in the database.");
+ log.error(mbeanName + " does not exist in the database.");
} else {
String query = "SELECT DISTINCT snapshot_time, statsValueList, statsNameList FROM Statistics, MBeans M WHERE mbeanId=" + mbeanId + " AND mbeanId=M.id ORDER BY snapshot_time DESC";
ResultSet rs = stmt.executeQuery(query);
@@ -597,7 +601,7 @@
}
// exit function after error
if(statsValue == null) {
- System.out.println("[WARN] Statistics name '" + statsName + "' does not exist");
+ log.warn("Statistics name '" + statsName + "' does not exist");
return stats;
} else {
stats.put(rs.getLong(SNAPSHOT_TIME), statsValue);
@@ -613,7 +617,7 @@
}
}
} catch(Exception e) {
- e.printStackTrace();
+ log.error(e.getMessage(), e);
} finally {
closeConnection();
}
Added: 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=592158&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java (added)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java Mon Nov 5 13:46:54 2007
@@ -0,0 +1,190 @@
+/**
+ * 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.monitor.snapshot;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+import javax.management.j2ee.Management;
+import javax.management.MBeanServer;
+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.snapshot.SnapshotXMLBuilder;
+import org.apache.geronimo.monitor.MasterRemoteControlRemote;
+import org.apache.geronimo.monitor.MBeanHelper;
+
+/**
+ * Thread that is in charge of executing every x milliseconds. Upon each
+ * iteration, a snapshot of the server's information is recorded.
+ */
+public class SnapshotProcessor {
+
+ private static Log log = LogFactory.getLog(SnapshotProcessor.class);
+
+ /**
+ * Collects JSR-77 statistics for all mbeans that have been chosen to
+ * be monitored and stores it in a DB. Will also, archive snapshots
+ * if they have passed their retention period.
+ * @param username
+ * @param password
+ */
+ public static void takeSnapshot(String username, String password) {
+ // ensure that there is a 'monitoring' directory
+ ensureMonitorDir();
+ // get any saved mbean names from snapshot-config.xml
+ ArrayList<String> mbeanNames = SnapshotConfigXMLBuilder.getMBeanNames();
+ // get a handle on the mrc
+ MasterRemoteControlRemote mrc = getMRC(username, password);
+ // in the case where nothing is present, grab a set of default mbeans
+ if(mbeanNames.size() <= 0) {
+ mbeanNames = getDefaultMBeanList(mrc);
+ }
+ // turn on all stats in the list
+ setStatsOn(mbeanNames, mrc);
+ try {
+ // take a snapshot
+ log.info("======SNAPSHOT======");
+ // instantiate map <mbean name, stats for mbean>
+ HashMap<String, HashMap<String, Long>> aggregateStats = new HashMap<String, HashMap<String, Long>>();
+ // for each mbean name in the list, get its stats
+ for(int i = 0; i < mbeanNames.size(); i++) {
+ String mbeanName = mbeanNames.get(i);
+ HashMap<String, Long> stats = (HashMap<String, Long>)mrc.getStats(mbeanName);
+ aggregateStats.put(mbeanName, stats);
+ }
+
+ // store the data in a DB
+ SnapshotDBHelper.addSnapshotToDB(aggregateStats);
+
+ for(Iterator itt = aggregateStats.keySet().iterator(); itt.hasNext(); ) {
+ String mbean = (String)itt.next();
+ HashMap<String, Long> stats = aggregateStats.get(mbean);
+ log.info(mbean);
+ for(Iterator it = stats.keySet().iterator(); it.hasNext(); ) {
+ String key = (String)it.next();
+ Long value = (Long)stats.get(key);
+ log.info(key + ": " + value);
+ }
+ }
+ } catch(Exception e) {
+ log.error(e.getMessage(), e);
+ }
+ }
+
+ /**
+ * Turns all statistics on for each mbean in the list.
+ *
+ * @param mbeanList
+ */
+ private static void setStatsOn(ArrayList<String> mbeanList, MasterRemoteControlRemote mrc) {
+ // for each mbean name in the list
+ for(int i = 0; i < mbeanList.size(); i++) {
+ // turn the statistics collection on
+ String methodName = "setStatsOn";
+ Object[] params = new Object[] { Boolean.TRUE };
+ String[] signatures = new String[] { "boolean" };
+ try {
+ 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));
+ }
+ }
+ }
+
+ /**
+ * @return A list of all default mbeans; namely, all connector or container mbean names
+ * Prereq: in order to be a connector or container mbean the name must contain "Connector"/"Container"
+ * and "Tomcat"/"Jetty" or JVM.
+ */
+ private static ArrayList<String> getDefaultMBeanList(MasterRemoteControlRemote mrc) {
+ Set<String> mbeans = MBeanHelper.getStatsProvidersMBeans( mrc.getAllMBeanNames() );
+ ArrayList<String> retval = new ArrayList<String>();
+ for(Iterator it = mbeans.iterator(); it.hasNext(); ) {
+ String name = (String)it.next();
+ if(((name.contains("Connector") || name.contains("Container")) && (name.contains("Jetty") || name.contains("Tomcat")))
+ || name.contains("JVM")) {
+ // this is a connector or JVM, so add to the list
+ retval.add(name);
+ // update the snapshot-config.xml to include these
+ SnapshotConfigXMLBuilder.addMBeanName(name);
+ }
+ }
+ return retval;
+ }
+
+ /**
+ * Checks to see if the GERONIMO_HOME/var/monitoring/ directory was made.
+ * If not, the method creates it.
+ */
+ public static void ensureMonitorDir() {
+ final String pathToDir =
+ System.getProperty("org.apache.geronimo.home.dir") + "/var/monitoring/";
+ File dir = new File(pathToDir);
+ if(dir.exists() && dir.isDirectory()) {
+ // all good
+ return;
+ } else {
+ // make a directory
+ if(dir.mkdir()) {
+ // directory was successfully created
+ log.info("/var/monitoring directory created.");
+ return;
+ } else {
+ log.error("Could not make the directory " + pathToDir);
+ }
+ }
+ }
+
+ /**
+ * @return An instance of a MRC.
+ */
+ public static MasterRemoteControlRemote getMRC(String username, String password) {
+ // TODO:
+ // Need to find a way to grab the MRC using LocalInitialContext
+ // so it can get through security and be more efficient.
+ Properties props = new Properties();
+ props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.RemoteInitialContextFactory");
+ props.setProperty(Context.PROVIDER_URL, "127.0.0.1:4201");
+ props.setProperty(Context.SECURITY_PRINCIPAL, username);
+ props.setProperty(Context.SECURITY_CREDENTIALS, password);
+ props.setProperty("openejb.authentication.realmName", "geronimo-admin");
+ try {
+ Context ic = new InitialContext(props);
+ MasterRemoteControlRemote mrc = (MasterRemoteControlRemote)ic.lookup("ejb/mgmt/MRCRemote");
+ return mrc;
+ } catch(Exception e) {
+ return null;
+ }
+ }
+}
Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-ejb/src/main/java/org/apache/geronimo/monitor/snapshot/SnapshotProcessor.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/LICENSE.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/LICENSE.txt?rev=592158&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/LICENSE.txt (added)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/LICENSE.txt Mon Nov 5 13:46:54 2007
@@ -0,0 +1,203 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed 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.
+
Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/LICENSE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/NOTICE.txt
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/NOTICE.txt?rev=592158&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/NOTICE.txt (added)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/NOTICE.txt Mon Nov 5 13:46:54 2007
@@ -0,0 +1,5 @@
+Apache Geronimo
+Copyright 2003-2006 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/NOTICE.txt
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/pom.xml?rev=592158&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/pom.xml (added)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/pom.xml Mon Nov 5 13:46:54 2007
@@ -0,0 +1,40 @@
+<!--
+
+ 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.
+-->
+<project 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.modules</groupId>
+ <artifactId>modules</artifactId>
+ <version>2.1-SNAPSHOT</version>
+ </parent>
+ <artifactId>mrc-sql-jar</artifactId>
+ <name>Geronimo Modules :: Monitoring Database Module</name>
+ <packaging>jar</packaging>
+ <description>
+ This module carries the Monitoring's SQL scripts for all databases.
+ </description>
+ <build>
+ <resources>
+ <resource>
+ <directory>${pom.basedir}/src/main</directory>
+ <targetPath>META-INF</targetPath>
+ <filtering>true</filtering>
+ </resource>
+ </resources>
+ </build>
+</project>
\ No newline at end of file
Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/derby/createTables.sql
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/derby/createTables.sql?rev=592158&view=auto
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/derby/createTables.sql (added)
+++ geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/derby/createTables.sql Mon Nov 5 13:46:54 2007
@@ -0,0 +1,38 @@
+-- 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.
+
+-----------------------------------------------------------------------------
+-- MBEANS
+-----------------------------------------------------------------------------
+
+CREATE TABLE MBeans(
+ id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ mbeanName VARCHAR(256) NOT NULL,
+ statsNameList VARCHAR(512) NOT NULL,
+ PRIMARY KEY(id)
+);
+
+-----------------------------------------------------------------------------
+-- STATISTICS
+-----------------------------------------------------------------------------
+
+CREATE TABLE Statistics (
+ id INT NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
+ mbeanId INT NOT NULL,
+ snapshot_time BIGINT NOT NULL,
+ statsValueList VARCHAR(512) NOT NULL,
+ PRIMARY KEY(id),
+ FOREIGN KEY (mbeanId) REFERENCES MBeans(id)
+);
\ No newline at end of file
Propchange: geronimo/sandbox/monitoring/mrc-server/mrc-sql-jar/src/main/database/derby/createTables.sql
------------------------------------------------------------------------------
svn:eol-style = native
Modified: geronimo/sandbox/monitoring/mrc-server/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/monitoring/mrc-server/pom.xml?rev=592158&r1=592157&r2=592158&view=diff
==============================================================================
--- geronimo/sandbox/monitoring/mrc-server/pom.xml (original)
+++ geronimo/sandbox/monitoring/mrc-server/pom.xml Mon Nov 5 13:46:54 2007
@@ -1,73 +1,74 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-
-<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</groupId>
- <artifactId>mrc</artifactId>
- <version>1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
-
-
- <groupId>org.apache.geronimo.plugins.mrc</groupId>
- <artifactId>mrc-server</artifactId>
- <name>Geronimo Stats :: Server</name>
- <packaging>pom</packaging>
-
- <description>
- Geronimo MRC sample created from an archetype.
- </description>
-
-
-
- <modules>
- <module>mrc-ds-car</module>
- <module>mrc-ejb</module>
- <module>mrc-ear</module>
- <module>mrc-car</module>
- </modules>
-
- <repositories>
- <repository>
- <id>apache-snapshots</id>
- <name>Apache Snapshots Repository</name>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- <layout>default</layout>
- <snapshots>
- <enabled>true</enabled>
- <updatePolicy>daily</updatePolicy>
- <checksumPolicy>ignore</checksumPolicy>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
-</project>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+
+<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</groupId>
+ <artifactId>mrc</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+
+
+ <groupId>org.apache.geronimo.plugins</groupId>
+ <artifactId>mrc-server</artifactId>
+ <name>Geronimo Stats :: Server</name>
+ <packaging>pom</packaging>
+
+ <description>
+ Geronimo MRC sample created from an archetype.
+ </description>
+
+
+
+ <modules>
+ <module>mrc-sql-jar</module>
+ <module>mrc-ds-car</module>
+ <module>mrc-ejb</module>
+ <module>mrc-ear</module>
+ <module>mrc-car</module>
+ </modules>
+
+ <repositories>
+ <repository>
+ <id>apache-snapshots</id>
+ <name>Apache Snapshots Repository</name>
+ <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+ <layout>default</layout>
+ <snapshots>
+ <enabled>true</enabled>
+ <updatePolicy>daily</updatePolicy>
+ <checksumPolicy>ignore</checksumPolicy>
+ </snapshots>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+</project>