[Mc4j-cvs] mc4j/src/org/mc4j/console/dashboard/components TabularDataComponent.java,1.1,1.2 Operatio
Brought to you by:
ghinkl
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20162/src/org/mc4j/console/dashboard/components Modified Files: NumericAttributeGaugeMeter.java AttributeTreeTableExplorer.java AttributeTablePopupComponent.java BeanComponent.java BeanListComponent.java AttributeTableComponent.java MBeanTreeComponent.java AttributeListComponent.java RefreshControlComponent.java TimeLabelComponent.java ForEachPanelComponent.java NumericAttributeMeter.java NumericAttributeGraph.java OperationListComponent.java AttributeComponent.java Added Files: TabularDataComponent.java OperationResultTableComponent.java ErrorComponent.java Log Message: Merging EMS into head for the 2.0 release work Index: AttributeTableComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/AttributeTableComponent.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** AttributeTableComponent.java 14 Mar 2005 16:17:22 -0000 1.12 --- AttributeTableComponent.java 12 Apr 2006 19:13:59 -0000 1.13 *************** *** 17,50 **** package org.mc4j.console.dashboard.components; ! import org.jdesktop.jdnc.JNTable; ! import org.jdesktop.swing.JXTable; ! import org.jdesktop.swing.decorator.AlternateRowHighlighter; ! import org.jdesktop.swing.decorator.ComponentAdapter; ! import org.jdesktop.swing.decorator.ConditionalHighlighter; ! import org.jdesktop.swing.decorator.Highlighter; ! import org.jdesktop.swing.decorator.HighlighterPipeline; ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.bean.attribute.AttributeNode; ! import org.mc4j.console.bean.operation.OperationNode; ! import org.mc4j.console.connection.ConnectionNode; ! import org.mc4j.console.dashboard.Dashboard; ! import org.mc4j.console.swing.table.TableMap; ! import org.mc4j.console.swing.table.TableSorter; import javax.swing.*; - import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.DefaultTableModel; ! import javax.swing.table.JTableHeader; ! import javax.swing.table.TableCellRenderer; ! import javax.swing.table.TableModel; ! import java.awt.BorderLayout; ! import java.awt.Color; ! import java.awt.Component; ! import java.awt.Font; ! import java.util.ArrayList; ! import java.util.Arrays; ! import java.util.Iterator; import java.util.List; - import java.util.Map; /** --- 17,35 ---- package org.mc4j.console.dashboard.components; ! ! ! import org.mc4j.ems.connection.bean.EmsBean; ! import org.mc4j.ems.connection.bean.attribute.EmsAttribute; ! import org.mc4j.ems.connection.bean.operation.EmsOperation; ! import org.jdesktop.swingx.JXTable; ! import org.jdesktop.swingx.decorator.HighlighterPipeline; ! import org.jdesktop.swingx.decorator.AlternateRowHighlighter; ! import org.jdesktop.swingx.decorator.Highlighter; import javax.swing.*; import javax.swing.table.DefaultTableModel; ! import java.awt.*; ! import java.util.*; import java.util.List; /** *************** *** 56,68 **** protected List attributeNames = new ArrayList(); ! protected List mbeanNodes; ! ! protected MBeanNode mbeanNode; protected String label = ""; - protected JScrollPane scrollPane; protected JXTable table; - protected TableSorter tableSorter; protected AttributeTableModel tableModel; --- 41,49 ---- protected List attributeNames = new ArrayList(); ! protected List<EmsBean> beanList; protected String label = ""; protected JXTable table; protected AttributeTableModel tableModel; *************** *** 81,88 **** - private Dashboard dashboard; - - private ConnectionNode connectionNode; - public void init() { --- 62,65 ---- *************** *** 100,138 **** ! this.tableModel = new AttributeTableModel(columnNames, this.mbeanNodes.size()); ! // this.tableSorter = new TableSorter(this.tableModel); ! JNTable nTable = new JNTable(tableModel); ! nTable.setHasColumnControl(true); ! this.table = nTable.getTable();//new JXTable(tableModel); //this.tableSorter); ! // this.scrollPane = new JScrollPane(this.table); ! // this.tableSorter.addMouseListenerToHeaderInTable(this.table); this.table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); ! // this.table.setFont(VALUE_FONT); ! this.table.setHighlighters(new HighlighterPipeline(new Highlighter[]{new AlternateRowHighlighter(), new ChangeHighlighter()})); - /*for (int i = 0; i < attributeNames.size(); i++) { - this.table.getColumnModel().getColumn(i).setHeaderRenderer(new SortHeaderRenderer()); - this.table.getColumnModel().getColumn(i).setCellRenderer(new ChangeRenderer()); - }*/ ! add(nTable, BorderLayout.CENTER); // The first refresh sets column classes properly refresh(); - // iterate over the column classes and proxy them to a highlighting renderer this.doLayout(); this.repaint(); - //Thread refresher = new Thread(this, "AttributeTableRefresher"); - //refresher.start(); } ! public class ChangeHighlighter extends ConditionalHighlighter { public ChangeHighlighter() { setForeground(Color.red); --- 77,104 ---- ! this.tableModel = new AttributeTableModel(columnNames, this.attributeNames.size()); ! this.table = new JXTable(tableModel); ! ! this.table.setColumnControlVisible(true); this.table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); ! this.table.setHighlighters(new HighlighterPipeline(new Highlighter[]{new AlternateRowHighlighter()/*, new ChangeHighlighter()*/})); ! add(new JScrollPane(this.table), BorderLayout.CENTER); // The first refresh sets column classes properly refresh(); this.doLayout(); this.repaint(); } ! /* public class ChangeHighlighter extends ConditionalHighlighter { public ChangeHighlighter() { setForeground(Color.red); *************** *** 148,152 **** table.convertColumnIndexToModel(componentAdapter.column)); } ! } public void refresh() { --- 114,118 ---- table.convertColumnIndexToModel(componentAdapter.column)); } ! }*/ public void refresh() { *************** *** 165,169 **** if (null != matchedDashboards) { // very much magic here: ! // - BeanMatchList(0) contains the id of the match list // - the contextStarter contains the list of mbeanNodes under that id --- 131,135 ---- if (null != matchedDashboards) { // very much magic here: ! // - BeanMatchList (0) contains the id of the match list // - the contextStarter contains the list of mbeanNodes under that id *************** *** 184,193 **** int row = 0; ! for (Iterator iterator = mbeanNodes.iterator(); iterator.hasNext();) { ! MBeanNode beanNode = (MBeanNode) iterator.next(); ! if (beanNode.isRegistered()) { ! beanNode.retrieveData(); ! Map attributeNodeMap = beanNode.getAttributeNodeMap(); int col = 0; --- 150,156 ---- int row = 0; ! for (EmsBean bean : beanList) { ! if (true) { // TODO if bean.isRegistered()) { int col = 0; *************** *** 195,215 **** String attributeName = (String) iterator1.next(); ! AttributeNode node = (AttributeNode) attributeNodeMap.get(attributeName); Object value = null; ! if (node != null) { ! value = node.getValue(); } else { ! value = beanNode.getObjectName().getKeyProperty(attributeName); if (value == null) { // Treat it like an operation. ! OperationNode operationNode = ! (OperationNode) beanNode.getOperationNodeMap().get(attributeName); ! value = operationNode; - /*if (!(table.getColumnModel().getColumn(col).getCellRenderer() instanceof ButtonRenderer)) { - table.getColumnExt(col).setCellRenderer(new ButtonRenderer()); - table.getColumnExt(col).setCellEditor(new ButtonEditor(new JCheckBox())); - }*/ } else if (value == null) --- 158,177 ---- String attributeName = (String) iterator1.next(); ! EmsAttribute attribute = bean.getAttribute(attributeName); Object value = null; ! if (attribute != null) { ! value = attribute.refresh(); } else { ! value = bean.getBeanName().getKeyProperty(attributeName); if (value == null) { // Treat it like an operation. ! EmsOperation operation = bean.getOperation(attributeName); + try { + value = operation.invoke(); + } catch (Exception e) { + e.printStackTrace(); + } } else if (value == null) *************** *** 232,236 **** // the MBean of the current node is not any longer registered inside the MBeanServer -> remove it from the list this.tableModel.removeRow(row); ! iterator.remove(); } } --- 194,198 ---- // the MBean of the current node is not any longer registered inside the MBeanServer -> remove it from the list this.tableModel.removeRow(row); ! beanList.remove(bean); } } *************** *** 349,369 **** } ! public void setBeanList(List list) { ! this.mbeanNodes = list; ! ! if (!list.isEmpty()) { ! // this assumes that all mbean are from the same connection ! connectionNode = ((MBeanNode) list.get(0)).getConnectionNode(); ! } } public void setContext(Map context) { ! if (this.mbeanNodes == null) { throw new IllegalStateException("AttributeTableComponent: You must specify an appropriate [beanList] attribute."); } - dashboard = (Dashboard) context.get(Dashboard.CONTEXT_DASHBOARD); - init(); } --- 311,324 ---- } ! public void setBeanList(List<EmsBean> beans) { ! this.beanList = beans; } public void setContext(Map context) { ! if (this.beanList == null) { throw new IllegalStateException("AttributeTableComponent: You must specify an appropriate [beanList] attribute."); } init(); } *************** *** 386,478 **** this.label = label; } - - - public static class SortHeaderRenderer - extends DefaultTableCellRenderer { - - private static Icon ascendingIcon = createImageIcon("images/Up.gif"); - private static Icon descendingIcon = createImageIcon("images/Down.gif"); - - - /** - * Returns an ImageIcon, or null if the path was invalid. - */ - protected static ImageIcon createImageIcon(String path) { - java.net.URL imgURL = RefreshControlComponent.class.getClassLoader().getResource(path); - if (imgURL != null) { - return new ImageIcon(imgURL); - } else { - System.err.println("Couldn't find file: " + path); - return null; - } - } - - public SortHeaderRenderer() { - setHorizontalTextPosition(LEFT); - setHorizontalAlignment(CENTER); - } - - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, - int row, int col) { - int index = -1; - boolean ascending = true; - - TableModel model = table.getModel(); - - if (model instanceof TableSorter) { - index = ((TableSorter) model).getCurrentSortColumn(); - ascending = ((TableSorter) model).isAscending(); - } - - if (table != null) { - JTableHeader header = table.getTableHeader(); - if (header != null) { - setForeground(header.getForeground()); - setBackground(header.getBackground()); - setFont(header.getFont()); - } - } - - setFont(getFont().deriveFont((index == col) ? Font.BOLD : Font.PLAIN)); - if (index == col) { - setIcon(ascending ? ascendingIcon : descendingIcon); - } else { - setIcon(null); - } - setText((value == null) ? "" : value.toString()); - setBorder(UIManager.getBorder("TableHeader.cellBorder")); - return this; - } - } - - - public static class ChangeRenderer extends DefaultTableCellRenderer - implements TableCellRenderer { - - public Component getTableCellRendererComponent(JTable table, Object value, - boolean isSelected, boolean hasFocus, - int row, int column) { - - Component comp = - super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); - - TableModel model = table.getModel(); - if (model instanceof TableSorter) { - int realRow = ((TableSorter) model).translateRow(row); - model = ((TableMap) model).getModel(); - if (model instanceof AttributeTableModel) { - if (((AttributeTableModel) model).isValueAtChanged(realRow, column)) { - comp.setForeground(Color.red); - setFont(getFont().deriveFont(Font.BOLD)); - } else { - comp.setForeground(Color.black); - setFont(getFont().deriveFont(Font.PLAIN)); - } - } - } - return comp; - } - } - } --- 341,343 ---- Index: NumericAttributeMeter.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/NumericAttributeMeter.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** NumericAttributeMeter.java 5 Oct 2004 05:16:00 -0000 1.11 --- NumericAttributeMeter.java 12 Apr 2006 19:13:59 -0000 1.12 *************** *** 17,31 **** package org.mc4j.console.dashboard.components; - import java.awt.BorderLayout; - import java.util.Map; - - import javax.management.MBeanServer; - import javax.management.ObjectName; - - import org.openide.windows.TopComponent; - import org.mc4j.console.bean.MBeanNode; - import org.mc4j.console.dashboard.DashboardComponent; import org.mc4j.console.swing.graph.MeterCanvas; /** --- 17,28 ---- package org.mc4j.console.dashboard.components; import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.swing.graph.MeterCanvas; + import org.mc4j.ems.connection.bean.EmsBean; + import org.mc4j.ems.connection.bean.attribute.EmsAttribute; + import org.openide.windows.TopComponent; + + import java.awt.BorderLayout; + import java.util.Map; /** *************** *** 36,43 **** public class NumericAttributeMeter extends TopComponent implements Runnable, BeanComponent { ! private MBeanServer server; ! private ObjectName objectName; ! ! private MBeanNode beanNode; private String currentAttributeName; --- 33,38 ---- public class NumericAttributeMeter extends TopComponent implements Runnable, BeanComponent { ! private EmsBean emsBean; ! private EmsAttribute maxAttribute, currentAttribute; private String currentAttributeName; *************** *** 76,80 **** int max; if (this.maxAttributeName != null) { ! Number maxNumber = (Number) this.server.getAttribute(this.objectName,this.maxAttributeName); max = maxNumber.intValue(); } else { --- 71,75 ---- int max; if (this.maxAttributeName != null) { ! Number maxNumber = (Number) this.maxAttribute.getValue(); max = maxNumber.intValue(); } else { *************** *** 82,86 **** } ! Number current = (Number) this.server.getAttribute(this.objectName,this.currentAttributeName); this.meter.setMax(max); --- 77,81 ---- } ! Number current = (Number) this.currentAttribute.getValue(); this.meter.setMax(max); *************** *** 98,113 **** } ! public void setBeanNode(MBeanNode node) { ! this.beanNode = node; } public void setContext(Map context) { ! if (this.beanNode == null) { throw new IllegalStateException( ! "NumericAttributeMeter: context atribute [beanNode] not set."); } ! this.server = this.beanNode.getMBeanServer(); ! this.objectName = this.beanNode.getObjectName(); Thread updater = new Thread(this, "mc4j NumericAttributeMeter Updater"); --- 93,111 ---- } ! public void setBean(EmsBean emsBean) { ! this.emsBean = emsBean; } public void setContext(Map context) { ! if (this.emsBean == null) { throw new IllegalStateException( ! "NumericAttributeMeter: context atribute [bean] not set."); } ! if (this.maxAttributeName != null) ! this.maxAttribute = this.emsBean.getAttribute(this.maxAttributeName); ! ! this.currentAttribute = this.emsBean.getAttribute(currentAttributeName); ! Thread updater = new Thread(this, "mc4j NumericAttributeMeter Updater"); Index: OperationListComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/OperationListComponent.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** OperationListComponent.java 5 Oct 2004 05:16:00 -0000 1.8 --- OperationListComponent.java 12 Apr 2006 19:13:59 -0000 1.9 *************** *** 17,20 **** --- 17,26 ---- package org.mc4j.console.dashboard.components; + import org.mc4j.console.bean.operation.OperationExecuteNodeAction; + import org.mc4j.ems.connection.bean.EmsBean; + import org.mc4j.ems.connection.bean.operation.EmsOperation; + import org.openide.util.actions.SystemAction; + + import javax.swing.*; import java.awt.Font; import java.awt.GridBagConstraints; *************** *** 23,51 **** import java.awt.event.ActionEvent; import java.awt.event.ActionListener; ! import java.util.HashSet; ! import java.util.Iterator; import java.util.Map; import java.util.Set; - import javax.management.MBeanOperationInfo; - import javax.management.MalformedObjectNameException; - import javax.management.ObjectName; - import javax.swing.JButton; - import javax.swing.JLabel; - import javax.swing.JPanel; - - import org.openide.ErrorManager; - import org.openide.nodes.Node; - import org.openide.util.actions.SystemAction; - - import org.mc4j.console.bean.MBeanNode; - import org.mc4j.console.bean.operation.OperationExecuteNodeAction; - import org.mc4j.console.bean.operation.OperationNode; - import org.mc4j.console.connection.ConnectionNode; - import org.mc4j.console.dashboard.Dashboard; - import org.mc4j.console.dashboard.DashboardComponent; - /** - * * @author Greg Hinkle (gh...@us...), September 2002 * @version $Revision$($Author$ / $Date$) --- 29,37 ---- import java.awt.event.ActionEvent; import java.awt.event.ActionListener; ! import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; /** * @author Greg Hinkle (gh...@us...), September 2002 * @version $Revision$($Author$ / $Date$) *************** *** 55,96 **** public static final int BUTTON_ONLY_FORMAT = 1; public static final int FULL_FORMAT = 2; ! private static final Font NAME_FONT = Font.decode("Arial-BOLD-12"); private static final Font DETAILS_FONT = Font.decode("Arial-PLAIN-10"); /** * The set of operations to be displayed */ ! private Set operationNames = new HashSet(); ! ! private MBeanNode beanNode; ! private int format = FULL_FORMAT; ! private ObjectName objectName; ! public void setOperationName(String name) { ! this.operationNames.add(name); ! } ! ! public String getAttributeName() { ! return "multi-value set"; } ! public void setObjectName(String objectName) { ! try { ! this.objectName = new ObjectName(objectName); ! } catch (MalformedObjectNameException mone) { ! ErrorManager.getDefault().notify(mone); ! } } ! public void refresh() { ! this.removeAll(); ! this.setMinimumSize(null); this.setPreferredSize(null); --- 41,75 ---- public static final int BUTTON_ONLY_FORMAT = 1; public static final int FULL_FORMAT = 2; ! private static final Font NAME_FONT = Font.decode("Arial-BOLD-12"); private static final Font DETAILS_FONT = Font.decode("Arial-PLAIN-10"); + private EmsBean emsBean; /** * The set of operations to be displayed */ ! private Set<EmsOperation> operations = new LinkedHashSet<EmsOperation>(); ! private int format = FULL_FORMAT; ! public void setBean(EmsBean bean) { ! this.emsBean = bean; ! } ! public void setOperation(EmsOperation name) { ! this.operations.add(name); } ! public void refresh() { } ! ! public void setContext(Map context) { ! this.removeAll(); ! this.setMinimumSize(null); this.setPreferredSize(null); *************** *** 98,201 **** this.setLayout(new GridBagLayout()); this.setOpaque(false); ! ! Set operSet = this.beanNode.getOperationNodeMap().entrySet(); ! Iterator operIter = operSet.iterator(); int row = 1; ! while (operIter.hasNext()) { ! Map.Entry entry = (Map.Entry) operIter.next(); ! ! String operName = (String) entry.getKey(); ! if ((this.operationNames.size() == 0) || (this.operationNames.contains(operName))) { ! final OperationNode operationNode = (OperationNode) entry.getValue(); ! ! final MBeanOperationInfo operationInfo = operationNode.getOperationInfo(); ! ! JButton executeButton = new JButton( ! (this.format == BUTTON_ONLY_FORMAT)?operationInfo.getName():"Execute..."); ! ! executeButton.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! executeOperation(operationNode); ! } ! }); ! ! switch (this.format) { ! case BUTTON_ONLY_FORMAT: ! ! ! GridBagConstraints bc = new GridBagConstraints(); ! bc.gridx = 1; ! bc.gridy = row; ! bc.weightx = 0.5; ! bc.anchor = bc.WEST; ! bc.insets = new Insets(5,5,5,5); ! add(executeButton, bc); ! ! break; ! case FULL_FORMAT: ! ! // Add the Name label ! JLabel nameLabel = new JLabel(operationInfo.getName()); ! nameLabel.setFont(NAME_FONT); ! nameLabel.setToolTipText(operationInfo.getDescription()); - GridBagConstraints nc = new GridBagConstraints(); - nc.gridx = 1; - nc.gridy = row * 2; - nc.weightx = 0.5; - nc.anchor = nc.WEST; - nc.fill = nc.BOTH; - nc.insets = new Insets(2,2,2,2); - add(nameLabel, nc); ! // Add the execute button ! GridBagConstraints executeButtonConstraints = new GridBagConstraints( ! 2, (row * 2), ! 1, 1, ! 0.5d, 0d, ! GridBagConstraints.EAST, ! GridBagConstraints.BOTH, ! new Insets(2,2,2,2), ! 0, 0); ! ! add(executeButton, executeButtonConstraints); ! ! // Add the description Label ! JLabel descLabel = new JLabel("Description: " + operationInfo.getDescription()); ! descLabel.setFont(DETAILS_FONT); ! ! GridBagConstraints descConstraints = new GridBagConstraints( ! 1, (row * 2) + 1, ! 1, 1, ! 0.5d, 0d, ! GridBagConstraints.EAST, ! GridBagConstraints.BOTH, ! new Insets(2,2,2,2), ! 0, 0); ! add(descLabel, descConstraints); ! ! break; ! } ! ! ! ! row++; } } ! this.doLayout(); this.repaint(); } ! public void executeOperation(final OperationNode node) { ! final OperationExecuteNodeAction action = (OperationExecuteNodeAction) SystemAction.get(OperationExecuteNodeAction.class); ! Thread executor = new Thread(new Runnable() { public void run() { ! action.performAction(new Node[] { node }); } }, "mc4j Operation Execution"); --- 77,175 ---- this.setLayout(new GridBagLayout()); this.setOpaque(false); ! ! if (emsBean != null) { ! // Show all the operations for a bean ! for (final EmsOperation operation : this.emsBean.getOperations()) { ! this.operations.add(operation); ! } ! } ! int row = 1; ! for (final EmsOperation operation : this.operations) { ! JButton executeButton = new JButton( ! (this.format == BUTTON_ONLY_FORMAT) ? operation.getName() : "Execute..."); ! executeButton.setToolTipText(operation.getDescription()); ! executeButton.addActionListener(new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! executeOperation(operation); ! } ! }); ! switch (this.format) { ! case BUTTON_ONLY_FORMAT: ! GridBagConstraints bc = new GridBagConstraints(); ! bc.gridx = 1; ! bc.gridy = row; ! bc.weightx = 0.5; ! bc.anchor = bc.WEST; ! bc.insets = new Insets(5, 5, 5, 5); ! ! add(executeButton, bc); ! ! break; ! case FULL_FORMAT: ! ! // Add the Name label ! JLabel nameLabel = new JLabel(operation.getName()); ! nameLabel.setFont(NAME_FONT); ! nameLabel.setToolTipText(operation.getDescription()); ! ! GridBagConstraints nc = new GridBagConstraints(); ! nc.gridx = 1; ! nc.gridy = row * 2; ! nc.weightx = 0.5; ! nc.anchor = nc.WEST; ! nc.fill = nc.BOTH; ! nc.insets = new Insets(2, 2, 2, 2); ! add(nameLabel, nc); ! ! // Add the execute button ! GridBagConstraints executeButtonConstraints = new GridBagConstraints( ! 2, (row * 2), ! 1, 1, ! 0.5d, 0d, ! GridBagConstraints.EAST, ! GridBagConstraints.BOTH, ! new Insets(2, 2, 2, 2), ! 0, 0); ! ! add(executeButton, executeButtonConstraints); ! ! // Add the description Label ! JLabel descLabel = new JLabel("Description: " + operation.getDescription()); ! descLabel.setFont(DETAILS_FONT); ! ! GridBagConstraints descConstraints = new GridBagConstraints( ! 1, (row * 2) + 1, ! 1, 1, ! 0.5d, 0d, ! GridBagConstraints.EAST, ! GridBagConstraints.BOTH, ! new Insets(2, 2, 2, 2), ! 0, 0); ! add(descLabel, descConstraints); ! ! break; } + + row++; } ! this.doLayout(); this.repaint(); } ! public void executeOperation(final EmsOperation operation) { ! final OperationExecuteNodeAction action = ! (OperationExecuteNodeAction) SystemAction.get(OperationExecuteNodeAction.class); ! Thread executor = new Thread(new Runnable() { public void run() { ! action.performAction(operation); } }, "mc4j Operation Execution"); *************** *** 203,234 **** } ! public void setBeanNode(MBeanNode node) { ! this.beanNode = node; ! } ! ! public void setContext(Map context) { ! if (this.beanNode == null) { ! throw new IllegalStateException( ! "OperationListComponent: context atribute [beanNode] not set."); ! } ! refresh(); ! } ! ! ! /** Getter for property format. ! * @return Value of property format. * */ public int getFormat() { return format; } ! ! /** Setter for property format. ! * @param format New value of property format. * */ public void setFormat(int format) { this.format = format; } ! } --- 177,197 ---- } ! /** ! * Getter for property format. * + * @return Value of property format. */ public int getFormat() { return format; } ! ! /** ! * Setter for property format. * + * @param format New value of property format. */ public void setFormat(int format) { this.format = format; } ! } Index: TimeLabelComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/TimeLabelComponent.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TimeLabelComponent.java 13 Oct 2004 04:59:36 -0000 1.1 --- TimeLabelComponent.java 12 Apr 2006 19:13:59 -0000 1.2 *************** *** 17,22 **** package org.mc4j.console.dashboard.components; ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.bean.attribute.AttributeNode; import java.util.Map; --- 17,22 ---- package org.mc4j.console.dashboard.components; ! import org.mc4j.ems.connection.bean.EmsBean; ! import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import java.util.Map; *************** *** 33,42 **** public class TimeLabelComponent extends JLabel implements BeanComponent { ! private MBeanNode beanNode; private String attributeName; ! public void setBeanNode(MBeanNode node) { ! this.beanNode = node; } --- 33,42 ---- public class TimeLabelComponent extends JLabel implements BeanComponent { ! private EmsBean emsBean; private String attributeName; ! public void setBean(EmsBean emsBean) { ! this.emsBean = emsBean; } *************** *** 54,60 **** public void refresh() { ! AttributeNode attributeNode = (AttributeNode) beanNode.getAttributeNodeMap().get(attributeName); ! attributeNode.refresh(); ! Object valueObject = attributeNode.getValue(); Number number = (Number) valueObject; --- 54,60 ---- public void refresh() { ! EmsAttribute emsAttribute = emsBean.getAttribute(attributeName); ! emsAttribute.refresh(); ! Object valueObject = emsAttribute.getValue(); Number number = (Number) valueObject; *************** *** 65,72 **** cal.get(Calendar.YEAR); - - - } - } --- 65,68 ---- Index: RefreshControlComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/RefreshControlComponent.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RefreshControlComponent.java 5 Oct 2004 05:16:00 -0000 1.5 --- RefreshControlComponent.java 12 Apr 2006 19:13:59 -0000 1.6 *************** *** 17,20 **** --- 17,28 ---- package org.mc4j.console.dashboard.components; + import org.mc4j.console.Refreshable; + import org.mc4j.console.dashboard.Dashboard; + import org.mc4j.console.dashboard.DashboardComponent; + import org.mc4j.console.dashboard.match.BeanMatch; + import org.mc4j.ems.connection.bean.EmsBean; + + import javax.swing.*; + import java.awt.Color; import java.awt.Component; import java.awt.Container; *************** *** 25,39 **** import java.util.TimerTask; - import javax.swing.ImageIcon; - import javax.swing.JFrame; - import javax.swing.JLabel; - import javax.swing.JPanel; - import javax.swing.JOptionPane; - import javax.swing.JDialog; - - import org.mc4j.console.Refreshable; - import org.mc4j.console.dashboard.Dashboard; - import org.mc4j.console.dashboard.DashboardComponent; - /** * --- 33,36 ---- *************** *** 51,57 **** private Timer timer; private Container rootContainer; ! private long refreshDelay = 1000; private boolean removed = false; --- 48,55 ---- private Timer timer; + private Dashboard dashboard; private Container rootContainer; ! private long refreshDelay = 5000; private boolean removed = false; *************** *** 66,71 **** private void init() { ! this.spinningIcon = createImageIcon("images/AnimatedLogo.gif","Click to stop"); ! this.stoppedIcon = createImageIcon("images/Logo1.gif", "Click to start"); this.spinningLogo = new JLabel(this.spinningIcon); this.spinningLogo.setToolTipText("Click to stop refreshes. " + --- 64,69 ---- private void init() { ! this.spinningIcon = createImageIcon("images/AnimatedLogoMC4J2_64.gif" /*"images/AnimatedLogo.gif"*/,"Click to stop"); ! this.stoppedIcon = createImageIcon("images/AnimatedLogoStoppedMC4J2_64.gif", "Click to start"); this.spinningLogo = new JLabel(this.spinningIcon); this.spinningLogo.setToolTipText("Click to stop refreshes. " + *************** *** 73,78 **** //icon.setImageObserver(label); add(this.spinningLogo); ! this.spinningLogo.setSize(72,72); ! setSize(72,72); doLayout(); --- 71,77 ---- //icon.setImageObserver(label); add(this.spinningLogo); ! this.spinningLogo.setSize(64,38); ! ! setSize(64,38); doLayout(); *************** *** 159,162 **** --- 158,163 ---- public void setContext(Map context) { + this.dashboard = (Dashboard) context.get(Dashboard.CONTEXT_DASHBOARD); + this.rootContainer = (Container) context.get(Dashboard.CONTEXT_DASHBOARD_ROOT_CONTAINER); *************** *** 168,171 **** --- 169,173 ---- private void refreshContainer(Container container) { + for (int i = 0; i < container.getComponents().length; i++) { Component component = container.getComponents()[i]; *************** *** 181,184 **** --- 183,201 ---- public void refresh() { + // Refresh the beans attached to this dashboard + if (dashboard.isAutoBeanRefresh()) { + + for (BeanMatch match : dashboard.getDashboardMatch().getBeanMatchList()) { + for (EmsBean bean : match.getMatchedBeans()) { + // Currently refreshing all attributes... may be slower for beans + // with large numbers of attributes that aren't all being displayed + long start = System.currentTimeMillis(); + bean.refreshAttributes(); + //System.out.println((System.currentTimeMillis() - start) + "ms to refresh " + bean.getBeanName().toString()); + } + } + } + + // Now refresh the components on the dashboard giving them a chance to use the data refreshContainer(this.rootContainer); } *************** *** 194,197 **** --- 211,215 ---- public static void main(String[] args) { JFrame frame = new JFrame(); + frame.setBackground(Color.gray); frame.getContentPane().add(new RefreshControlComponent()); Index: AttributeTablePopupComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/AttributeTablePopupComponent.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AttributeTablePopupComponent.java 14 Mar 2005 16:05:38 -0000 1.4 --- AttributeTablePopupComponent.java 12 Apr 2006 19:13:59 -0000 1.5 *************** *** 17,33 **** package org.mc4j.console.dashboard.components; - import org.openide.util.HelpCtx; - import org.openide.util.actions.SystemAction; - import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.bean.OperationListAction; ! import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; - import javax.swing.JPopupMenu; - /** * This extension of the AttributeTableComponent offers a popup menu to execute operations --- 17,31 ---- package org.mc4j.console.dashboard.components; import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.bean.OperationListAction; + import org.openide.util.HelpCtx; + import org.openide.util.actions.SystemAction; ! import javax.swing.*; ! import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; /** * This extension of the AttributeTableComponent offers a popup menu to execute operations *************** *** 45,49 **** /* (non-Javadoc) * @see org.mc4j.console.dashboard.components.AttributeTableComponent#init() ! */ public void init() { super.init(); --- 43,47 ---- /* (non-Javadoc) * @see org.mc4j.console.dashboard.components.AttributeTableComponent#init() ! */ public void init() { super.init(); *************** *** 83,87 **** selectedRow = AttributeTablePopupComponent.this.table.convertRowIndexToModel(selectedRow); ! MBeanNode mbeanNode = (MBeanNode) AttributeTablePopupComponent.this.mbeanNodes.get(selectedRow); JPopupMenu popupMenu = new JPopupMenu(); --- 81,85 ---- selectedRow = AttributeTablePopupComponent.this.table.convertRowIndexToModel(selectedRow); ! MBeanNode mbeanNode = (MBeanNode) AttributeTablePopupComponent.this.beanList.get(selectedRow); JPopupMenu popupMenu = new JPopupMenu(); *************** *** 104,108 **** public void actionPerformed(ActionEvent ev) { ! bean.getConnectionNode().browseToMBean(bean.getObjectName()); } --- 102,106 ---- public void actionPerformed(ActionEvent ev) { ! bean.getConnectionNode().browseToMBean(bean.getEmsBean().getBeanName().getCanonicalName()); } --- NEW FILE: TabularDataComponent.java --- /* * Copyright 2002-2005 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.dashboard.components; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.AlternateRowHighlighter; import org.jdesktop.swingx.decorator.Highlighter; import org.jdesktop.swingx.decorator.HighlighterPipeline; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import javax.management.openmbean.CompositeData; import javax.management.openmbean.CompositeType; import javax.management.openmbean.TabularData; import javax.swing.*; import javax.swing.table.DefaultTableModel; import java.awt.BorderLayout; import java.util.ArrayList; import java.util.List; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Dec 20, 2005 * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:13:59 $) */ public class TabularDataComponent extends JPanel implements BeanComponent { EmsBean bean; JXTable table; String attributeName; EmsAttribute attribute; TabularDataTableModel model; private boolean refreshable = true; private boolean scrollable = true; public void setBean(EmsBean emsBean) { this.bean = emsBean; } public void setAttributeName(String attributeName) { this.attributeName = attributeName; } public void setContext(Map context) { attribute = bean.getAttribute(attributeName); init(); } public boolean isRefreshable() { return refreshable; } public void setRefreshable(boolean refreshable) { this.refreshable = refreshable; } public boolean isScrollable() { return scrollable; } public void setScrollable(boolean scrollable) { this.scrollable = scrollable; } public void init() { table = new JXTable(); table.setColumnControlVisible(true); this.table.setHighlighters(new HighlighterPipeline(new Highlighter[]{new AlternateRowHighlighter()})); setLayout(new BorderLayout()); if (isScrollable()) add(new JScrollPane(table), BorderLayout.CENTER); else add(table,BorderLayout.CENTER); } public void refresh() { if (model != null && !isRefreshable()) return; TabularData d = (TabularData) attribute.refresh(); if (d != null) { if (model == null) { model = new TabularDataTableModel(d); model.setData((TabularData) attribute.refresh()); table.setModel(model); } else { model.setData((TabularData) attribute.refresh()); } } } public static class TabularDataTableModel extends DefaultTableModel { TabularData data; List<CompositeData> values; List<Object> columnKeys; public TabularDataTableModel(TabularData data) { this.data = data; CompositeType rowType = data.getTabularType().getRowType(); setColumnCount(rowType.keySet().size() + 1); //setColumnMetaData(0,new MetaData("index",String.class,"Index")); int n = 1; for (Object cn : rowType.keySet()) { String columnName = (String) cn; String className = rowType.getType(columnName).getClassName(); Class type = null; try { type = Class.forName(className); } catch (ClassNotFoundException e) { } //MetaData metaData = new MetaData(columnName, type == null ? String.class : type, rowType.getDescription(columnName)); //setColumnMetaData(n++, metaData); } setData(data); } public void setData(TabularData data) { this.data = data; //noinspection unchecked this.values = new ArrayList<CompositeData>(this.data.values()); this.columnKeys = new ArrayList<Object>(this.data.getTabularType().getRowType().keySet()); fireTableDataChanged(); } public int getRowCount() { return data == null ? 0 : data.size(); } public Object getValueAt(int row, int col) { return values.get(row).get(String.valueOf(columnKeys.get(col))); } public int getColumnCount() { return (columnKeys == null) ? 0 : columnKeys.size(); } public String getColumnName(int column) { return (columnKeys == null) ? "" : String.valueOf(columnKeys.get(column)); } public boolean isCellEditable(int i, int i1) { return false; } } } Index: BeanListComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/BeanListComponent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BeanListComponent.java 5 Oct 2004 05:16:00 -0000 1.2 --- BeanListComponent.java 12 Apr 2006 19:13:59 -0000 1.3 *************** *** 17,23 **** package org.mc4j.console.dashboard.components; - import java.util.List; - import org.mc4j.console.dashboard.DashboardComponent; /** --- 17,24 ---- package org.mc4j.console.dashboard.components; import org.mc4j.console.dashboard.DashboardComponent; + import org.mc4j.ems.connection.bean.EmsBean; + + import java.util.List; /** *************** *** 36,39 **** * @param beanList */ ! void setBeanList(List beanList); } --- 37,40 ---- * @param beanList */ ! void setBeanList(List<EmsBean> beanList); } Index: BeanComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/BeanComponent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BeanComponent.java 5 Oct 2004 05:16:00 -0000 1.2 --- BeanComponent.java 12 Apr 2006 19:13:59 -0000 1.3 *************** *** 17,22 **** package org.mc4j.console.dashboard.components; - import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.dashboard.DashboardComponent; /** --- 17,22 ---- package org.mc4j.console.dashboard.components; import org.mc4j.console.dashboard.DashboardComponent; + import org.mc4j.ems.connection.bean.EmsBean; /** *************** *** 30,33 **** public interface BeanComponent extends DashboardComponent { ! void setBeanNode(MBeanNode node); } --- 30,33 ---- public interface BeanComponent extends DashboardComponent { ! void setBean(EmsBean emsBean); } --- NEW FILE: ErrorComponent.java --- /* * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.mc4j.console.dashboard.components; import org.openide.ErrorManager; import javax.swing.*; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; /** * Created: Jun 24, 2005 2:04:35 PM * * @author Greg Hinkle (gh...@us...) * @version $Revision: 1.2 $($Author: ghinkl $ / $Date: 2006/04/12 19:13:59 $) */ public class ErrorComponent extends JOptionPane { public ErrorComponent(final Exception e) { super("Error loading component: " + e.getMessage() , JOptionPane.ERROR_MESSAGE, JOptionPane.DEFAULT_OPTION, null, new String[] { "Display" }); addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { ErrorManager.getDefault().notify(ErrorManager.USER,e); } }); } } Index: ForEachPanelComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/ForEachPanelComponent.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ForEachPanelComponent.java 5 Oct 2004 05:16:00 -0000 1.2 --- ForEachPanelComponent.java 12 Apr 2006 19:13:59 -0000 1.3 *************** *** 17,25 **** package org.mc4j.console.dashboard.components; import java.util.List; import java.util.Map; - import javax.swing.JPanel; - /** * Supports a for-each iteration of a set of beans --- 17,26 ---- package org.mc4j.console.dashboard.components; + import org.mc4j.ems.connection.bean.EmsBean; + + import javax.swing.*; import java.util.List; import java.util.Map; /** * Supports a for-each iteration of a set of beans *************** *** 30,34 **** public class ForEachPanelComponent extends JPanel implements BeanListComponent { ! protected List mbeanNodes; protected String idKey; --- 31,35 ---- public class ForEachPanelComponent extends JPanel implements BeanListComponent { ! protected List<EmsBean> beanList; protected String idKey; *************** *** 36,39 **** --- 37,43 ---- protected boolean sorted = false; + public ForEachPanelComponent() { + + } public void init() { *************** *** 55,71 **** ! public void setBeanList(List list) { ! this.mbeanNodes = list; } ! public List getBeanList() { ! return mbeanNodes; } public void setContext(Map context) { ! if (this.mbeanNodes == null) { throw new IllegalStateException( ! "AttributeTableComponent: You must specify an appropriate [beanList] attribute."); } init(); --- 59,75 ---- ! public void setBeanList(List<EmsBean> list) { ! this.beanList = list; } ! public List<EmsBean> getBeanList() { ! return beanList; } public void setContext(Map context) { ! if (this.beanList == null) { throw new IllegalStateException( ! "ForEachPanelComponent: You must specify an appropriate [beanList] attribute."); } init(); Index: AttributeTreeTableExplorer.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/AttributeTreeTableExplorer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AttributeTreeTableExplorer.java 5 Oct 2004 05:16:00 -0000 1.4 --- AttributeTreeTableExplorer.java 12 Apr 2006 19:13:59 -0000 1.5 *************** *** 17,21 **** package org.mc4j.console.dashboard.components; ! import org.mc4j.console.bean.MBeanNode; import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerUtils; --- 17,21 ---- package org.mc4j.console.dashboard.components; ! import org.mc4j.ems.connection.bean.EmsBean; import org.openide.explorer.ExplorerManager; import org.openide.explorer.ExplorerUtils; *************** *** 44,48 **** private Lookup lookup; ! private MBeanNode beanNode; private TreeTableView treeView; --- 44,48 ---- private Lookup lookup; ! private EmsBean emsBean; private TreeTableView treeView; *************** *** 111,123 **** } ! public void setBeanNode(MBeanNode node) { ! this.beanNode = node; } public void setContext(Map context) { ! if (this.beanNode == null) { throw new IllegalStateException( ! "AttributeTreeTableExplorer: context atribute [beanNode] not set."); } --- 111,123 ---- } ! public void setBean(EmsBean emsBean) { ! this.emsBean = emsBean; } public void setContext(Map context) { ! if (this.emsBean == null) { throw new IllegalStateException( ! "AttributeTreeTableExplorer: context atribute [bean] not set."); } *************** *** 166,187 **** ! this.manager.setRootContext(this.beanNode.getAttributesNode()); SwingUtilities.invokeLater(new Runnable() { public void run() { ! setDisplayName(AttributeTreeTableExplorer.this.beanNode.getName()); } }); // TODO GH: This is just a rough guestimate... can we determine font-heights or maximum node-line heights? ! int heightNeeded = (18 * this.beanNode.getAttributesNode().getChildren().getNodes().length) + 50; ! setPreferredSize(new Dimension(getWidth(), heightNeeded)); ! setMaximumSize(new Dimension(Integer.MAX_VALUE, heightNeeded)); } public void refresh() { ! this.beanNode.retrieveData(); } --- 166,187 ---- ! // this.manager.setRootContext(this.emsBean.getAttributesNode()); SwingUtilities.invokeLater(new Runnable() { public void run() { ! // setDisplayName(AttributeTreeTableExplorer.this.emsBean.getName()); } }); // TODO GH: This is just a rough guestimate... can we determine font-heights or maximum node-line heights? ! // int heightNeeded = (18 * this.emsBean.getAttributesNode().getChildren().getNodes().length) + 50; ! // setPreferredSize(new Dimension(getWidth(), heightNeeded)); ! // setMaximumSize(new Dimension(Integer.MAX_VALUE, heightNeeded)); } public void refresh() { ! // this.emsBean.retrieveData(); } Index: NumericAttributeGraph.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/components/NumericAttributeGraph.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** NumericAttributeGraph.java 5 Oct 2004 05:16:00 -0000 1.13 --- NumericAttributeGraph.java 12 Apr 2006 19:13:59 -0000 1.14 *************** *** 17,34 **** package org.mc4j.console.dashboard.components; ! import java.util.ArrayList; ! import java.util.HashSet; ! import java.util.List; import java.util.Map; import java.util.Set; - import javax.management.MBeanAttributeInfo; - import javax.management.MBeanServer; - import javax.management.ObjectName; - - import org.mc4j.console.bean.MBeanNode; - import org.mc4j.console.bean.attribute.AttributeGraphPanel; - import org.mc4j.console.dashboard.DashboardComponent; - /** * --- 17,27 ---- package org.mc4j.console.dashboard.components; ! import org.mc4j.console.dashboard.DashboardComponent; ! import org.mc4j.console.swing.graph.AttributeGraphPanel; ! import org.mc4j.ems.connection.bean.attribute.EmsAttribute; ! import java.util.Map; import java.util.Set; /** * *************** *** 36,52 **** * @version $Revision$($Author$ / $Date$) */ ! public class NumericAttributeGraph extends AttributeGraphPanel implements BeanComponent { ! ! protected Set attributeSet = new HashSet(); ! ! protected MBeanNode node; ! ! /* ! public void componentClosed() { ! this.dataGenerator.stop(); ! super.componentClosed(); ! } ! */ ! /** --- 29,33 ---- * @version $Revision$($Author$ / $Date$) */ ! public class NumericAttributeGraph extends AttributeGraphPanel implements DashboardComponent { /** *************** *** 57,61 **** return sleepSlider.getValue(); } - /** * Setter for property updateInterval. --- 38,41 ---- *************** *** 66,126 **** } ! ! ! ! /** ! * Getter for property currentAttributeName. ! * @return Value of property currentAttributeName. ! */ ! public java.lang.String getAttributeName() { ! return "Multivalue attribute"; ! } ! ! ! /** ! * Setter for property currentAttributeName. ! * @param attributeName New value of property currentAttributeName. ! */ ! public void setAttributeName(java.lang.String attributeName) { ! this.attributeSet.add(attributeName); ! } ! ! public void refresh() { } ! public void setBeanNode(MBeanNode mBeanNode) { ! this.node = mBeanNode; } - public void setContext(Map context) { - if (node == null) { - throw new IllegalStateException( - "NumericAttributeGraph: context atribute [beanNode] not set."); - } ! ObjectName objectName = node.getObjectName(); ! MBeanAttributeInfo[] completeAttributeInfo = node.getMBeanInfo().getAttributes(); ! MBeanServer server = node.getMBeanServer(); - - this.objectName = objectName; - this.server = server; - List attList = new ArrayList(); - for (int i = 0; i < completeAttributeInfo.length; i++) { - if (this.attributeSet.contains(completeAttributeInfo[i].getName())) { - attList.add(completeAttributeInfo[i]); - createTimeSeries(completeAttributeInfo[i].getName(), completeAttributeInfo[i]); - } - } ! this.attributeInfo = (MBeanAttributeInfo[]) attLi... [truncated message content] |