[Mc4j-cvs] mc4j/src/org/mc4j/console/mejb/view StatisticNode.java,1.2,1.3 StatsNode.java,1.4,1.5 Com
Brought to you by:
ghinkl
From: Greg H. <gh...@us...> - 2006-04-12 19:14:38
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/mejb/view Modified Files: StatisticNode.java StatsNode.java CompositeStatisticsView.java MEJBView.java StatisticsView.java Log Message: Merging EMS into head for the 2.0 release work Index: MEJBView.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/MEJBView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MEJBView.java 15 Jan 2005 03:52:15 -0000 1.6 --- MEJBView.java 12 Apr 2006 19:13:59 -0000 1.7 *************** *** 19,34 **** import org.mc4j.console.ConnectionExplorer; import org.mc4j.console.bean.MBeanNode; - import org.mc4j.console.bean.attribute.AttributeNode; import org.mc4j.console.dashboard.components.AttributeTreeTableExplorer; import org.mc4j.console.dashboard.components.OperationListComponent; import org.mc4j.console.install.ExplorerUtil; import org.mc4j.console.mejb.MBeanFilterNode; import org.openide.nodes.FilterNode; import org.openide.nodes.Node; - import org.openide.windows.IOProvider; import org.openide.windows.TopComponent; import javax.swing.*; ! import java.awt.*; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; --- 19,33 ---- import org.mc4j.console.ConnectionExplorer; import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.dashboard.components.AttributeTreeTableExplorer; import org.mc4j.console.dashboard.components.OperationListComponent; import org.mc4j.console.install.ExplorerUtil; import org.mc4j.console.mejb.MBeanFilterNode; + import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.openide.nodes.FilterNode; import org.openide.nodes.Node; import org.openide.windows.TopComponent; import javax.swing.*; ! import java.awt.BorderLayout; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; *************** *** 122,126 **** private void updateOperationsPanel() { OperationListComponent operationsComponent = new OperationListComponent(); ! operationsComponent.setBeanNode(this.currentNode); operationsComponent.setContext(null); this.operationsPanel.removeAll(); --- 121,125 ---- private void updateOperationsPanel() { OperationListComponent operationsComponent = new OperationListComponent(); ! operationsComponent.setBean(this.currentNode.getEmsBean()); operationsComponent.setContext(null); this.operationsPanel.removeAll(); *************** *** 130,134 **** private void updateDescriptorPanel() { ! AttributeNode descriptorAttribute = (AttributeNode) currentNode.getAttributeNodeMap().get("deploymentDescriptor"); if (descriptorAttribute != null) { descriptorTextArea.setText((String) descriptorAttribute.getValue()); --- 129,133 ---- private void updateDescriptorPanel() { ! EmsAttribute descriptorAttribute = currentNode.getAttributeNodeMap().get("deploymentDescriptor"); if (descriptorAttribute != null) { descriptorTextArea.setText((String) descriptorAttribute.getValue()); *************** *** 142,146 **** private void updateAttributesPanel() { AttributeTreeTableExplorer attributeExplorer = new AttributeTreeTableExplorer(); ! attributeExplorer.setBeanNode(currentNode); attributeExplorer.setContext(null); attributesPanel.removeAll(); --- 141,145 ---- private void updateAttributesPanel() { AttributeTreeTableExplorer attributeExplorer = new AttributeTreeTableExplorer(); ! attributeExplorer.setBean(currentNode.getEmsBean()); attributeExplorer.setContext(null); attributesPanel.removeAll(); *************** *** 166,174 **** boolean isStatisticsProvider; protected void updateFeatureSupport() { ! AttributeNode isStateManageableAttr = (AttributeNode) currentNode.getAttributeNodeMap().get("stateManageable"); isStateManageable = ((Boolean)isStateManageableAttr.getValue()).booleanValue(); ! AttributeNode isEventProviderAttr = (AttributeNode) currentNode.getAttributeNodeMap().get("eventProvider"); isEventProvider = ((Boolean)isEventProviderAttr.getValue()).booleanValue(); ! AttributeNode isStatisticsProviderAttr = (AttributeNode) currentNode.getAttributeNodeMap().get("statisticsProvider"); isStatisticsProvider = ((Boolean)isStatisticsProviderAttr.getValue()).booleanValue(); } --- 165,173 ---- boolean isStatisticsProvider; protected void updateFeatureSupport() { ! EmsAttribute isStateManageableAttr = currentNode.getAttributeNodeMap().get("stateManageable"); isStateManageable = ((Boolean)isStateManageableAttr.getValue()).booleanValue(); ! EmsAttribute isEventProviderAttr = currentNode.getAttributeNodeMap().get("eventProvider"); isEventProvider = ((Boolean)isEventProviderAttr.getValue()).booleanValue(); ! EmsAttribute isStatisticsProviderAttr = currentNode.getAttributeNodeMap().get("statisticsProvider"); isStatisticsProvider = ((Boolean)isStatisticsProviderAttr.getValue()).booleanValue(); } *************** *** 176,189 **** protected void updateHeader() { ! this.nameLabel.setText(currentNode.getObjectName().getCanonicalName()); ! descriptionTextArea.setText(currentNode.getObjectName().getKeyProperty("j2eeType")); String iconThread = "/images/ThreadTerminated.gif"; String stateString = "Unknown"; if (isStateManageable) { ! AttributeNode stateAttribute = (AttributeNode) this.currentNode.getAttributeNodeMap().get("state"); if (stateAttribute == null) ! stateAttribute = (AttributeNode) this.currentNode.getAttributeNodeMap().get("State"); if (stateAttribute != null) { --- 175,188 ---- protected void updateHeader() { ! this.nameLabel.setText(currentNode.getEmsBean().getBeanName().getCanonicalName()); ! descriptionTextArea.setText(currentNode.getEmsBean().getBeanName().getKeyProperty("j2eeType")); String iconThread = "/images/ThreadTerminated.gif"; String stateString = "Unknown"; if (isStateManageable) { ! EmsAttribute stateAttribute = this.currentNode.getAttributeNodeMap().get("state"); if (stateAttribute == null) ! stateAttribute = this.currentNode.getAttributeNodeMap().get("State"); if (stateAttribute != null) { Index: StatisticsView.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/StatisticsView.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StatisticsView.java 19 Jan 2005 14:09:40 -0000 1.6 --- StatisticsView.java 12 Apr 2006 19:13:59 -0000 1.7 *************** *** 18,41 **** import org.mc4j.console.bean.MBeanNode; - import org.mc4j.console.bean.attribute.AttributeNode; import org.mc4j.console.dashboard.DashboardComponent; ! import org.mc4j.console.ConnectionExplorer; ! import org.mc4j.console.mejb.MBeanFilterNode; ! import org.openide.explorer.view.BeanTreeView; ! import org.openide.explorer.ExplorerPanel; ! import org.openide.nodes.NodeOperation; import org.openide.nodes.Node; - import org.openide.nodes.FilterNode; - import org.openide.windows.TopComponent; import org.openide.windows.IOProvider; import javax.management.j2ee.statistics.Statistic; import javax.management.j2ee.statistics.Stats; import javax.swing.*; ! import java.awt.*; ! import java.util.Date; ! import java.util.Map; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; /** --- 18,36 ---- import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.dashboard.DashboardComponent; ! import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.openide.nodes.Node; import org.openide.windows.IOProvider; + import org.openide.windows.TopComponent; import javax.management.j2ee.statistics.Statistic; import javax.management.j2ee.statistics.Stats; import javax.swing.*; ! import java.awt.GridBagConstraints; ! import java.awt.Insets; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; + import java.util.Date; + import java.util.Map; /** *************** *** 47,51 **** protected MBeanNode beanNode; ! protected AttributeNode attributeNode; protected Stats stats; --- 42,46 ---- protected MBeanNode beanNode; ! protected EmsAttribute attribute; protected Stats stats; *************** *** 55,63 **** beanNode = node; ! attributeNode = (AttributeNode) node.getAttributeNodeMap().get("stats"); ! if (attributeNode == null) ! attributeNode = (AttributeNode) node.getAttributeNodeMap().get("Stats"); ! System.out.println("The stat node is: " + attributeNode); --- 50,58 ---- beanNode = node; ! attribute = node.getAttributeNodeMap().get("stats"); ! if (attribute == null) ! attribute = node.getAttributeNodeMap().get("Stats"); ! System.out.println("The stat node is: " + attribute); *************** *** 143,148 **** public void refresh() { ! attributeNode.refresh(); ! Stats stat = (Stats) attributeNode.getValue(); setStat(stat); // if (this.statistic != stat) { --- 138,143 ---- public void refresh() { ! attribute.refresh(); ! Stats stat = (Stats) attribute.getValue(); setStat(stat); // if (this.statistic != stat) { Index: StatisticNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/StatisticNode.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatisticNode.java 15 Jan 2005 03:52:15 -0000 1.2 --- StatisticNode.java 12 Apr 2006 19:13:59 -0000 1.3 *************** *** 18,32 **** import org.mc4j.console.Refreshable; - import org.mc4j.console.bean.attribute.AttributeNode; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; - import org.openide.nodes.Node; - import org.openide.nodes.Sheet; import org.openide.nodes.PropertySupport; import org.openide.util.Utilities; import javax.management.j2ee.statistics.Statistic; ! import javax.management.j2ee.statistics.Stats; ! import java.awt.*; import java.beans.BeanInfo; import java.beans.IndexedPropertyDescriptor; --- 18,29 ---- import org.mc4j.console.Refreshable; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; import org.openide.nodes.PropertySupport; + import org.openide.nodes.Sheet; import org.openide.util.Utilities; import javax.management.j2ee.statistics.Statistic; ! import java.awt.Image; import java.beans.BeanInfo; import java.beans.IndexedPropertyDescriptor; *************** *** 35,40 **** import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; - import java.util.HashSet; - import java.util.Set; /** --- 32,35 ---- *************** *** 47,51 **** private Statistic statistic; - private AttributeNode statsAttributeNode; private Image icon; --- 42,45 ---- *************** *** 136,140 **** public Object getValue() throws IllegalAccessException, InvocationTargetException { ! Object val = property.getReadMethod().invoke(getStatistic(), null); return val; } --- 130,134 ---- public Object getValue() throws IllegalAccessException, InvocationTargetException { ! Object val = property.getReadMethod().invoke(getStatistic()); return val; } Index: StatsNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/StatsNode.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatsNode.java 15 Jan 2005 03:52:15 -0000 1.4 --- StatsNode.java 12 Apr 2006 19:13:59 -0000 1.5 *************** *** 17,42 **** package org.mc4j.console.mejb.view; - import org.openide.nodes.AbstractNode; - import org.openide.nodes.Children; - import org.openide.nodes.Node; - import org.openide.nodes.Sheet; - import org.openide.nodes.PropertySupport; - import org.openide.util.Utilities; - import org.mc4j.console.util.NodeUtil; import org.mc4j.console.Refreshable; ! import org.mc4j.console.bean.attribute.AttributeNode; - import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; ! import java.beans.BeanInfo; ! import java.beans.Introspector; ! import java.beans.IntrospectionException; ! import java.beans.PropertyDescriptor; ! import java.beans.IndexedPropertyDescriptor; ! import java.lang.reflect.InvocationTargetException; ! import java.lang.reflect.Method; import java.awt.*; ! import java.util.Set; import java.util.HashSet; /** --- 17,32 ---- package org.mc4j.console.mejb.view; import org.mc4j.console.Refreshable; ! import org.mc4j.console.util.NodeUtil; ! import org.mc4j.ems.connection.bean.attribute.EmsAttribute; ! import org.openide.nodes.*; import javax.management.j2ee.statistics.Statistic; ! import javax.management.j2ee.statistics.Stats; import java.awt.*; ! import java.beans.*; ! import java.lang.reflect.InvocationTargetException; import java.util.HashSet; + import java.util.Set; /** *************** *** 51,59 **** private Stats stats; private Statistic statistic; ! private AttributeNode statsAttributeNode; private Image icon; ! public StatsNode(AttributeNode attributeNode) { super(new StatsNodeChildren(attributeNode.getValue())); this.statsAttributeNode = attributeNode; --- 41,49 ---- private Stats stats; private Statistic statistic; ! private EmsAttribute statsAttributeNode; private Image icon; ! public StatsNode(EmsAttribute attributeNode) { super(new StatsNodeChildren(attributeNode.getValue())); this.statsAttributeNode = attributeNode; *************** *** 167,171 **** public Object getValue() throws IllegalAccessException, InvocationTargetException { ! Object val = property.getReadMethod().invoke(getStats(), null); return val; } --- 157,161 ---- public Object getValue() throws IllegalAccessException, InvocationTargetException { ! Object val = property.getReadMethod().invoke(getStats()); return val; } *************** *** 211,218 **** if (Stats.class.isAssignableFrom(prop.getPropertyType())) { ! Stats childStats = (Stats) prop.getReadMethod().invoke(stats,null); newChildren.add(new StatsNode(childStats)); } else if (Statistic.class.isAssignableFrom(prop.getPropertyType())) { ! Statistic childStatistic = (Statistic) prop.getReadMethod().invoke(stats,null); newChildren.add(new StatisticNode(childStatistic)); } else if (prop.getPropertyType().isArray() && --- 201,208 ---- if (Stats.class.isAssignableFrom(prop.getPropertyType())) { ! Stats childStats = (Stats) prop.getReadMethod().invoke(stats); newChildren.add(new StatsNode(childStats)); } else if (Statistic.class.isAssignableFrom(prop.getPropertyType())) { ! Statistic childStatistic = (Statistic) prop.getReadMethod().invoke(stats); newChildren.add(new StatisticNode(childStatistic)); } else if (prop.getPropertyType().isArray() && *************** *** 220,224 **** // Array of stats objects ! Stats[] childStats = (Stats[]) prop.getReadMethod().invoke(stats,null); for (int j = 0; j < childStats.length; j++) { --- 210,214 ---- // Array of stats objects ! Stats[] childStats = (Stats[]) prop.getReadMethod().invoke(stats); for (int j = 0; j < childStats.length; j++) { *************** *** 231,235 **** // Array of stats objects ! Statistic[] childStats = (Statistic[]) prop.getReadMethod().invoke(stats,null); for (int j = 0; j < childStats.length; j++) { --- 221,225 ---- // Array of stats objects ! Statistic[] childStats = (Statistic[]) prop.getReadMethod().invoke(stats); for (int j = 0; j < childStats.length; j++) { Index: CompositeStatisticsView.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/CompositeStatisticsView.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompositeStatisticsView.java 5 Oct 2004 05:16:02 -0000 1.2 --- CompositeStatisticsView.java 12 Apr 2006 19:13:59 -0000 1.3 *************** *** 18,31 **** import org.mc4j.console.bean.MBeanNode; - import org.mc4j.console.bean.attribute.AttributeNode; import org.mc4j.console.dashboard.DashboardComponent; - import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; import javax.management.j2ee.statistics.TimeStatistic; import javax.swing.*; - import java.util.Map; import java.util.ArrayList; import java.util.List; /** --- 18,31 ---- import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.dashboard.DashboardComponent; + import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import javax.management.j2ee.statistics.Statistic; + import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.TimeStatistic; import javax.swing.*; import java.util.ArrayList; import java.util.List; + import java.util.Map; /** *************** *** 36,40 **** protected MBeanNode beanNode; ! protected AttributeNode attributeNode; protected Stats statistics; --- 36,40 ---- protected MBeanNode beanNode; ! protected EmsAttribute attribute; protected Stats statistics; *************** *** 45,49 **** init(); this.beanNode = node; ! this.attributeNode = (AttributeNode) beanNode.getAttributeNodeMap().get("stats"); } --- 45,49 ---- init(); this.beanNode = node; ! this.attribute = beanNode.getAttributeNodeMap().get("stats"); } *************** *** 56,65 **** setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); ! this.statistics = (Stats) attributeNode.getValue(); ! ! Statistic[] statArray = this.statistics.getStatistics(); ! for (int i = 0; i < statArray.length; i++) { ! Statistic statistic = statArray[i]; if (statistic instanceof TimeStatistic) { StatisticsView view = new TimeStatisticsView(beanNode); --- 56,62 ---- setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); ! this.statistics = (Stats) attribute.getValue(); + for (Statistic statistic : this.statistics.getStatistics()) { if (statistic instanceof TimeStatistic) { StatisticsView view = new TimeStatisticsView(beanNode); |