[jboss-svn-commits] JBL Code SVN: r20716 - in labs/jbossesb/trunk/product/tools: jonplugin and 11 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jun 23 23:06:32 EDT 2008


Author: tcunning
Date: 2008-06-23 23:06:32 -0400 (Mon, 23 Jun 2008)
New Revision: 20716

Added:
   labs/jbossesb/trunk/product/tools/jonplugin/
   labs/jbossesb/trunk/product/tools/jonplugin/install.sh
   labs/jbossesb/trunk/product/tools/jonplugin/pom.xml
   labs/jbossesb/trunk/product/tools/jonplugin/src/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/
   labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
   labs/jbossesb/trunk/product/tools/jonplugin/src/test/
   labs/jbossesb/trunk/product/tools/jonplugin/src/test/java/
   labs/jbossesb/trunk/product/tools/jonplugin/src/test/resources/
   labs/jbossesb/trunk/product/tools/jonplugin/src/test/resources/log4j.xml
Log:
bug:JBESB-668
Initial commit of jon plugin work.


Added: labs/jbossesb/trunk/product/tools/jonplugin/install.sh
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/install.sh	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/jonplugin/install.sh	2008-06-24 03:06:32 UTC (rev 20716)
@@ -0,0 +1,3 @@
+#!/bin/sh
+mvn -Dmaven.test.skip=true clean install
+cp target/rhq-jbossesb-plugin-2.0.1-SNAPSHOT.jar ~/src/jon/dev-container/jbossas/server/default/deploy/rhq.ear/rhq-downloads/rhq-plugins


Property changes on: labs/jbossesb/trunk/product/tools/jonplugin/install.sh
___________________________________________________________________
Name: svn:executable
   + *

Added: labs/jbossesb/trunk/product/tools/jonplugin/pom.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/pom.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/jonplugin/pom.xml	2008-06-24 03:06:32 UTC (rev 20716)
@@ -0,0 +1,215 @@
+<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.jboss.on</groupId>
+      <!--  Bypass the jon-plugins-parent which can not have children. It must build after the plugins in order to execute integration tests on them. -->
+      <artifactId>jon-parent</artifactId>
+      <version>2.0.1-SNAPSHOT</version>
+   </parent>
+
+   <groupId>org.jboss.on</groupId>
+   <artifactId>rhq-jbossesb-plugin</artifactId>
+   <packaging>jar</packaging>
+
+   <name>JON JBossESB Plugin</name>
+   <description>A plugin for managing JBossESB services</description>
+
+   <scm>
+      <connection>scm:svn:http://svn.corp.jboss.com/repos/jon/trunk/jon/plugins/jbossesb/</connection>
+      <developerConnection>scm:svn:http://svn.corp.jboss.com/repos/jon/trunk/jon/plugins/jbossesb/</developerConnection>
+   </scm>
+
+   <properties>
+      <scm.module.path>jon/plugins/jbossesb/</scm.module.path>
+   </properties>
+
+   <build>
+      <plugins>
+
+         <!-- Used to add dependencies to the plugin lib
+         <plugin>
+            <artifactId>maven-dependency-plugin</artifactId>
+            <version>2.0</version>
+            <executions>
+               <execution>
+                  <id>copy-postgres-jar</id>
+                  <phase>process-resources</phase>
+                  <goals>
+                     <goal>copy</goal>
+                  </goals>
+                  <configuration>
+                     <artifactItems>
+                        <artifactItem>
+                           <groupId>postgresql</groupId>
+                           <artifactId>postgresql</artifactId>
+                           <version>8.1-407.jdbc3</version>
+                        </artifactItem>
+                     </artifactItems>
+                     <outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
+                  </configuration>
+               </execution>
+            </executions>
+         </plugin>-->
+      </plugins>
+   </build>
+   <profiles>
+      <profile>
+         <id>integration-tests</id>
+         <activation>
+            <property>
+               <name>maven.test.skip</name>
+               <value>!true</value>
+            </property>
+         </activation>
+
+         <build>
+            <plugins>
+
+               <!-- Integration testing voodoo to load and test this plugin with its plugin dependencies -->
+               <plugin>
+                  <artifactId>maven-antrun-plugin</artifactId>
+                  <executions>
+                     <execution>
+                        <phase>pre-integration-test</phase>
+                        <configuration>
+                           <tasks>
+                              <echo>Setting up plugin dependencies for ${project.artifactId}-${project.version}.jar...</echo>
+                              <property name="settings.localRepository" location="${user.home}/.m2/repository" />
+                              <mkdir dir="target/itest" />
+                              <mkdir dir="target/itest/plugins" />
+                              <mkdir dir="target/itest/lib" />
+                              <copy toDir="target/itest/plugins" flatten="true">
+                                 <fileset dir="${settings.localRepository}/">
+                                    <include name="org/rhq/rhq-platform-plugin/${rhq.version}/rhq-platform-plugin-${rhq.version}.jar" />
+                                    <include name="org/rhq/rhq-jmx-plugin/${rhq.version}/rhq-jmx-plugin-${rhq.version}.jar" />
+                                    <include name="org/jboss/on/rhq-tomcat-plugin/${project.version}/rhq-tomcat-plugin-${project.version}.jar" />
+                                    <include name="org/jboss/on/rhq-jbossas-plugin/${project.version}/rhq-jbossas-plugin-${project.version}.jar" />
+                                 </fileset>
+                                 <fileset dir="${project.build.directory}">
+                                    <include name="${project.artifactId}-${project.version}.jar" />
+                                 </fileset>
+                              </copy>
+                              <unzip dest="target/itest/lib">
+                                 <fileset dir="${settings.localRepository}/org/hyperic/sigar-dist/${sigar.version}" includes="*.zip" />
+                                 <patternset>
+                                    <include name="**/lib/sigar.jar" />
+                                    <include name="**/lib/bcel*.jar" />
+                                    <include name="**/lib/*.so" />
+                                    <include name="**/lib/*.sl" />
+                                    <include name="**/lib/*.dll" />
+                                    <include name="**/lib/*.dylib" />
+                                 </patternset>
+                              </unzip>
+                              <move todir="target/itest/lib" flatten="true">
+                                 <fileset dir="target/itest/lib">
+                                    <include name="**/lib/*" />
+                                 </fileset>
+                              </move>
+                              <delete dir="target/itest/lib/hyperic-sigar-${sigar.version}" />
+                           </tasks>
+                        </configuration>
+                        <goals>
+                           <goal>run</goal>
+                        </goals>
+                     </execution>
+                  </executions>
+               </plugin>
+
+               <plugin>
+                  <artifactId>maven-surefire-plugin</artifactId>
+                  <configuration>
+                     <skip>true</skip>
+                  </configuration>
+                  <executions>
+                     <execution>
+                        <id>surefire-it</id>
+                        <phase>integration-test</phase>
+                        <goals>
+                           <goal>test</goal>
+                        </goals>
+                        <configuration>
+                           <skip>${maven.test.skip}</skip>
+                           <excludedGroups>${rhq.testng.excludedGroups}</excludedGroups>
+                           <useSystemClassLoader>false</useSystemClassLoader>
+                           <argLine>-Dorg.hyperic.sigar.path=${basedir}/target/itest/lib</argLine>
+                           <!--<argLine>-Dorg.hyperic.sigar.path=${basedir}/target/itest/lib -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=y</argLine>-->
+                           <systemProperties>
+                              <property>
+                                 <name>project.artifactId</name>
+                                 <value>${project.artifactId}</value>
+                              </property>
+                              <property>
+                                 <name>project.version</name>
+                                 <value>${project.version}</value>
+                              </property>
+                           </systemProperties>
+                        </configuration>
+                     </execution>
+                  </executions>
+               </plugin>
+
+
+            </plugins>
+         </build>
+      </profile>
+
+      <profile>
+         <id>dev</id>
+
+         <properties>
+            <rhq.rootDir>../../..</rhq.rootDir>
+            <rhq.containerDir>${rhq.rootDir}/${rhq.defaultDevContainerPath}</rhq.containerDir>
+            <rhq.deploymentDir>${rhq.containerDir}/jbossas/server/default/deploy/${rhq.earName}/rhq-downloads/rhq-plugins</rhq.deploymentDir>
+         </properties>
+
+         <build>
+            <plugins>
+
+               <plugin>
+                 <artifactId>maven-antrun-plugin</artifactId>
+                 <version>1.1</version>
+                 <executions>
+
+                     <execution>
+                        <id>deploy</id>
+                        <phase>compile</phase>
+                        <configuration>
+                          <tasks>
+                            <mkdir dir="${rhq.deploymentDir}" />
+                            <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+                            <echo>*** Updating ${deployment.file}...</echo>
+                            <jar destfile="${deployment.file}" basedir="${project.build.outputDirectory}" />
+                          </tasks>
+                        </configuration>
+                        <goals>
+                          <goal>run</goal>
+                        </goals>
+                     </execution>
+
+                     <execution>
+                        <id>undeploy</id>
+                        <phase>clean</phase>
+                        <configuration>
+                          <tasks>
+                            <property name="deployment.file" location="${rhq.deploymentDir}/${project.build.finalName}.jar" />
+                            <echo>*** Deleting ${deployment.file}...</echo>
+                            <delete file="${deployment.file}" />
+                          </tasks>
+                        </configuration>
+                        <goals>
+                          <goal>run</goal>
+                        </goals>
+                     </execution>
+
+                   </executions>
+               </plugin>
+
+            </plugins>
+         </build>
+      </profile>
+
+   </profiles>
+
+</project>

Added: labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionComponent.java	2008-06-24 03:06:32 UTC (rev 20716)
@@ -0,0 +1,87 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.jbosson.plugins.jbossesb;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.bean.attribute.EmsAttribute;
+import org.mc4j.ems.connection.bean.operation.EmsOperation;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+
+/**
+ * @author Greg Hinkle
+ */
+public class ActionComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+    private ResourceContext<MBeanResourceComponent> context;
+
+    private static final String SUCCESS_PROCESSED = "messages successfully processed count";
+    private static final String FAILED_PROCESSED = "messages failed count";
+    private static final String PROCESSING_TIME = "processing time";
+    
+    private static final String SUCCESS_METRIC_NAME = "successProcessedCount";
+    private static final String FAILED_METRIC_NAME = "failedProcessedCount";
+    private static final String PROCESSINGTIME_METRIC_NAME = "processingTime";
+
+    @Override
+    public void start(ResourceContext<MBeanResourceComponent> context) {
+        this.context = context;
+        this.bean = context.getParentResourceComponent().getEmsBean();
+    }
+
+    @Override
+    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
+    	Configuration pluginConfig = this.context.getPluginConfiguration();
+    	pluginConfig.put(new PropertySimple("type", "action"));
+    	//String actionName = pluginConfig.getActionName();
+	
+    	String actionName = this.context.getResourceKey();
+    	actionName = actionName.trim();
+        //Object entityStatistics = operation.invoke(context.getResourceKey());
+
+        for (MeasurementScheduleRequest request : requests) {
+        	String metricName = request.getName();
+        	if (metricName.equals (SUCCESS_METRIC_NAME)) {
+        		EmsAttribute attribute = this.bean.getAttribute(actionName + " " + SUCCESS_PROCESSED);
+        		Integer processed = (Integer) attribute.refresh();
+        		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
+        	} else if (metricName.equals(FAILED_METRIC_NAME)) {
+        		EmsAttribute attribute = this.bean.getAttribute(actionName + " " + FAILED_PROCESSED);
+        	    Integer processed = (Integer) attribute.refresh();
+        		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
+        	} else if (metricName.equals(PROCESSINGTIME_METRIC_NAME)) {
+        		EmsAttribute attribute = this.bean.getAttribute(actionName + " " + PROCESSING_TIME);
+        		Double processed = (Double) attribute.refresh();
+        		if (processed != null) {
+        			report.addData(new MeasurementDataNumeric(request, processed));
+        		} else {
+        			report.addData(new MeasurementDataNumeric(request, new Double(0)));
+        		}
+        	}
+        }
+    }
+}

Added: labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ActionDiscoveryComponent.java	2008-06-24 03:06:32 UTC (rev 20716)
@@ -0,0 +1,104 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.jbosson.plugins.jbossesb;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.mc4j.ems.connection.bean.EmsBean;
+import org.mc4j.ems.connection.bean.attribute.EmsAttribute;
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.Property;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.rhq.core.domain.measurement.AvailabilityType;
+import org.rhq.core.pluginapi.inventory.DiscoveredResourceDetails;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryComponent;
+import org.rhq.core.pluginapi.inventory.ResourceDiscoveryContext;
+import org.rhq.plugins.jmx.JMXComponent;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+/**
+ * Discovers hibernate entities from a hibernate stats mbean
+ *
+ * @author Greg Hinkle
+ * @param <T>
+ */
+public class ActionDiscoveryComponent<T extends JMXComponent> implements ResourceDiscoveryComponent<MBeanResourceComponent> {
+	
+	private static final String SERVICE_NAME = "service-name";
+	private static final String MESSAGES_SUCCESSFULLY_PROCESSED = "messages successfully processed count";
+	private static final String MESSAGES_FAILED_COUNT = "messages failed count";
+	private static final String MESSAGES_PROCESSED_TIME = "processing time";
+	
+	private static Log log = LogFactory.getLog(ActionDiscoveryComponent.class);
+	
+	protected ResourceContext<T> resourceContext;
+	
+	public void start(ResourceContext<T> context) {
+		this.resourceContext = context;
+	}
+	
+	
+	public AvailabilityType getAvailability() {
+		JMXComponent parent = resourceContext.getParentResourceComponent();
+		
+		try {
+			return AvailabilityType.UP;
+		} catch (NullPointerException npe) {
+			log.warn("Could not determine availability of unknown ems bean");
+		}
+		return AvailabilityType.DOWN;
+	}
+	
+    public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<MBeanResourceComponent> context) {
+        Set<DiscoveredResourceDetails> entities = new HashSet<DiscoveredResourceDetails>();
+
+        EmsBean actionBean = context.getParentResourceComponent().getEmsBean();
+        String serviceName = actionBean.getBeanName().getKeyProperty(SERVICE_NAME);
+
+        // Do two passes - one to grab the entity names (ex. "data fileraction"
+        // and then a second to build up the metrics for the entity
+        Set<EmsAttribute> attributeSet = actionBean.getAttributes();
+        for (Iterator i = attributeSet.iterator(); i.hasNext();) {
+        	EmsAttribute attr = (EmsAttribute) i.next();
+        	if (attr.getName().endsWith(MESSAGES_SUCCESSFULLY_PROCESSED)) {
+        		String actionName = attr.getName().replaceAll(MESSAGES_SUCCESSFULLY_PROCESSED, "");
+                DiscoveredResourceDetails detail = new DiscoveredResourceDetails(context.getResourceType(), actionName,
+                        actionName, null, "Action Entity", null, null);
+                
+                Configuration pc = detail.getPluginConfiguration();
+                ArrayList<Property> props = new ArrayList<Property>();
+                //PropertySimple ps = new PropertySimple("", "");
+                //props.add(ps);
+                //pc.setProperties(props);
+                //List<EmsAttribute> refreshedAttribute = actionBean.refreshAttributes();
+                
+                entities.add(detail);
+        	}
+        }
+        
+        return entities;
+    }
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/java/org/jbosson/plugins/jbossesb/ServiceComponent.java	2008-06-24 03:06:32 UTC (rev 20716)
@@ -0,0 +1,63 @@
+/*
+ * RHQ Management Platform
+ * Copyright (C) 2005-2008 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.jbosson.plugins.jbossesb;
+
+import java.util.Set;
+
+import org.mc4j.ems.connection.bean.attribute.EmsAttribute;
+import org.mc4j.ems.connection.bean.operation.EmsOperation;
+import org.rhq.core.domain.measurement.MeasurementDataNumeric;
+import org.rhq.core.domain.measurement.MeasurementReport;
+import org.rhq.core.domain.measurement.MeasurementScheduleRequest;
+import org.rhq.core.pluginapi.inventory.ResourceContext;
+import org.rhq.plugins.jmx.MBeanResourceComponent;
+
+import org.rhq.core.domain.configuration.Configuration;
+import org.rhq.core.domain.configuration.PropertySimple;
+import org.mc4j.ems.connection.bean.EmsBean;
+
+
+/**
+ * @author Greg Hinkle
+ */
+public class ServiceComponent extends MBeanResourceComponent<MBeanResourceComponent> {
+    private ResourceContext<MBeanResourceComponent> context;
+
+    private static final String OVERALL_MESSAGE_COUNT = "overall service message count";    
+    private static final String OVERALL_MESSAGE_METRIC = "overallMessageCount";
+    
+    @Override
+    public void start(ResourceContext<MBeanResourceComponent> context) {
+        this.context = context;
+    }
+
+    @Override
+    public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> requests) {
+    	Configuration pluginConfig = this.context.getPluginConfiguration();
+	pluginConfig.put(new PropertySimple("type", "service"));
+        for (MeasurementScheduleRequest request : requests) {
+        	String metricName = request.getName();
+        	if (metricName.equals(OVERALL_MESSAGE_METRIC)) {
+        		EmsAttribute attribute = getEmsBean().getAttribute(OVERALL_MESSAGE_COUNT);
+        		Integer processed = (Integer) attribute.refresh();
+        		report.addData(new MeasurementDataNumeric(request, new Double(processed.doubleValue())));
+        	}
+        }
+    }
+}

Added: labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/main/resources/META-INF/rhq-plugin.xml	2008-06-24 03:06:32 UTC (rev 20716)
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<plugin name="JBossESB"
+        displayName="JBoss ESB Services"
+        package="org.jbosson.plugins.jbossesb"
+        description="Provides monitoring of JBoss ESB"
+        version="2.0"
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+        xmlns="urn:xmlns:rhq-plugin"
+        xmlns:c="urn:xmlns:rhq-configuration">
+
+   <depends plugin="JMX" />
+   <depends plugin="Tomcat" />
+   <depends plugin="JBossAS" useClasses="true"/>
+
+   <service name="JBossESB .esb Package"
+      discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
+      class="org.rhq.plugins.jmx.MBeanResourceComponent"
+      description="Statistics for JBoss ESB">
+
+       <runs-inside>
+         <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
+      </runs-inside>
+
+      <plugin-configuration>
+         <c:simple-property name="objectName" readOnly="true" default="jboss.esb:deployment=%deployment%,type=esb"/>
+         <c:simple-property name="nameTemplate" default="{deployment} JBoss ESB statistics"/>
+         <c:simple-property name="descriptionTemplate" default="JBoss ESB statistics for the {deployment} deployment."/>
+         <c:simple-property name="deployment" type="string" description="the JBoss ESB deployment name"/>
+      </plugin-configuration>
+	
+    
+     <operation name="start" displayName="Start deployment" description="Start the JBoss ESB deployment"/>
+     <operation name="stop" displayName="Stop deployment" description="Stop the JBoss ESB deployment"/>
+     <operation name="create" displayName="Move .esb deployment into the create state" description="Move the .esb deployment into the create state"/>
+     <operation name="destroy" displayName="Move .esb deployment into the destroy state" description="Move the .esb deployment into the destroy state"/>
+
+     <metric property="Name" displayName="Deployment Type" dataType="trait" displayType="summary" defaultOn="true" description="Type of deployment"/>
+     <!-- EsbXmlAsHtml is too large to fit in a measurement.
+     <metric property="JbossEsbXmlAsHtml" displayName="ESB XML" dataType="trait" displayType="summary" defaultOn="true" description="The jboss-esb.xml of {deployment}"/--> 
+     <metric property="StateString" displayName=".esb State String" dataType="trait" displayType="summary" defaultOn="true" description="Current state of the ESB"/>
+      
+       <help>
+          <![CDATA[
+	  JBoss ESB esb
+          ]]>
+       </help>
+      <service name="JBoss ESB Services"
+         discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
+         class="ServiceComponent"
+         description="JBoss ESB Services">
+       <runs-inside>
+         <parent-resource-type name="JBossAS Server" plugin="JBossAS"/>
+       </runs-inside>
+         <plugin-configuration>
+              <c:simple-property name="objectName" readOnly="true" default="jboss.esb:category=MessageCounter,deployment={deployment},service-name=%serviceName%"/>
+              <c:simple-property name="nameTemplate" default="{serviceName} JBoss ESB statistics"/>
+              <c:simple-property name="DescriptionTemplate" default="JBoss ESB statistics for the {serviceName} service."/>
+              <c:simple-property name="serviceName" type="string" description="the JBoss ESB service name"/>
+         </plugin-configuration>
+         <operation name="reset" displayName="Reset the message counter" description="Reset the message counter"/>
+         <metric displayName="Overall Service Message Count" property="overallMessageCount" category="throughput" displayType="summary" measurementType="trendsup" description="Overall Service Message Count"/> 
+         <help>
+             <![CDATA[
+	         JBoss ESB Service
+             ]]>
+         </help>
+         <service name="JBoss ESB Actions"
+         	discovery="ActionDiscoveryComponent"
+         	class="ActionComponent"
+         	description="JBoss ESB Actions">
+             <plugin-configuration>
+         	     <c:simple-property name="objectName" readOnly="true" default="jboss.esb:category=MessageCounter,deployment={deployment},service-name=%service-name%"/>
+         		 <c:simple-property name="nameTemplate" default="{actionName} JBoss ESB Action statistics"/>
+         	     <c:simple-property name="descriptionTemplate" default="JBoss ESB statistics for the {actionName} action."/>
+         		 <c:simple-property name="actionName" type="string" description="the JBoss ESB action name"/>
+			</plugin-configuration>
+	        <metric displayName="Messages Successfully Processed" property="successProcessedCount" category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup"/>
+	        <metric displayName="Messages Failed" property="failedProcessedCount"  category="throughput" displayType="summary" defaultOn="true" measurementType="trendsup"/>
+	        <metric displayName="Processing Time" property="processingTime" displayType="summary" defaultOn="true" category="performance"/>
+         </service>
+       </service> 
+    </service>
+</plugin>
+

Added: labs/jbossesb/trunk/product/tools/jonplugin/src/test/resources/log4j.xml
===================================================================
--- labs/jbossesb/trunk/product/tools/jonplugin/src/test/resources/log4j.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/tools/jonplugin/src/test/resources/log4j.xml	2008-06-24 03:06:32 UTC (rev 20716)
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml 9973 2008-05-08 00:57:31Z ispringer $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="true">
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Messagen -->
+         
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+         
+         <!--<param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L)  -%m%n"/>-->
+      </layout>
+   </appender>
+
+   <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
+      <param name="File" value="target/test.log"/>
+      <param name="Threshold" value="DEBUG"/>
+      <param name="Append" value="false"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Messagen -->
+         <!--
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+         -->
+         <param name="ConversionPattern" value="%-5p %d{dd-MM HH:mm:ss,SSS} (%F:%M:%L)  -%m%n"/>
+      </layout>
+   </appender>
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>




More information about the jboss-svn-commits mailing list