[jboss-svn-commits] JBL Code SVN: r14293 - in labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring: client and 2 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Aug 16 02:05:36 EDT 2007
Author: tcunning
Date: 2007-08-16 02:05:36 -0400 (Thu, 16 Aug 2007)
New Revision: 14293
Modified:
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/CastingHelper.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsBean.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsData.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollectorAction.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXAttribute.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXData.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXPattern.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerAction.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerJob.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerSchedulerMBean.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java
labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/TimeSeriesChartProducer.java
Log:
bug:JBESB-738
Add comments to source.
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/CastingHelper.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/CastingHelper.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/CastingHelper.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,5 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring;
+/**
+ * CastingHelper is a helper class which returns Integers/Floats/Doubles/Longs
+ * based on the type that a JMXAttribute is identifying itself as.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class CastingHelper {
public static Integer getInteger(Object obj) {
if (obj instanceof String) {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/JMXTest.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring;
import javax.naming.*;
@@ -6,6 +27,12 @@
import java.util.*;
+/**
+ * JMXTest is a simple command line test of the DataCollector.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class JMXTest {
public JMXTest() {
}
@@ -26,6 +53,5 @@
dcollector.collectData();
StatisticsData data = dcollector.getData();
data.print();
-
}
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/MonitoringSessionFactory.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,5 +1,3 @@
-package org.jboss.soa.esb.monitoring;
-
/*
* JBoss, Home of Professional Open Source
* Copyright 2006, JBoss Inc., and individual contributors as indicated
@@ -21,6 +19,27 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
+package org.jboss.soa.esb.monitoring;
+/*
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
import org.apache.log4j.Logger;
import org.hibernate.SessionFactory;
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsBean.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsBean.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsBean.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring;
import java.io.Serializable;
@@ -3,4 +24,11 @@
import java.util.Date;
+/**
+ * StatisticsBean is a serializable bean that contains JMX Attribute information.
+ * This data is passed in a command message from the DataCollector to the DataFiler.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class StatisticsBean implements Serializable {
private static final long serialVersionUID = -3039074516951343026L;
@@ -12,6 +40,15 @@
private String type;
private Object data;
+ /**
+ * Constructor.
+ * @param f_objectName object name
+ * @param f_attribute attribute name
+ * @param f_server server name
+ * @param f_collectionTime collection date
+ * @param f_type type
+ * @param f_data date
+ */
public StatisticsBean(String f_objectName, String f_attribute, String f_server,
Date f_collectionTime, String f_type, Object f_data) {
data = CastingHelper.castObject(f_type, f_data);
@@ -23,54 +60,105 @@
data = f_data;
}
+ /**
+ * Attribute name getter.
+ * @return attribute name
+ */
public String getAttribute() {
return attribute;
}
+ /**
+ * Attribute name mutator.
+ * @param attribute attribute name
+ */
public void setAttribute(String attribute) {
this.attribute = attribute;
}
+ /**
+ * Collection time getter.
+ * @return collection time
+ */
public Date getCollectionTime() {
return collectionTime;
}
+ /**
+ * Collection time mutator.
+ * @param collectionTime collection time
+ */
public void setCollectionTime(Date collectionTime) {
this.collectionTime = collectionTime;
}
+ /**
+ * Object data getter.
+ * @return data
+ */
public Object getData() {
return data;
}
+ /**
+ * Object data mutator.
+ * @param data data
+ */
public void setData(Object data) {
this.data = data;
}
+ /**
+ * Object name getter.
+ * @return object name
+ */
public String getObjectName() {
return objectName;
}
+ /**
+ * Object name setter.
+ * @param objectName object name
+ */
public void setObjectName(String objectName) {
this.objectName = objectName;
}
+ /**
+ * Server name getter.
+ * @return server name
+ */
public String getServer() {
return server;
}
+ /**
+ * Server name mutator.
+ * @param server server name
+ */
public void setServer(String server) {
this.server = server;
}
+ /**
+ * Getter for the class name of the JMX attribute.
+ * @return class type of JMX attribute
+ */
public String getType() {
return type;
}
+ /**
+ * Mutator for the class name of the JMX attribute.
+ * @param type class type of JMX attribute
+ */
public void setType(String type) {
this.type = type;
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
public String toString() {
String objectData = "";
if (data instanceof Integer) {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsData.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsData.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/StatisticsData.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring;
import java.io.Serializable;
@@ -4,18 +25,36 @@
import java.util.ArrayList;
import java.util.List;
+/**
+ * StatisticsData is a serializable collection of StatisticsBeans. The
+ * StatisticsData is object is the sole object that is passed in a command
+ * message from the DataCollector to the DataFiler.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class StatisticsData implements Serializable {
private static final long serialVersionUID = -2081662961582149106L;
private List<StatisticsBean> list;
+ /**
+ * Constructor which creates the list of StatisticsBeans.
+ */
public StatisticsData() {
list = new ArrayList<StatisticsBean>();
}
+ /**
+ * List getter.
+ * @return list
+ */
public List getList() {
return list;
}
+ /**
+ * Method for printing all of the StatisticBean information.
+ */
public void print() {
for (int i = 0; i < list.size(); i++) {
StatisticsBean sb = list.get(i);
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollector.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.client;
import java.io.IOException;
@@ -25,6 +46,15 @@
import org.jboss.soa.esb.monitoring.StatisticsData;
import org.jboss.soa.esb.monitoring.pojo.JMXPattern;
+/**
+ * DataCollector collects all JMX Attributes of ObjectNames that match
+ * specific ObjectName patterns contained in the database. The JMX Attribute
+ * data is collected in StatisticBean objects and then added to a StatisticData
+ * collection.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class DataCollector {
Logger logger = Logger.getLogger(DataCollector.class);
private Context context;
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollectorAction.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollectorAction.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/client/DataCollectorAction.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.client;
import java.net.URI;
@@ -18,12 +39,25 @@
import org.jboss.soa.esb.message.format.MessageFactory;
import org.jboss.soa.esb.monitoring.StatisticsData;
+/**
+ * The DataCollectorAction collects StatisticsData and then sends it to
+ * the DataFilerService EPR for storage.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class DataCollectorAction extends AbstractActionLifecycle {
protected ConfigTree _config;
private static Logger logger = Logger.getLogger(DataCollectorAction.class);
public DataCollectorAction(ConfigTree config) { _config = config; }
- public Message collectStatistics(Message message) throws Exception {
+ /**
+ * Action method which collects statistics and then delivers them to the data filer EPR.
+ * @param message message
+ * @return message
+ * @throws Exception
+ */
+ public Message collectStatistics(Message message) throws Exception {
if (message.getProperties().getProperty("COMMAND_MESSAGE") != null) {
InitialContext ic = new InitialContext();
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXAttribute.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXAttribute.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXAttribute.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,10 +1,31 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.pojo;
-// Generated Aug 1, 2007 5:36:51 PM by Hibernate Tools 3.2.0.b9
-
-
/**
- * JMXAttribute generated by hbm2java
+ * POJO for storage of metadata concerning a JMX attribute.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
*/
public class JMXAttribute implements java.io.Serializable {
@@ -13,39 +34,70 @@
private String objectname;
private String attribute;
+ /**
+ * Constructor.
+ */
public JMXAttribute() {
}
+ /**
+ * Constructor.
+ * @param objectname object name
+ * @param attribute attribute name
+ */
public JMXAttribute(String objectname, String attribute) {
this.objectname = objectname;
this.attribute = attribute;
}
+ /**
+ * Id getter.
+ * @return id
+ */
public Long getId() {
return this.id;
}
+ /**
+ * Id mutator.
+ * @param id id
+ */
public void setId(Long id) {
this.id = id;
}
+
+ /**
+ * Object name getter.
+ * @return object name
+ */
public String getObjectname() {
return this.objectname;
}
+ /**
+ * Object name mutator.
+ * @param objectname object name
+ */
public void setObjectname(String objectname) {
this.objectname = objectname;
}
+
+ /**
+ * Attribute name getter.
+ * @return attribute name
+ */
public String getAttribute() {
return this.attribute;
}
+ /**
+ * Attribute name mutator.
+ * @param attribute attribute name
+ */
public void setAttribute(String attribute) {
this.attribute = attribute;
}
-
-
-
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXData.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXData.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXData.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,11 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.pojo;
-// Generated Aug 1, 2007 5:36:51 PM by Hibernate Tools 3.2.0.b9
-
import java.util.Date;
/**
- * JMXData generated by hbm2java
+ * POJO storing a JMX attribute's data on a specific server at a specific time.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
*/
public class JMXData implements java.io.Serializable {
@@ -18,9 +40,21 @@
private Integer countvalue;
private String textvalue;
+ /**
+ * Constructor.
+ */
public JMXData() {
}
+ /**
+ * Constructor.
+ * @param attribute attribute
+ * @param server server name
+ * @param statdate statistic date
+ * @param timevalue time value
+ * @param countvalue count value
+ * @param textvalue test value
+ */
public JMXData(JMXAttribute attribute, String server, Date statdate, Float timevalue, Integer countvalue, String textvalue) {
this.attribute = attribute;
this.server = server;
@@ -86,6 +120,9 @@
this.textvalue = textvalue;
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
public String toString() {
return "id [" + id + "] time[" + statdate + "]";
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXPattern.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXPattern.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/pojo/JMXPattern.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,10 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.pojo;
-// Generated Aug 1, 2007 5:36:51 PM by Hibernate Tools 3.2.0.b9
-
-
/**
- * JMXPattern generated by hbm2java
+ * POJO that stores information on the ObjectNames that will be queried
+ * for JMX attribute information.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
*/
public class JMXPattern implements java.io.Serializable {
@@ -13,34 +35,67 @@
private String classpattern;
private String keyvalue;
+ /**
+ * Constructor
+ */
public JMXPattern() {
}
+ /**
+ * Constructor that takes in a pattern to query JMX with and
+ * a filter to find the ObjectNames with ESB metrics.
+ * @param classpattern class pattern
+ * @param keyvalue key value
+ */
public JMXPattern(String classpattern, String keyvalue) {
this.classpattern = classpattern;
this.keyvalue = keyvalue;
}
+ /**
+ * Id getter.
+ * @return id
+ */
public Long getId() {
return this.id;
}
+ /**
+ * Id mutator
+ * @param id id
+ */
public void setId(Long id) {
this.id = id;
}
+ /**
+ * Class pattern getter.
+ * @return class pattern
+ */
public String getClasspattern() {
return this.classpattern;
}
+ /**
+ * Class pattern mutator.
+ * @param classpattern class pattern
+ */
public void setClasspattern(String classpattern) {
this.classpattern = classpattern;
}
+ /**
+ * Getter for the filter that finds ObjectNames for metric collection.
+ * @return
+ */
public String getKeyvalue() {
return this.keyvalue;
}
+ /**
+ * Mutator for the filter that finds ObjectNames for metric collection.
+ * @param keyvalue key value
+ */
public void setKeyvalue(String keyvalue) {
this.keyvalue = keyvalue;
}
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/BeanRegistrationServlet.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import javax.management.InstanceAlreadyExistsException;
@@ -14,6 +35,15 @@
import org.apache.log4j.Logger;
import org.jboss.mx.util.MBeanServerLocator;
+/**
+ * BeanRegistrationServlet registers the DataFilerSchedulerMBean. The
+ * DataFilerSchedulerMBean contains information as to the frequency to
+ * which to collect data, and on update, it reschedules a Quartz job
+ * which fires it off at the selected interval.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class BeanRegistrationServlet extends HttpServlet {
private static final long serialVersionUID = 5501281194727672262L;
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFiler.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import java.util.List;
@@ -10,17 +31,37 @@
import org.jboss.soa.esb.monitoring.StatisticsData;
import org.jboss.soa.esb.monitoring.pojo.*;
+/**
+ * DataFiler receives StatisticsData information and stores it in
+ * the database using Hibernate.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class DataFiler {
private StatisticsData data;
private static final Logger logger = Logger.getLogger(DataFiler.class);
+ /**
+ * Null constructor.
+ */
public DataFiler() {
}
+ /**
+ * Constructor taking a StatisticsData object.
+ * @param f_data
+ */
public DataFiler(StatisticsData f_data) {
data = f_data;
}
+ /**
+ * @param sess session
+ * @param objectname object name
+ * @param attribute attribute name
+ * @return JMXAttribute
+ */
public JMXAttribute getAttribute(Session sess, String objectname, String attribute) {
String query = "from JMXAttribute jmxa "
+ "where objectname = :objectname and attribute = :attribute";
@@ -36,6 +77,12 @@
return null;
}
+ /**
+ * Inserts data through hibernate.
+ * @param sess session
+ * @param f_sb StatisticsBean
+ * @param attr JMXAttribute
+ */
public void insertData(Session sess, StatisticsBean f_sb, JMXAttribute attr) {
JMXData jmxd = null;
if (attr.getAttribute().matches("(?i).*Count")) {
@@ -95,6 +142,10 @@
}
}
+ /**
+ * Create a JMXAttribute object based on the StatisticBean info and stores it.
+ * @param f_sb statistics bean
+ */
public void insertStatistics(StatisticsBean f_sb) {
Session sess = (Session) MonitoringSessionFactory.getInstance().openSession();
Transaction tx = sess.beginTransaction();
@@ -113,6 +164,9 @@
sess.close();
}
+ /**
+ * Calls insertStatistics to insert each StatisticBean in the StatisticData object.
+ */
public void persistData() {
List list = data.getList();
for (int i = 0; i < list.size(); i++) {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerAction.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerAction.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerAction.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,5 +1,24 @@
-
-
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import org.apache.log4j.Logger;
@@ -8,6 +27,13 @@
import org.jboss.soa.esb.message.Message;
import org.jboss.soa.esb.monitoring.StatisticsData;
+/**
+ * DataFilerAction gets the StatisticsData object out of the body
+ * of the message and calls the DataFiler to store that information.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class DataFilerAction extends AbstractActionLifecycle {
protected ConfigTree _config;
@@ -15,6 +41,14 @@
public DataFilerAction(ConfigTree config) { _config = config; }
+ /**
+ * The action method which calls the DataFiler to persist the data
+ * stored in the StatisticsData object.
+ *
+ * @param message message
+ * @return message
+ * @throws Exception
+ */
public Message fileMessage(Message message) throws Exception {
if ((message.getProperties() != null) &&
(message.getProperties().getProperty("COMMAND_MESSAGE") != null)) {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerJob.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerJob.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerJob.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import java.net.URI;
@@ -20,6 +41,13 @@
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
+/**
+ * DataFilerJob is a Quartz job which, when fired, delivers a message to
+ * all DataCollector services asking for statistics.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class DataFilerJob implements Job {
private static Logger logger = Logger.getLogger(DataFilerJob.class);
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerScheduler.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import java.util.Date;
@@ -10,6 +31,14 @@
import org.quartz.SimpleTrigger;
import org.quartz.impl.StdSchedulerFactory;
+/**
+ * DataFilerScheduler is the MBean implementation of DataFilerSchedulerMBean.
+ * It contains a pollMinuteFrequency variable, which when updated, reschedules
+ * the quartz DataFilerJob.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class DataFilerScheduler implements DataFilerSchedulerMBean {
private static final Logger logger = Logger.getLogger(DataFilerScheduler.class);
private static final int DEFAULT_POLL_MINUTE_FREQ = 2;
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerSchedulerMBean.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerSchedulerMBean.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/DataFilerSchedulerMBean.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import org.jboss.system.ServiceMBean;
@@ -2,2 +23,10 @@
+/**
+ * DataFilerSchedulerMBean is an mbean which sets the frequency of which
+ * the data collection EPRs are polled. This is a very simple mbean
+ * which only contains a getter and a mutator for pollminutefrequency.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public interface DataFilerSchedulerMBean extends ServiceMBean {
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/StatisticsHelper.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import java.util.Calendar;
@@ -19,6 +40,13 @@
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.soa.esb.monitoring.pojo.*;
+/**
+ * StatisticsHelper is a helper class which contains methods used in displaying
+ * stored JMX attribute information.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class StatisticsHelper {
private static final Logger logger = Logger.getLogger(StatisticsHelper.class);
@@ -27,6 +55,15 @@
public static final int TIME_ATTRIBUTE = 2;
public static final int TEXT_ATTRIBUTE = 3;
+ /**
+ * Return the string "SELECTED" if arg1 == arg2. Used in
+ * making sure the correct option of the time period select box
+ * is selected by default.
+ *
+ * @param arg1 argument 1
+ * @param arg2 argument 2
+ * @return "SELECTED" if the two arguments are equal
+ */
public static String getSelected(int arg1, int arg2) {
if (arg1 == arg2) {
return "SELECTED";
@@ -34,6 +71,13 @@
return "";
}
+ /**
+ * Returns an int representing what type of metric is stored
+ * (count, bytes, or time) depending on what the name of the attribute
+ * is.
+ * @param attribute attribute string
+ * @return attribute type int
+ */
public static int getAttributeType(String attribute) {
int attributeType = -1;
if (attribute.matches("(?i).*Count")) {
@@ -48,6 +92,10 @@
return attributeType;
}
+ /**
+ * Gets the collection interval from JMX.
+ * @return collection interval in minutes
+ */
public static int getCollectionInterval() {
MBeanServer mbeanServer = null;
ObjectName dataSchedulerName = null;
@@ -81,24 +129,45 @@
return pollFreq.intValue();
}
+ /**
+ * Query Hibernate for all time attributes.
+ * @param sess hibernate session
+ * @return list of all time attributes
+ */
public static List getTimeAttributes(Session sess) {
String query = "from JMXAttribute jmxa where jmxa.attribute like '%Time'";
List result = sess.createQuery(query).list();;
return result;
}
+ /**
+ * Query Hibernate for all count attributes.
+ * @param sess hibernate session
+ * @return list of all count attributes
+ */
public static List getCountAttributes(Session sess) {
String query = "from JMXAttribute jmxa where jmxa.attribute like '%Count'";
List result = sess.createQuery(query).list();
return result;
}
+ /**
+ * Query Hibernate for the list of all attributes.
+ * @param sess hibernate session
+ * @return list of all attributes
+ */
public static List getAllAttributes(Session sess) {
String query = "from JMXAttribute";
List result = sess.createQuery(query).list();
return result;
}
+ /**
+ * Get the list of distinct objectnames in contained in the stored
+ * JMXAttribute information.
+ * @param sess hibernate session
+ * @return list of object names
+ */
public static List getObjectNames(Session sess) {
String query = "SELECT DISTINCT jmxa.objectname "
+ "FROM JMXAttribute jmxa";
@@ -106,6 +175,12 @@
return result;
}
+ /**
+ * Return all JMXAttribute information for a particular statistic id.
+ * @param sess hibernate session
+ * @param id id of attribute
+ * @return JMX attribute
+ */
public static JMXAttribute getByStatId(Session sess, Long id) {
String query = "from JMXAttribute where id = :id";
Query q = sess.createQuery(query);
@@ -117,6 +192,11 @@
return null;
}
+ /**
+ * Select the distinct server names from the data.
+ * @param sess hibernate session
+ * @return list of distinct server names
+ */
public static List getServerNames(Session sess) {
String query = "SELECT DISTINCT jmxd.server "
+ "FROM JMXData jmxd";
@@ -124,6 +204,12 @@
return result;
}
+ /**
+ * Return the list of distinct ObjectNames for a specific server
+ * @param sess hibernate session
+ * @param servername server name
+ * @return list of distinct ObjectNames for a specific server
+ */
public static List getObjectNamesForServer(Session sess, String servername) {
String query = "SELECT DISTINCT jmxa.objectname "
+ "FROM JMXAttribute jmxa, JMXData jmxd "
@@ -135,6 +221,13 @@
return result;
}
+ /**
+ * List of distinct attribute names by server and objectname.
+ * @param sess hibernate session
+ * @param servername server name
+ * @param objectname object name
+ * @return list of attributes
+ */
public static List getAttributes(Session sess, String servername, String objectname) {
String query = "SELECT DISTINCT jmxa.* "
+ "FROM JMXAttribute jmxa, JMXData jmxd "
@@ -149,6 +242,14 @@
return result;
}
+ /**
+ * Returns data for display in the bottom half of the window.
+ * @param sess hibernate session
+ * @param servername server name
+ * @param attributeId attribute id
+ * @param timerange time range
+ * @return list of data to display
+ */
public static List getData(Session sess, String servername, Integer attributeId,
Integer timerange) {
String query = "SELECT data.* from JMXData data "
Modified: labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/TimeSeriesChartProducer.java
===================================================================
--- labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/TimeSeriesChartProducer.java 2007-08-16 04:07:55 UTC (rev 14292)
+++ labs/jbossesb/trunk/product/tools/console/management/src/main/java/org/jboss/soa/esb/monitoring/server/TimeSeriesChartProducer.java 2007-08-16 06:05:36 UTC (rev 14293)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.soa.esb.monitoring.server;
import java.awt.Color;
@@ -19,20 +40,38 @@
import org.jfree.ui.RectangleInsets;
+/**
+ * TimeSeriesChartProducer is a helper class which produces a chart
+ * based on the time series stored.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">Tom Cunningham</a>
+ * @since Version 4.2
+ */
public class TimeSeriesChartProducer {
private static final Logger logger = Logger.getLogger(TimeSeriesChartProducer.class);
private TimeSeries ts;
private String title;
+ /**
+ * Constructor
+ * @param title title
+ * @param klass time period class
+ */
public TimeSeriesChartProducer(String title, Class klass) {
ts = new TimeSeries(title, klass);
this.title = title;
}
+ /**
+ * Add minute data
+ * @param min minute
+ * @param num data
+ */
public void addMinute(Minute min, Number num) {
ts.addOrUpdate(min, num);
}
+ @SuppressWarnings("deprecation")
public JFreeChart createChart(String chartTitle) {
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(ts);
@@ -66,6 +105,12 @@
return jfc;
}
+ /**
+ * Save the chart to a unique filename by session.
+ *
+ * @param chartTitle title of chart
+ * @param outFile file to write to
+ */
public void saveChart(String chartTitle, File outFile) {
JFreeChart chart = createChart(chartTitle);
try {
More information about the jboss-svn-commits
mailing list