mc4j-cvs Mailing List for MC4J JMX Console (Page 11)
Brought to you by:
ghinkl
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(7) |
Apr
(135) |
May
(32) |
Jun
(34) |
Jul
|
Aug
|
Sep
(7) |
Oct
(139) |
Nov
(11) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(34) |
Feb
(1) |
Mar
(12) |
Apr
|
May
(87) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(27) |
Nov
(49) |
Dec
(13) |
2006 |
Jan
|
Feb
|
Mar
|
Apr
(252) |
May
(16) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
(2) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
|
Nov
(1) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
(2) |
Jul
(15) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(6) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(1) |
Nov
|
Dec
|
From: Greg H. <gh...@us...> - 2006-04-12 17:29:05
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/util Modified Files: Tag: ems_module_separation ConnectionInfoAction.java ExceptionUtility.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: ExceptionUtility.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/util/ExceptionUtility.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** ExceptionUtility.java 5 Oct 2004 05:16:19 -0000 1.4 --- ExceptionUtility.java 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 101,105 **** Method method = theClass.getMethod("getCause", GET_CAUSE_PARAMS ); ! return (Throwable)method.invoke(throwable, null ); } catch(Throwable t ) { // That didn't work, but that's ok --- 101,105 ---- Method method = theClass.getMethod("getCause", GET_CAUSE_PARAMS ); ! return (Throwable)method.invoke(throwable ); } catch(Throwable t ) { // That didn't work, but that's ok Index: ConnectionInfoAction.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/util/ConnectionInfoAction.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** ConnectionInfoAction.java 19 Jan 2005 14:10:34 -0000 1.4 --- ConnectionInfoAction.java 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 17,20 **** --- 17,21 ---- package org.mc4j.console.util; + import org.mc4j.ems.connection.EmsConnection; import org.openide.util.HelpCtx; import org.openide.util.actions.CallableSystemAction; *************** *** 27,31 **** import java.text.Format; import java.text.MessageFormat; ! import java.util.Arrays; /** --- 28,33 ---- import java.text.Format; import java.text.MessageFormat; ! import java.util.Set; ! import java.util.WeakHashMap; /** *************** *** 35,47 **** public class ConnectionInfoAction extends CallableSystemAction { ! private static long serverHits; ! public static void addHit() { ! serverHits++; } - public static long getHits() { - return serverHits; - } public String getName() { return "Server calls"; --- 37,46 ---- public class ConnectionInfoAction extends CallableSystemAction { ! private static WeakHashMap<EmsConnection,String> map = new WeakHashMap<EmsConnection,String>(); ! public static void addStats(EmsConnection connection) { ! map.put(connection, null); } public String getName() { return "Server calls"; *************** *** 53,61 **** public static void resetStats() { - serverHits = 0; } public void performAction() { - serverHits = 0; } --- 52,58 ---- *************** *** 83,91 **** enableEvents(java.awt.AWTEvent.MOUSE_EVENT_MASK); // To get the size right: ! setText(f.format(new Object[] {new Double(999.0d), new Double(999.0d)})); setOpaque(false); setBorder(BorderFactory.createEmptyBorder(2,3,2,3)); ! setToolTipText("The number of server roundtrips made. Click to reset."); } --- 80,88 ---- enableEvents(java.awt.AWTEvent.MOUSE_EVENT_MASK); // To get the size right: ! setText(f.format(new Object[] {999.0d, 999.0d})); setOpaque(false); setBorder(BorderFactory.createEmptyBorder(2,3,2,3)); ! setToolTipText("The number of server roundtrips / The number of connection failures."); } *************** *** 112,116 **** private void update(boolean ticked) { ! setText(String.valueOf(getHits())); } --- 109,122 ---- private void update(boolean ticked) { ! long hits = 0; ! long failures = 0; ! ! Set<EmsConnection> connections = map.keySet(); ! for (EmsConnection connection : connections) { ! hits += connection.getRoundTrips(); ! failures += connection.getFailures(); ! } ! ! setText(String.valueOf(hits) + "/" + String.valueOf(failures)); } |
From: Greg H. <gh...@us...> - 2006-04-12 17:29:01
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/context In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/dashboard/context Added Files: Tag: ems_module_separation OgnlHelper.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: OgnlHelper.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.context; import ognl.ClassResolver; import ognl.DefaultClassResolver; import ognl.DefaultTypeConverter; import ognl.Ognl; import ognl.OgnlException; import ognl.OgnlRuntime; import ognl.PropertyAccessor; import ognl.TypeConverter; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.openide.windows.IOProvider; import javax.management.openmbean.CompositeData; import javax.management.openmbean.TabularData; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; import java.util.Map; import java.util.HashMap; import java.util.Date; /** * @author Greg Hinkle (gh...@us...), Apr 6, 2006 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class OgnlHelper { static TypeConverter converter = new ExtendedConvertor(); static ClassResolver resolver = new DefaultClassResolver(); static Formatter formatter = new Formatter(); public static Object getValue(String identifier, Map context, Class type) throws OgnlException { return getValue(identifier, context, context, type); } public static Object getValue(String identifier, Map context, Object root, Class type) throws OgnlException { if (context == null) { context = new HashMap(); } Ognl.setTypeConverter(context, converter); Ognl.setClassResolver(context, resolver); context.put("format",formatter); Object expression = Ognl.parseExpression(identifier); Object result = Ognl.getValue(expression, context, context, type); if (result == null) { // Looks like Ognl gets confused by classes loaded in other classloaders // Try again without asking for conversion result = Ognl.getValue(expression,context, root); } return result; } public static class Formatter { public String date(Number millis) { if (millis == null) return null; return (new Date(millis.longValue())).toString(); } private long[] millisTimes = { 1000L,60L,60L,24L,365L}; private String[] millisName = { "Second", "Minute", "Hour", "Day", "Year" }; public String timeMillis(Number time) { return time(time, millisTimes, millisName); } private long[] nanosTimes = { 1000000000L,60L,60L,24L,365L}; private String[] nanosName = {"Second", "Minute", "Hour", "Day", "Year" }; public String timeNanos(Number time) { return time(time, nanosTimes, nanosName); } private String time(Number time ,long[] spaces, String[] names) { long n = time.longValue(); long[] values = new long[spaces.length]; // Temporarily store the divisor in the values values[0] = spaces[0]; for (int i = 1;i<values.length;i++) values[i] = spaces[i] * values[i-1]; for (int i = values.length-1; i >=0; i--) { n -= values[i] * (values[i] = n / values[i]); } StringBuilder b = new StringBuilder(); for (int i = values.length-1; i >= 0; i--) { if (values[i] > 0) { if (b.length() > 0) b.append(" "); b.append(values[i]); b.append(" "); b.append(names[i]); if (values[i] > 1) b.append("s"); } } return b.toString(); } public String sizeBytes(Number bytes) { long l = (long) Math.log10(bytes.doubleValue()); if (l <3) { return String.format("%,.2f Bytes", bytes.doubleValue()); } else if (l < 6) { return String.format("%,.2f KB", bytes.doubleValue() / Math.pow(10d, 3d)); } else if (l < 9) { return String.format("%,.2f MB", bytes.doubleValue() / Math.pow(10d, 6d)); } else { return String.format("%,.2f GB", bytes.doubleValue() / Math.pow(10d, 9d)); } } } public static class ExtendedConvertor extends DefaultTypeConverter { public Object convertValue(Map context, Object value, Class toType) { Object result = null; if ((toType == Dimension.class) && (value instanceof String)) { String[] parts = ((String) value).split(","); result = new Dimension(Integer.parseInt(parts[0]), Integer.parseInt(parts[1])); } else if (toType == Color.class && (value instanceof String)) { result = Color.decode((String) value); } else if (toType == Font.class && (value instanceof String)) { result = Font.decode((String) value); } else { result = super.convertValue(context, value, toType); } return result; } } static { OgnlRuntime.setPropertyAccessor(EmsBean.class, new EmsBeansPropertyAccessor()); OgnlRuntime.setPropertyAccessor(CompositeData.class, new CompositePropertyAccessor()); OgnlRuntime.setPropertyAccessor(TabularData.class, new TabularDataPropertyAccessor()); } public static class EmsBeansPropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { EmsBean bean = (EmsBean) target; EmsAttribute attribute = bean.getAttribute((String) name); if (attribute == null) { IOProvider.getDefault().getIO("Dashboard debugging", false).getOut(). println("Attribute [" + name + "] not found on bean [" + bean.getBeanName() + "]"); return "?"; } return attribute.getValue(); } public void setProperty(Map map, Object object, Object object1, Object object2) throws OgnlException { throw new UnsupportedOperationException("Don't set attribute this way."); } } public static class CompositePropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { CompositeData d = (CompositeData) target; return d.get((String) name); } public void setProperty(Map map, Object object, Object object1, Object object2) throws OgnlException { throw new UnsupportedOperationException("Don't set attributes this way."); } } public static class TabularDataPropertyAccessor implements PropertyAccessor { public Object getProperty(Map context, Object target, Object name) throws OgnlException { TabularData d = (TabularData) target; return d.get(new Object[]{name}); } public void setProperty(Map map, Object object, Object object1, Object object2) throws OgnlException { } } /* public static void main(String[] args) { Map context = new HashMap(); context.put("foo", new Date()); //Object result = OgnlHelper.getValue("'500,300'", context, Dimension.class); Object result = OgnlHelper.getValue("new javax.swing.JPanel()", context, null); System.out.println("Type: " + result.getClass().getName()); System.out.println("Value: " + result); } */ } |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:51
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/graph In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/swing/graph Modified Files: Tag: ems_module_separation AbstractGraphPanel.java Added Files: Tag: ems_module_separation AttributeGraphPanel.java GlassWindow.java GraphSeriesPanel.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: GraphSeriesPanel.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.swing.graph; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.HighlighterPipeline; import org.jdesktop.swingx.decorator.Highlighter; import org.jdesktop.swingx.decorator.AlternateRowHighlighter; import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesCollection; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import javax.swing.*; import javax.swing.table.AbstractTableModel; import java.awt.BorderLayout; import java.awt.Dimension; /** * @author Greg Hinkle (gh...@us...), Mar 30, 2006 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class GraphSeriesPanel extends JPanel { TimeSeriesCollection timeSeriesCollection; public GraphSeriesPanel(TimeSeriesCollection timeSeriesCollection) { this.timeSeriesCollection = timeSeriesCollection; init(); } private void init() { setLayout(new BorderLayout()); add(new JLabel("Currently graphed attributes"), BorderLayout.NORTH); JXTable table = new JXTable(new SeriesTableModel()); table.setHighlighters(new HighlighterPipeline(new Highlighter[] { new AlternateRowHighlighter() })); table.setColumnControlVisible(true); add(new JScrollPane(table), BorderLayout.CENTER); setSize(450,250); setPreferredSize(new Dimension(450,250)); } private class SeriesTableModel extends AbstractTableModel { public int getRowCount() { return timeSeriesCollection.getSeriesCount(); } public int getColumnCount() { return 3; } public String getColumnName(int column) { switch (column) { case 0: return "Name"; case 1: return "Description"; case 2: return "Value"; default: return ""; } } public Class<?> getColumnClass(int column) { switch (column) { case 0: return String.class; case 1: return String.class; case 2: return Number.class; default: return Object.class; } } public Object getValueAt(int row, int column) { TimeSeries s = timeSeriesCollection.getSeries(row); EmsAttribute attribute = (EmsAttribute) s.getKey(); switch (column) { case 0: return attribute.getName(); case 1: return attribute.getDescription(); case 2: return attribute.getValue(); case 3: return new JButton("Hi"); default: return s; } } } } --- NEW FILE: AttributeGraphPanel.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.swing.graph; import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; import org.mc4j.console.bean.attribute.AttributeNode; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.openide.nodes.Node; import org.openide.nodes.NodeTransfer; import java.awt.dnd.DnDConstants; import java.awt.dnd.DropTarget; import java.awt.dnd.DropTargetDragEvent; import java.awt.dnd.DropTargetDropEvent; import java.awt.dnd.DropTargetEvent; import java.awt.dnd.DropTargetListener; import java.util.List; /** * This TopComponent is a graph of JMX MBean Attributes. It only works * with numeric attributes. * * @author Greg Hinkle (gh...@us...), January 2002 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class AttributeGraphPanel extends AbstractGraphPanel implements DropTargetListener { private static int graphNumber = 1; public AttributeGraphPanel() { } protected void initGraphPanel() { super.initGraphPanel(); chartPanel.setDropTarget(new DropTarget(this,this)); } public AttributeGraphPanel(List<EmsAttribute> attributes) { for (EmsAttribute attribute : attributes) { addAttribute(attribute); } if (attributes.size() == 1) { setChartTitle(attributes.get(0).getName() + " Graph"); } else { setChartTitle("Graph " + graphNumber++); } reschedule(); } public void addAttribute(EmsAttribute attribute) { createTimeSeries(attribute.getName(),attribute); } public void addObservation() throws Exception { for (Object at : getTimeSeriesKeys()) { EmsAttribute attribute = (EmsAttribute) at; Object value = attribute.refresh(); Number val = (Number) value; TimeSeries ts = getTimeSeries(attribute); ts.add(new Millisecond(), val.doubleValue()); } } /** * We handle drops of AttributeNodes only at this time * @param dtde */ public void drop(DropTargetDropEvent dtde) { dtde.acceptDrop( DnDConstants.ACTION_REFERENCE); // For some stupid reason, this utility requires action mapping, so i can't ignore action types like i want to Node[] nodes = NodeTransfer.nodes(dtde.getTransferable(), 1); for (Node node : nodes) { if (node instanceof AttributeNode) { EmsAttribute attribute = ((AttributeNode) node).getEmsAttribute(); if (attribute.isNumericType()) { addAttribute(attribute); } } } } public void dragEnter(DropTargetDragEvent dtde) { } public void dragOver(DropTargetDragEvent dtde) { } public void dropActionChanged(DropTargetDragEvent dtde) { } public void dragExit(DropTargetEvent dte) { } } Index: AbstractGraphPanel.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/graph/AbstractGraphPanel.java,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** AbstractGraphPanel.java 5 Oct 2004 05:16:03 -0000 1.9 --- AbstractGraphPanel.java 12 Apr 2006 17:28:38 -0000 1.9.2.1 *************** *** 23,37 **** import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.XYPlot; ! import org.jfree.chart.renderer.DefaultXYItemRenderer; import org.jfree.chart.title.TextTitle; import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesCollection; - - import org.openide.windows.TopComponent; - import org.mc4j.console.dashboard.components.RefreshControlComponent; import org.mc4j.console.swing.LogarithmicTimeJSlider; import java.awt.BorderLayout; import java.awt.Color; --- 23,37 ---- import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.plot.XYPlot; ! import org.jfree.chart.renderer.xy.DefaultXYItemRenderer; import org.jfree.chart.title.TextTitle; import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesCollection; import org.mc4j.console.dashboard.components.RefreshControlComponent; import org.mc4j.console.swing.LogarithmicTimeJSlider; + import org.openide.windows.TopComponent; + import javax.swing.*; + import javax.swing.border.LineBorder; import java.awt.BorderLayout; import java.awt.Color; *************** *** 50,67 **** import java.util.Timer; import java.util.TimerTask; ! ! import javax.swing.BorderFactory; ! import javax.swing.BoxLayout; ! import javax.swing.ButtonGroup; ! import javax.swing.Icon; ! import javax.swing.ImageIcon; ! import javax.swing.JCheckBox; ! import javax.swing.JFrame; ! import javax.swing.JLabel; ! import javax.swing.JPanel; ! import javax.swing.JPopupMenu; ! import javax.swing.JRadioButton; ! import javax.swing.SwingUtilities; ! import javax.swing.border.LineBorder; /** --- 50,54 ---- import java.util.Timer; import java.util.TimerTask; ! import java.util.Set; /** *************** *** 74,88 **** * @version $Revision$($Author$ / $Date$) */ ! public abstract class AbstractGraphPanel extends TopComponent { protected TimeSeriesCollection dataset = new TimeSeriesCollection(); - protected JFreeChart chart; protected Timer dataGeneratorTimer; protected TimerTask dataGeneratorTimerTask; ! protected Map timeSeriesMap = new HashMap(); protected XYPlot xyplot; --- 61,74 ---- * @version $Revision$($Author$ / $Date$) */ ! public abstract class AbstractGraphPanel<T> extends TopComponent { protected TimeSeriesCollection dataset = new TimeSeriesCollection(); protected JFreeChart chart; protected Timer dataGeneratorTimer; protected TimerTask dataGeneratorTimerTask; ! protected Map<T,TimeSeries> timeSeriesMap = new HashMap<T, TimeSeries>(); protected XYPlot xyplot; *************** *** 108,111 **** --- 94,98 ---- protected int failures = 0; protected static final int MAX_FAILURES = 10; + protected ChartPanel chartPanel; *************** *** 119,123 **** } - public void setChartTitle(final String name) { SwingUtilities.invokeLater(new Runnable() { --- 106,109 ---- *************** *** 140,145 **** NumberAxis range = new NumberAxis(""); ! this.xyplot = new XYPlot(dataset, domain, range, new DefaultXYItemRenderer()); ! domain.setAutoRange(true); domain.setLowerMargin(0.0); --- 126,137 ---- NumberAxis range = new NumberAxis(""); ! this.xyplot = new XYPlot(); ! this.xyplot.setDataset(dataset); ! this.xyplot.setDomainAxis(domain); ! this.xyplot.setRangeAxis(range); ! DefaultXYItemRenderer renderer = new DefaultXYItemRenderer(); ! renderer.setShapesVisible(false); ! this.xyplot.setRenderer(renderer); ! domain.setAutoRange(true); domain.setLowerMargin(0.0); *************** *** 160,164 **** new Font("SansSerif",Font.BOLD, 12))); ! ChartPanel chartPanel = new ChartPanel(chart,false,true,true,false,false); //chartPanel.setPopupMenu(null); chartPanel.setOpaque(true); --- 152,156 ---- new Font("SansSerif",Font.BOLD, 12))); ! chartPanel = new ChartPanel(chart,false,true,true,false,false); //chartPanel.setPopupMenu(null); chartPanel.setOpaque(true); *************** *** 174,179 **** buildGraphControls(); ! this.controlsButton = new ControlsPopupButton(); JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); northPanel.add(this.controlsButton); northPanel.setOpaque(false); --- 166,174 ---- buildGraphControls(); ! ControlsPopupButton dataButton = new ControlsPopupButton(new GraphSeriesPanel(dataset),"images/GraphElements.gif"); ! this.controlsButton = new ControlsPopupButton(this.controlsPanel,"images/GraphSettings2.gif"); ! JPanel northPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); + northPanel.add(dataButton); northPanel.add(this.controlsButton); northPanel.setOpaque(false); *************** *** 189,196 **** * A custom JCheckBox that will popup the controls toolbox for the chart */ ! public class ControlsPopupButton extends JCheckBox { private JPopupMenu popup; ! private Icon descendingIcon = createImageIcon("images/GraphSettings.gif"); /** Returns an ImageIcon, or null if the path was invalid. */ --- 184,202 ---- * A custom JCheckBox that will popup the controls toolbox for the chart */ ! public static class ControlsPopupButton extends JCheckBox { private JPopupMenu popup; ! private Icon icon;// = createImageIcon("images/GraphSettings2.gif"); ! ! private JComponent payload; ! ! public ControlsPopupButton(JComponent payload, String img) { ! this.payload = payload; ! this.icon = createImageIcon(img); ! ! setIcon(icon); ! setOpaque(false); ! init(); ! } /** Returns an ImageIcon, or null if the path was invalid. */ *************** *** 205,220 **** } - public ControlsPopupButton() { - setIcon(descendingIcon); - setOpaque(false); - init(); - } - public void showPopup() { ! if (popup == null) { ! popup = new JPopupMenu(); ! popup.add(controlsPanel); ! } ! popup.show(controlsButton, 0, controlsButton.getHeight()); } --- 211,226 ---- } public void showPopup() { ! GlassWindow.show(this.payload, this); ! //JXGlassBox gb = new JXGlassBox(0.8f); ! // gb.add(this.payload); ! // gb.setDismissOnClick(true); ! // gb.setVisible(true); ! // gb.showOnGlassPane((Container) this.getRootPane().getGlassPane(),this.getX() - this.payload.getWidth(), this.getY() + this.getHeight()); ! // if (popup == null) { ! // popup = new JPopupMenu(); ! // popup.add(this.payload); ! // } ! // popup.show(this, 0, this.getHeight()); } *************** *** 489,504 **** } ! protected void createTimeSeries(String name, Object key) { ! TimeSeries ts = ! new TimeSeries( ! name, ! Millisecond.class); ! ts.setHistoryCount(1728000); // 48 hours at 100 seconds this.timeSeriesMap.put(key, ts); dataset.addSeries(ts); } ! protected TimeSeries getTimeSeries(Object key) { ! return (TimeSeries) this.timeSeriesMap.get(key); } --- 495,512 ---- } ! protected void createTimeSeries(String name, T key) { ! TimeSeries ts = new TimeSeries(name, Millisecond.class); ! ts.setMaximumItemAge(1000 * 60 * 60 * 48); // 48 hours this.timeSeriesMap.put(key, ts); + //ts.setKey((Comparable) key); Duh, don't do this dataset.addSeries(ts); } ! protected TimeSeries getTimeSeries(T key) { ! return this.timeSeriesMap.get(key); ! } ! ! public Set<T> getTimeSeriesKeys() { ! return this.timeSeriesMap.keySet(); } --- NEW FILE: GlassWindow.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.swing.graph; import org.jdesktop.swingx.JXGlassBox; import javax.swing.*; import javax.swing.event.MouseInputAdapter; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Graphics; import java.awt.Point; import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; /** * @author Greg Hinkle (gh...@us...), Feb 24, 2005 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class GlassWindow extends JXGlassBox { protected JPanel header; protected JPanel footer; protected JLabel title; protected JComponent contents; protected static GlassWindow INSTANCE = new GlassWindow(); protected static JComponent currentParent; private GlassWindow() { super(0.85f); initUI(); } private void initUI() { setBorder(BorderFactory.createRaisedBevelBorder()); header = new JPanel(new BorderLayout()); header.add(new JLabel("Graph Series"),BorderLayout.WEST); JButton close = new JButton("x"); close.setAction(new AbstractAction() { public void actionPerformed(ActionEvent e) { INSTANCE.setVisible(false); } }); MoveListener listener = new MoveListener(); header.addMouseListener(listener); header.addMouseMotionListener(listener); header.add(close, BorderLayout.EAST); header.setBackground(Color.gray); ResizeListener resizeListener = new ResizeListener(); footer = new JPanel(new BorderLayout()); ResizeButton b = new ResizeButton(); footer.add(b); b.addMouseListener(resizeListener); b.addMouseMotionListener(resizeListener); } public static class ResizeButton extends JPanel { public ResizeButton() { super(); setSize(8,8); } public void paint(Graphics g) { super.paint(g); // After painting our components, we're gonna draw fake resize lines g.setColor(Color.white); g.fillRect(getWidth() - 8, getHeight() - 8, 8,8); g.setColor(Color.gray); g.drawLine(getWidth() - 7, getHeight() - 1, getWidth() - 1, getHeight() - 7); g.drawLine(getWidth() - 5, getHeight() - 1, getWidth() - 1, getHeight() - 5); g.drawLine(getWidth() - 3, getHeight() - 1, getWidth() - 1, getHeight() - 3); } } public class MoveListener extends MouseInputAdapter { private Point last; public void mouseClicked(MouseEvent e) { last = e.getPoint(); } public void mouseReleased(MouseEvent e) { last = null; } public void mouseDragged(MouseEvent e) { if (last == null) { last = e.getPoint(); } else { Point p = e.getPoint(); Point newLocation = getLocation(); newLocation.translate(p.x - last.x, p.y - last.y); setLocation(newLocation); } } } public class ResizeListener extends MouseInputAdapter { private Point last; public void mouseClicked(MouseEvent e) { last = e.getPoint(); } public void mouseReleased(MouseEvent e) { last = null; } public void mouseDragged(MouseEvent e) { if (last == null) { last = e.getPoint(); } else { Point p = e.getPoint(); setSize(getWidth() + p.x - last.x, getHeight() + p.y - last.y); last = e.getPoint(); } } } public void setContents(JComponent contents) { removeAll(); setLayout(new BorderLayout()); add(header, BorderLayout.NORTH); add(contents, BorderLayout.CENTER); add(footer, BorderLayout.SOUTH); } public static void show(JComponent contents, JComponent parent) { Container glass = (Container) parent.getRootPane().getGlassPane(); INSTANCE.setContents(contents); INSTANCE.setVisible(true); INSTANCE.showOnGlassPane(glass,parent,0,0,1); } } |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:51
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/swing Modified Files: Tag: ems_module_separation SectionHolder.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: SectionHolder.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/SectionHolder.java,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** SectionHolder.java 13 Oct 2004 05:03:28 -0000 1.9 --- SectionHolder.java 12 Apr 2006 17:28:39 -0000 1.9.2.1 *************** *** 1,4 **** /* ! * Copyright 2002-2004 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); --- 1,4 ---- /* ! * Copyright 2002-2005 Greg Hinkle * * Licensed under the Apache License, Version 2.0 (the "License"); *************** *** 14,195 **** * limitations under the License. */ - package org.mc4j.console.swing; ! import java.awt.BorderLayout; ! import java.awt.Color; ! import java.awt.Component; ! import java.awt.LayoutManager2; ! import java.awt.event.ItemEvent; ! import java.awt.event.ItemListener; ! import java.awt.event.WindowAdapter; ! import java.awt.event.WindowEvent; ! import java.net.URL; ! import javax.swing.BoxLayout; ! import javax.swing.ImageIcon; ! import javax.swing.JCheckBox; ! import javax.swing.JFrame; ! import javax.swing.JPanel; ! import javax.swing.JScrollPane; ! import javax.swing.JTable; ! import javax.swing.JTree; /** ! * @author Greg Hinkle (gh...@us...), September 2002 * @version $Revision$($Author$ / $Date$) */ ! public class SectionHolder ! extends ComponentBorder ! implements ItemListener { ! ! JCheckBox button; public SectionHolder() { ! this(""); ! } ! /** ! * Creates a new instance of SectionHolder ! */ ! public SectionHolder(String title) { ! super(new JCheckBox(title), Color.black, 4); ! this.button = (JCheckBox) super.getTitledComponent(); ! ! setOpaque(false); ! //this.button.setOpaque(false); ! this.button.setContentAreaFilled(false); ! this.button.setFocusPainted(false); ! ! ClassLoader ld = this.getClass().getClassLoader(); ! URL url = ld.getResource("images/ToggleOpen.gif"); ! //System.out.println("URL: " + url); ! if (url != null) { ! button.setIcon(new ImageIcon(url)); ! } ! URL url2 = ld.getResource("images/ToggleClosed.gif"); ! if (url2 != null) { ! //System.out.println("URL2: " + url2); ! button.setDisabledIcon(new ImageIcon(url2)); ! ! button.setSelectedIcon(new ImageIcon(url2)); ! } ! // button.setDisabledSelectedIcon( ! // new ImageIcon("org/mc4j/console/ToggleChanging.gif")); ! ! URL url3 = ld.getResource("images/ToggleChanging.gif"); ! if (url3 != null) { ! button.setPressedIcon(new ImageIcon(url3)); ! } ! this.button.addItemListener(this); ! } ! ! public void setTitle(String title) { ! this.button.setText(title); ! invalidate(); ! doLayout(); ! } ! ! /** ! * Invoked when an item has been selected or deselected by the user. ! * The code written for this method performs the operations ! * that need to occur when an item is selected (or deselected). ! */ ! public void itemStateChanged(ItemEvent e) { ! //System.out.println("SectionHolder had an itemevent: " + e); ! if (e.getStateChange() == ItemEvent.DESELECTED) { ! maximize(); ! } else { ! minimize(); ! } ! ! Component[] comp = getComponents(); ! for (int i = 0; i < comp.length; i++) { ! Component component = comp[i]; ! component.doLayout(); ! } ! ! try { ! LayoutManager2 parentLayout = (LayoutManager2) getParent().getLayout(); ! if (parentLayout != null) ! parentLayout.invalidateLayout(getParent()); ! ! getParent().doLayout(); ! } catch(ClassCastException cce) { ! System.out.println("No layoutmgr2"); ! } ! ! revalidate(); ! ! } ! ! public static void main(String args[]) { ! final JFrame fr = new JFrame(); ! fr.getContentPane().setBackground(Color.WHITE); ! ! JScrollPane scrollPane = new JScrollPane(); ! JPanel base = new JPanel(); ! ! scrollPane.setViewportView(base); ! fr.getContentPane().add(scrollPane); ! ! base.setOpaque(false); ! base.setLayout(new BoxLayout(base,BoxLayout.Y_AXIS)); ! ! scrollPane.getVerticalScrollBar().setUnitIncrement(10); ! ! SectionHolder a = new SectionHolder("This is section A"); ! a.setLayout(new BorderLayout()); ! a.setTitle("This is section A"); ! a.add(new JTable(new Object[][]{{"A", "B", "C"}, {"Foo", "Bar", "Baz"}, {"X", "Y", "Z"}}, new Object[]{"First", "Second", "Third"}), BorderLayout.CENTER); ! base.add(a); ! ! for (int i = 0; i < 10;i++) { ! SectionHolder b = new SectionHolder(); ! b.setTitle("This is section B - " + i); ! b.add(new JTable(new Object[][]{{"A", "B", "C"}, {"Foo", "Bar", "Baz"}, {"X", "Y", "Z"}}, new Object[]{"First", "Second", "Third"})); ! base.add(b); ! } ! ! for (int i = 11; i < 20; i++) { ! SectionHolder h = new SectionHolder("Section Holder #: " + i); ! h.add(new JTree()); ! base.add(h); ! } ! ! ! /* ! System.out.println("Plain table"); ! JTable t = new JTable(new Object[][]{{"A", "B", "C"}, {"Foo", "Bar", "Baz"}, {"X", "Y", "Z"}}, new Object[]{"First", "Second", "Third"}); ! System.out.println("min: " + t.getMinimumSize()); ! System.out.println("pref: " + t.getPreferredSize()); ! System.out.println("max: " + t.getMaximumSize()); ! ! System.out.println("Table in a JPanel"); ! JPanel temp = new JPanel(); ! temp.add(t); ! System.out.println("min: " + temp.getMinimumSize()); ! System.out.println("pref: " + temp.getPreferredSize()); ! System.out.println("max: " + temp.getComponent(0).getMaximumSize()); ! ! */ ! ! //fr.getContentPane().add(Box.createVerticalGlue()); ! ! //SpringUtilities.makeCompactGrid(fr.getContentPane(), 2, 1, 10, 10, 3, 3); ! ! fr.getContentPane().doLayout(); ! ! fr.pack(); ! fr.setVisible(true); ! fr.addWindowListener(new WindowAdapter() { ! public void windowClosing(WindowEvent e) { ! System.exit(0); ! } ! public void windowActivated(WindowEvent e) { ! fr.getContentPane().invalidate(); ! fr.getContentPane().doLayout(); ! } ! }); } } --- 14,34 ---- * limitations under the License. */ package org.mc4j.console.swing; ! import org.jdesktop.swingx.JXTaskPane; ! import java.awt.*; /** ! * @author Greg Hinkle (gh...@us...), Dec 27, 2005 * @version $Revision$($Author$ / $Date$) */ ! public class SectionHolder extends JXTaskPane { public SectionHolder() { ! // setMaximumSize(new Dimension(Short.MAX_VALUE,(int) ! // getMaximumSize().width)); ! setAlignmentX(Component.LEFT_ALIGNMENT); } } |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:50
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/welcome In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/welcome Modified Files: Tag: ems_module_separation WelcomeTopComponent.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: WelcomeTopComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/welcome/WelcomeTopComponent.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** WelcomeTopComponent.java 14 Oct 2004 14:55:04 -0000 1.2 --- WelcomeTopComponent.java 12 Apr 2006 17:28:39 -0000 1.2.2.1 *************** *** 181,187 **** // c = Class.forName(classname); // } catch (ClassNotFoundException e) { ! ClassLoader loader = getClassLoader(); try { ! c = Class.forName(classname, true, loader); } catch (ClassNotFoundException e1) { } // } --- 181,187 ---- // c = Class.forName(classname); // } catch (ClassNotFoundException e) { ! // ClassLoader loader = getClassLoader(); try { ! c = Class.forName(classname); } catch (ClassNotFoundException e1) { } // } *************** *** 213,217 **** File extrasFile = InstalledFileLocator.getDefault().locate("mc4jlib/mc4j_common.jar","org.mc4j.console",false); ! if (!extrasFile.exists()) { ErrorManager.getDefault().notify( new RuntimeException("Unable to locate mc4j_common.jar in the mc4jlib folder") --- 213,217 ---- File extrasFile = InstalledFileLocator.getDefault().locate("mc4jlib/mc4j_common.jar","org.mc4j.console",false); ! if (extrasFile != null && !extrasFile.exists()) { ErrorManager.getDefault().notify( new RuntimeException("Unable to locate mc4j_common.jar in the mc4jlib folder") |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:50
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/global In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/dashboard/global Modified Files: Tag: ems_module_separation GlobalDashboardNode.java OpenDashboardAction.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: OpenDashboardAction.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/global/OpenDashboardAction.java,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** OpenDashboardAction.java 5 Oct 2004 05:16:00 -0000 1.9 --- OpenDashboardAction.java 12 Apr 2006 17:28:38 -0000 1.9.2.1 *************** *** 17,37 **** package org.mc4j.console.dashboard.global; ! import java.util.Map; ! ! import javax.swing.JComponent; ! import javax.swing.SwingUtilities; ! ! import org.openide.ErrorManager; import org.openide.nodes.Node; import org.openide.util.HelpCtx; import org.openide.util.actions.NodeAction; - import org.openide.windows.TopComponent; - - import org.mc4j.console.dashboard.Dashboard; - import org.mc4j.console.dashboard.DashboardFactory; - import org.mc4j.console.dashboard.DashboardTopComponent; /** ! * * * @author Greg Hinkle (gh...@us...), May 2003 --- 17,29 ---- package org.mc4j.console.dashboard.global; ! import org.mc4j.console.dashboard.Dashboard; ! import org.mc4j.console.dashboard.DashboardTopComponent; ! import org.mc4j.ems.connection.support.ConnectionListener; import org.openide.nodes.Node; import org.openide.util.HelpCtx; import org.openide.util.actions.NodeAction; /** ! * Opens global dashboards * * @author Greg Hinkle (gh...@us...), May 2003 *************** *** 43,69 **** final GlobalDashboardNode node = (GlobalDashboardNode) nodes[0]; ! Map context = node.getDashboard().getContextStarter(); ! context.put(Dashboard.CONTEXT_MBEAN_SERVER, node.getConnectionNode().getMBeanServer()); ! ! DashboardFactory factory = new DashboardFactory(); ! try { ! JComponent component = factory.buildDashboard(node.getDashboard(), context); ! final TopComponent tc = new DashboardTopComponent(component, node.getDashboard().getName()); ! SwingUtilities.invokeLater(new Runnable() { ! public void run() { ! tc.setActivatedNodes(new Node[] { node }); ! tc.setDisplayName(node.getDashboard().getName()); ! tc.open(); ! tc.requestActive(); ! } ! }); ! node.getConnectionNode().registerDashboard(tc); ! } catch (Exception e) { ! ErrorManager.getDefault().notify(e); ! } } --- 35,58 ---- final GlobalDashboardNode node = (GlobalDashboardNode) nodes[0]; + Dashboard dashboard = node.getDashboard(); + final DashboardTopComponent tc = new DashboardTopComponent(dashboard, dashboard.getName()); + tc.launch(); ! // TODO: Need to figure out where we want to track open dashboards now... ! // probably against the EmsConnection ! node.getConnectionNode().getEmsConnection().getConnectionProvider().addConnectionListener(new ConnectionListener() { ! public void connect() { ! } ! public void disconnect() { ! tc.close(); ! } ! public void connectionFailure() { ! // TODO: Some sort of glasspane level info? ! } ! }); ! node.getConnectionNode().registerDashboard(tc); } *************** *** 83,88 **** - - public String getName() { return "Open..."; // NOI18N --- 72,75 ---- Index: GlobalDashboardNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/global/GlobalDashboardNode.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** GlobalDashboardNode.java 5 Oct 2004 05:16:00 -0000 1.6 --- GlobalDashboardNode.java 12 Apr 2006 17:28:38 -0000 1.6.2.1 *************** *** 17,24 **** package org.mc4j.console.dashboard.global; ! import java.util.List; ! ! import javax.swing.Action; ! import org.openide.cookies.PrintCookie; import org.openide.nodes.AbstractNode; --- 17,23 ---- package org.mc4j.console.dashboard.global; ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.connection.ConnectionNode; ! import org.mc4j.console.dashboard.Dashboard; import org.openide.cookies.PrintCookie; import org.openide.nodes.AbstractNode; *************** *** 29,35 **** import org.openide.windows.IOProvider; ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.connection.ConnectionNode; ! import org.mc4j.console.dashboard.Dashboard; --- 28,33 ---- import org.openide.windows.IOProvider; ! import javax.swing.*; ! import java.util.List; *************** *** 63,68 **** setShortDescription(dashboard.getDescription()); - - } --- 61,64 ---- *************** *** 80,84 **** setDisplayName(dashboard.getName()); ! setShortDescription("Dashboard on " + mbeanNode.getObjectName().getCanonicalName()); getCookieSet().add(new PrintCookie() { --- 76,80 ---- setDisplayName(dashboard.getName()); ! setShortDescription("Dashboard on " + mbeanNode.getEmsBean().getBeanName().getCanonicalName()); getCookieSet().add(new PrintCookie() { |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:50
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/jre15/components In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/jre15/components Modified Files: Tag: ems_module_separation DeadlockDetectionComponent.java MemoryUsageAreaChartComponent.java MemoryUsageComponent.java MemoryUsageLineChartComponent.java MemoryUsagePieChartComponent.java ThreadMBeanThreadBrowserComponent.java Added Files: Tag: ems_module_separation ThreadsViewComponent.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: ThreadMBeanThreadBrowserComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/jre15/components/ThreadMBeanThreadBrowserComponent.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** ThreadMBeanThreadBrowserComponent.java 5 Oct 2004 05:16:19 -0000 1.4 --- ThreadMBeanThreadBrowserComponent.java 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 17,50 **** package org.mc4j.jre15.components; import org.openide.ErrorManager; - import org.mc4j.console.dashboard.Dashboard; - import org.mc4j.console.dashboard.DashboardComponent; - - import java.awt.BorderLayout; - import java.awt.Component; - import java.lang.management.ManagementFactory; - import java.lang.management.ThreadInfo; - import java.lang.management.ThreadMXBean; - import java.util.Arrays; - import java.util.HashMap; - import java.util.HashSet; - import java.util.Iterator; - import java.util.Map; - import java.util.Set; - import javax.management.MBeanServer; ! import javax.management.MBeanServerInvocationHandler; ! import javax.management.MalformedObjectNameException; ! import javax.management.ObjectName; ! import javax.management.openmbean.CompositeData; ! import javax.swing.Icon; ! import javax.swing.ImageIcon; ! import javax.swing.JPanel; ! import javax.swing.JScrollPane; ! import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; /** --- 17,33 ---- package org.mc4j.jre15.components; + import org.mc4j.console.dashboard.components.BeanComponent; + import org.mc4j.ems.connection.bean.EmsBean; import org.openide.ErrorManager; import javax.management.MBeanServer; ! import javax.swing.*; import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.DefaultTreeModel; + import java.awt.*; + import java.lang.management.ThreadInfo; + import java.lang.management.ThreadMXBean; + import java.util.*; /** *************** *** 55,60 **** * @version $Revision$($Author$ / $Date$) */ ! public class ThreadMBeanThreadBrowserComponent extends JPanel implements DashboardComponent { protected ThreadMXBean threadMBean; --- 38,44 ---- * @version $Revision$($Author$ / $Date$) */ ! public class ThreadMBeanThreadBrowserComponent extends JPanel implements BeanComponent { + protected EmsBean emsThreadBean; protected ThreadMXBean threadMBean; *************** *** 66,70 **** protected MBeanServer server; ! protected Map threadMap; public ThreadMBeanThreadBrowserComponent() { --- 50,54 ---- protected MBeanServer server; ! protected Map<Long, DefaultMutableTreeNode> threadMap; public ThreadMBeanThreadBrowserComponent() { *************** *** 92,127 **** } ! public void setContext(Map context) { ! MBeanServer mBeanServer = (MBeanServer) context.get(Dashboard.CONTEXT_MBEAN_SERVER); ! this.server = mBeanServer; ! try { ! ! this.threadMBean = (ThreadMXBean) ! MBeanServerInvocationHandler.newProxyInstance( ! mBeanServer, ! new ObjectName(ManagementFactory.THREAD_MXBEAN_NAME), ! ThreadMXBean.class, ! false); ! ! } catch (MalformedObjectNameException moe) { ! ErrorManager.getDefault().notify(moe); ! } refresh(); this.treeModel.nodeStructureChanged(root); } - public void refresh() { try { // TODO GH: the added set is not being used and right now i'm firing // update events for each insertion or removal. this is probably much // slower than firing a single event with all of the changes. ! Set deadThreadSet = new HashSet(threadMap.values()); ! Set addedSet = new HashSet(); long[] threadIds = this.threadMBean.getAllThreadIds(); --- 76,107 ---- } + public void setBean(EmsBean emsBean) { + this.emsThreadBean = emsBean; ! this.threadMBean = this.emsThreadBean.getProxy(ThreadMXBean.class); refresh(); this.treeModel.nodeStructureChanged(root); + } + public void setContext(Map context) { + + + } + + public synchronized void refresh() { + + try { // TODO GH: the added set is not being used and right now i'm firing // update events for each insertion or removal. this is probably much // slower than firing a single event with all of the changes. ! Set<DefaultMutableTreeNode> deadThreadSet = new HashSet<DefaultMutableTreeNode>(threadMap.values()); ! Set<DefaultMutableTreeNode> addedSet = new HashSet<DefaultMutableTreeNode>(); long[] threadIds = this.threadMBean.getAllThreadIds(); *************** *** 132,155 **** ! CompositeData[] compositeDatas = ! (CompositeData[]) ! this.server.invoke( ! new ObjectName(ManagementFactory.THREAD_MXBEAN_NAME), ! "getThreadInfo", ! new Object[] { threadIds, new Integer(Integer.MAX_VALUE) }, ! new String[] { threadIds.getClass().getName(), Integer.TYPE.getName() }); ! ! for (int i = 0; i < compositeDatas.length; i++) { ! ThreadInfo threadInfo = ThreadInfo.from(compositeDatas[i]); DefaultMutableTreeNode threadNode = null; ! threadNode = (DefaultMutableTreeNode) threadMap.get(new Long(threadInfo.getThreadId())); if (threadNode == null) { threadNode = new DefaultMutableTreeNode(threadInfo); root.add(threadNode); ! threadMap.put(new Long(threadInfo.getThreadId()),threadNode); addedSet.add(threadNode); this.treeModel.nodesWereInserted(root, new int[] { root.getChildCount() - 1 }); --- 112,128 ---- ! ThreadInfo[] threadInfos = ! threadMBean.getThreadInfo(threadIds,Integer.MAX_VALUE); ! for (ThreadInfo threadInfo : threadInfos) { DefaultMutableTreeNode threadNode = null; ! threadNode = (DefaultMutableTreeNode) threadMap.get(threadInfo.getThreadId()); if (threadNode == null) { threadNode = new DefaultMutableTreeNode(threadInfo); root.add(threadNode); ! threadMap.put(threadInfo.getThreadId(),threadNode); addedSet.add(threadNode); this.treeModel.nodesWereInserted(root, new int[] { root.getChildCount() - 1 }); *************** *** 161,167 **** StackTraceElement[] stackElements = threadInfo.getStackTrace(); ! for (int j = 0; j < stackElements.length; j++) { ! StackTraceElement stackElement = stackElements[j]; ! DefaultMutableTreeNode stackNode = new DefaultMutableTreeNode(stackElement); threadNode.add(stackNode); --- 134,138 ---- StackTraceElement[] stackElements = threadInfo.getStackTrace(); ! for (StackTraceElement stackElement : stackElements) { DefaultMutableTreeNode stackNode = new DefaultMutableTreeNode(stackElement); threadNode.add(stackNode); *************** *** 174,183 **** // Remove any threads we didn't remove from the dead thread set... and which are therefore now dead ! for (Iterator iterator = deadThreadSet.iterator(); iterator.hasNext();) { ! DefaultMutableTreeNode defaultMutableTreeNode = (DefaultMutableTreeNode) iterator.next(); int index = root.getIndex(defaultMutableTreeNode); root.remove(defaultMutableTreeNode); ! this.treeModel.nodesWereRemoved(root, new int[] { index }, new Object[] { defaultMutableTreeNode }); ! threadMap.remove(new Long(((ThreadInfo)defaultMutableTreeNode.getUserObject()).getThreadId())); } --- 145,153 ---- // Remove any threads we didn't remove from the dead thread set... and which are therefore now dead ! for (DefaultMutableTreeNode defaultMutableTreeNode : deadThreadSet) { int index = root.getIndex(defaultMutableTreeNode); root.remove(defaultMutableTreeNode); ! this.treeModel.nodesWereRemoved(root, new int[]{index}, new Object[]{defaultMutableTreeNode}); ! threadMap.remove(((ThreadInfo) defaultMutableTreeNode.getUserObject()).getThreadId()); } Index: MemoryUsageLineChartComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/jre15/components/MemoryUsageLineChartComponent.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** MemoryUsageLineChartComponent.java 5 Oct 2004 05:16:19 -0000 1.5 --- MemoryUsageLineChartComponent.java 12 Apr 2006 17:28:39 -0000 1.5.2.1 *************** *** 17,37 **** package org.mc4j.jre15.components; ! import org.jfree.data.DefaultPieDataset; import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; ! ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.dashboard.Dashboard; import org.mc4j.console.dashboard.components.NumericAttributeGraph; import java.lang.management.MemoryUsage; - import java.util.Iterator; import java.util.List; import java.util.Map; - import javax.management.MBeanServer; - import javax.management.ObjectName; - import javax.management.openmbean.CompositeData; - /** * You use this like an Attribute Graph Panel and it shows a --- 17,33 ---- package org.mc4j.jre15.components; ! ! import org.jfree.data.general.DefaultPieDataset; import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; ! import org.mc4j.console.dashboard.components.BeanListComponent; import org.mc4j.console.dashboard.components.NumericAttributeGraph; + import org.mc4j.ems.connection.bean.EmsBean; + import javax.management.openmbean.CompositeData; import java.lang.management.MemoryUsage; import java.util.List; import java.util.Map; /** * You use this like an Attribute Graph Panel and it shows a *************** *** 41,45 **** * @version $Revision$($Author$ / $Date$) */ ! public class MemoryUsageLineChartComponent extends NumericAttributeGraph { public static final String COMMITTED = "Committed"; --- 37,41 ---- * @version $Revision$($Author$ / $Date$) */ ! public class MemoryUsageLineChartComponent extends NumericAttributeGraph implements BeanListComponent { public static final String COMMITTED = "Committed"; *************** *** 50,66 **** protected DefaultPieDataset pieDataset; ! protected List beanList; public void addObservation() throws Exception { ! for (Iterator iterator = beanList.iterator(); iterator.hasNext();) { ! try { ! MBeanNode beanNode = (MBeanNode) iterator.next(); ! ObjectName objectName = beanNode.getObjectName(); //String name = (String) this.server.getAttribute(objectName, "Name"); - MemoryUsage usage = MemoryUsage.from((CompositeData) this.server.getAttribute(objectName, "Usage")); ! TimeSeries ts = getTimeSeries(beanNode); ts.add(new Millisecond(), usage.getUsed()); --- 46,61 ---- protected DefaultPieDataset pieDataset; ! protected List<EmsBean> beanList; public void addObservation() throws Exception { ! for (EmsBean bean : beanList) { + try { //String name = (String) this.server.getAttribute(objectName, "Name"); ! MemoryUsage usage = MemoryUsage.from((CompositeData) bean.getAttribute("Usage").refresh()); ! ! TimeSeries ts = getTimeSeries(bean); ts.add(new Millisecond(), usage.getUsed()); *************** *** 76,93 **** public void setContext(Map context) { ! List beanList = (List) context.get(Dashboard.CONTEXT_MBEAN_LIST); ! ! this.beanList = beanList; ! ! this.server = (MBeanServer) context.get(Dashboard.CONTEXT_MBEAN_SERVER); ! ! for (Iterator iterator = beanList.iterator(); iterator.hasNext();) { ! MBeanNode beanNode = (MBeanNode) iterator.next(); ! ObjectName objectName = beanNode.getObjectName(); try { ! String name = (String) this.server.getAttribute(objectName, "Name"); ! createTimeSeries(name, beanNode); } catch (Exception e) { e.printStackTrace(); --- 71,80 ---- public void setContext(Map context) { ! for (EmsBean bean : beanList) { try { ! String name = (String) bean.getAttribute("Name").getValue(); ! createTimeSeries(name, bean); } catch (Exception e) { e.printStackTrace(); *************** *** 98,100 **** --- 85,90 ---- } + public void setBeanList(List<EmsBean> beanList) { + this.beanList = beanList; + } } Index: DeadlockDetectionComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/jre15/components/DeadlockDetectionComponent.java,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** DeadlockDetectionComponent.java 5 Oct 2004 05:16:19 -0000 1.5 --- DeadlockDetectionComponent.java 12 Apr 2006 17:28:39 -0000 1.5.2.1 *************** *** 17,41 **** package org.mc4j.jre15.components; import org.openide.ErrorManager; ! import org.mc4j.console.dashboard.Dashboard; ! import org.mc4j.console.dashboard.DashboardComponent; ! ! import java.lang.management.ManagementFactory; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; ! import java.util.HashMap; ! import java.util.HashSet; ! import java.util.Iterator; ! import java.util.Map; ! import java.util.Set; ! ! import javax.management.MBeanServer; ! import javax.management.MBeanServerInvocationHandler; ! import javax.management.MalformedObjectNameException; ! import javax.management.ObjectName; ! import javax.management.openmbean.CompositeData; ! import javax.swing.BoxLayout; ! import javax.swing.JPanel; --- 17,28 ---- package org.mc4j.jre15.components; + import org.mc4j.console.dashboard.components.BeanComponent; + import org.mc4j.ems.connection.bean.EmsBean; import org.openide.ErrorManager; ! import javax.swing.*; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; ! import java.util.*; *************** *** 45,71 **** * @version $Revision$($Author$ / $Date$) */ ! public class DeadlockDetectionComponent extends JPanel implements DashboardComponent { private ThreadMXBean threadMBean; - private MBeanServer server; ! private Map deadThreads = new HashMap(); ! public void setContext(Map context) { ! MBeanServer mBeanServer = (MBeanServer) context.get(Dashboard.CONTEXT_MBEAN_SERVER); ! this.server = mBeanServer; ! try { ! this.threadMBean = (ThreadMXBean) ! MBeanServerInvocationHandler.newProxyInstance( ! mBeanServer, ! new ObjectName(ManagementFactory.THREAD_MXBEAN_NAME), ! ThreadMXBean.class, ! false); - } catch (MalformedObjectNameException moe) { - ErrorManager.getDefault().notify(moe); - } setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); --- 32,54 ---- * @version $Revision$($Author$ / $Date$) */ ! public class DeadlockDetectionComponent extends JPanel implements BeanComponent { + private EmsBean emsBean; private ThreadMXBean threadMBean; ! private Map<Long,DeadlockedThreadComponent> deadThreads = new HashMap<Long, DeadlockedThreadComponent>(); ! public void setBean(EmsBean emsBean) { ! this.emsBean = emsBean; ! this.threadMBean = this.emsBean.getProxy(ThreadMXBean.class); ! refresh(); ! ! } ! ! ! public void setContext(Map context) { setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); *************** *** 86,89 **** --- 69,73 ---- Thread t2 = new Thread(new Runnable() { + @SuppressWarnings({"InfiniteLoopStatement"}) public void run() { while(true) { *************** *** 108,113 **** try { - // TODO GH: This does not work yet! It doesn't appear to have been completed before - // the beta release of 1.5 long[] result = this.threadMBean.findMonitorDeadlockedThreads(); --- 92,95 ---- *************** *** 119,132 **** try { ThreadInfo info = ! ThreadInfo.from( ! (CompositeData) ! server.invoke( ! new ObjectName(ManagementFactory.THREAD_MXBEAN_NAME), ! "getThreadInfo", ! new Object[] { new Long(threadId), new Integer(Integer.MAX_VALUE) }, ! new String[] { Long.TYPE.getName(), Integer.TYPE.getName() })); ! if (!deadThreads.containsKey(new Long(info.getThreadId()))) { DeadlockedThreadComponent deadThread = --- 101,108 ---- try { ThreadInfo info = ! threadMBean.getThreadInfo(threadId,Integer.MAX_VALUE); ! if (!deadThreads.containsKey(info.getThreadId())) { DeadlockedThreadComponent deadThread = *************** *** 136,140 **** } ! stillDeadThreads.add(new Long(info.getThreadId())); } catch (Exception e) { --- 112,116 ---- } ! stillDeadThreads.add(info.getThreadId()); } catch (Exception e) { *************** *** 163,165 **** --- 139,142 ---- } + } Index: MemoryUsageAreaChartComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/jre15/components/MemoryUsageAreaChartComponent.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** MemoryUsageAreaChartComponent.java 5 Oct 2004 05:16:19 -0000 1.4 --- MemoryUsageAreaChartComponent.java 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 22,37 **** import org.jfree.chart.labels.XYItemLabelGenerator; import org.jfree.chart.plot.PlotOrientation; ! import org.jfree.chart.renderer.StackedXYAreaRenderer; ! import org.jfree.data.XYDataset; import org.jfree.data.time.Millisecond; import org.jfree.data.time.RegularTimePeriod; ! ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.bean.attribute.AttributeNode; ! import org.mc4j.console.dashboard.Dashboard; import org.mc4j.console.dashboard.components.BeanListComponent; import org.mc4j.console.dashboard.components.NumericAttributeGraph; ! import org.mc4j.console.swing.graph.data.BoundedTimeTableXYDataset; import java.awt.BorderLayout; import java.awt.Color; --- 22,36 ---- import org.jfree.chart.labels.XYItemLabelGenerator; import org.jfree.chart.plot.PlotOrientation; ! import org.jfree.chart.renderer.xy.StackedXYAreaRenderer; ! import org.jfree.data.xy.XYDataset; import org.jfree.data.time.Millisecond; import org.jfree.data.time.RegularTimePeriod; ! import org.jfree.data.time.TimeTableXYDataset; import org.mc4j.console.dashboard.components.BeanListComponent; import org.mc4j.console.dashboard.components.NumericAttributeGraph; ! import org.mc4j.ems.connection.bean.EmsBean; + import javax.management.openmbean.CompositeData; + import javax.swing.border.LineBorder; import java.awt.BorderLayout; import java.awt.Color; *************** *** 39,53 **** import java.text.DecimalFormat; import java.text.NumberFormat; - import java.util.ArrayList; - import java.util.Collections; - import java.util.Iterator; import java.util.List; import java.util.Map; - import javax.management.MBeanServer; - import javax.management.ObjectName; - import javax.management.openmbean.CompositeData; - import javax.swing.border.LineBorder; - /** * You use this like an Attribute Graph Panel and it shows a --- 38,44 ---- *************** *** 61,69 **** public static final String USED = "Used"; ! protected List beanList; ! ! protected List nameList = new ArrayList(); ! protected BoundedTimeTableXYDataset dataset2 = new BoundedTimeTableXYDataset(); protected RegularTimePeriod removeArray[] = new RegularTimePeriod[60]; --- 52,58 ---- public static final String USED = "Used"; ! protected List<EmsBean> beanList; ! protected TimeTableXYDataset dataset2 = new TimeTableXYDataset(); protected RegularTimePeriod removeArray[] = new RegularTimePeriod[60]; *************** *** 102,107 **** ! renderer.setBaseLabelGenerator(new XYItemLabelGenerator() { ! public String generateItemLabel(XYDataset dataset, int series, int item) { Number x = dataset.getXValue(series, item); long bytes = x.longValue(); --- 91,96 ---- ! renderer.setItemLabelGenerator(new XYItemLabelGenerator() { ! public String generateLabel(XYDataset dataset, int series, int item) { Number x = dataset.getXValue(series, item); long bytes = x.longValue(); *************** *** 153,164 **** //time = System.currentTimeMillis(); ! for (Iterator iterator = beanList.iterator(); iterator.hasNext();) { try { ! MBeanNode beanNode = (MBeanNode) iterator.next(); ! ObjectName objectName = beanNode.getObjectName(); ! ! MemoryUsage usage = MemoryUsage.from((CompositeData) this.server.getAttribute(objectName, "Usage")); ! String name = (String) ((AttributeNode)beanNode.getAttributeNodeMap().get("Name")).getValue(); dataset2.add(time, new Long(usage.getUsed()), name, false); --- 142,150 ---- //time = System.currentTimeMillis(); ! for (EmsBean bean : beanList) { try { ! MemoryUsage usage = MemoryUsage.from((CompositeData) bean.getAttribute("Usage").refresh()); ! String name = (String) bean.getAttribute("Name").getValue(); dataset2.add(time, new Long(usage.getUsed()), name, false); *************** *** 169,173 **** } ! dataset2.rebound(); chart.fireChartChanged(); --- 155,159 ---- } ! // dataset2.rebound(); chart.fireChartChanged(); *************** *** 185,208 **** - - this.server = (MBeanServer) context.get(Dashboard.CONTEXT_MBEAN_SERVER); - - ArrayList list = new ArrayList(); - Collections.reverse(beanList); - for (Iterator iterator = beanList.iterator(); iterator.hasNext();) { - MBeanNode beanNode = (MBeanNode) iterator.next(); - ObjectName objectName = beanNode.getObjectName(); - - try { - String name = (String) this.server.getAttribute(objectName, "Name"); - - this.nameList.add(name); - } catch (Exception e) { - e.printStackTrace(); - } - } - - - initGraphPanel2(); reschedule(); --- 171,174 ---- --- NEW FILE: ThreadsViewComponent.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.jre15.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.console.dashboard.DashboardComponent; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.swing.graph.GlassWindow; import org.mc4j.ems.connection.bean.EmsBean; import javax.swing.*; import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Component; import java.awt.Dimension; import java.awt.Graphics; import java.lang.management.ThreadInfo; import java.lang.management.ThreadMXBean; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; import java.util.HashSet; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Apr 3, 2006 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:39 $) */ public class ThreadsViewComponent extends JPanel implements DashboardComponent, BeanComponent { EmsBean emsThreadBean; ThreadMXBean threadBean; JXTable table; ThreadsTableModel model; private static final int TIME_HISTORY = 100 * 1000; public void setContext(Map context) { model = new ThreadsTableModel(threadBean); table = new JXTable(model); table.setColumnControlVisible(true); table.setHighlighters(new HighlighterPipeline(new Highlighter[]{new AlternateRowHighlighter()})); table.getColumnExt(2).setCellRenderer(new ThreadStateCellRenderer()); table.getColumnExt(3).setCellRenderer(new ThreadDataGraphRenderer()); table.getColumnExt(5).setCellRenderer(new PercentageCellRenderer()); setLayout(new BorderLayout()); add(new JScrollPane(table), BorderLayout.CENTER); table.getColumnExt(0).setPreferredWidth(35); // Id table.getColumnExt(1).setPreferredWidth(180); // Name table.getColumnExt(2).setPreferredWidth(35); // State table.getColumnExt(3).setMinWidth(200); table.getColumnExt(3).setPreferredWidth(350); table.getColumnExt(4).setVisible(false); // CPU Total table.getColumnExt(6).setVisible(false); // User CPU Total table.getColumnExt(7).setVisible(false); // Blocks Total table.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { ThreadsTableModel.ThreadData d = model.getData(e.getFirstIndex()); JTextPane textPane = new JTextPane(); StringBuilder b = new StringBuilder(); ThreadInfo ti = threadBean.getThreadInfo(d.getLastData().getThreadId(), Integer.MAX_VALUE); if (ti != null) { for (StackTraceElement el : ti.getStackTrace()) { b.append(el); b.append("\n"); } textPane.setEditable(false); textPane.setText(b.toString()); textPane.setPreferredSize(new Dimension(500,600)); GlassWindow.show(new JScrollPane(textPane),ThreadsViewComponent.this); } } }); } public void refresh() { model.refresh(); model.fireTableDataChanged(); } public void setBean(EmsBean emsBean) { this.emsThreadBean = emsBean; threadBean = emsBean.getProxy(ThreadMXBean.class); // TODO: This is a little nasty, what if someone connects to a production system? this.threadBean.setThreadContentionMonitoringEnabled(true); this.threadBean.setThreadCpuTimeEnabled(true); } public static class ThreadDataGraphRenderer extends DefaultTableCellRenderer { ThreadsTableModel.ThreadData data; private static final Color blocked = new Color(205, 92, 92); private static final Color neww = new Color(135, 206, 250); private static final Color runnable = new Color(144, 238, 144); private static final Color terminated = new Color(112, 128, 244); private static final Color timed_waiting = new Color(240, 128, 128); private static final Color waiting = new Color(255, 239, 213); public ThreadDataGraphRenderer() { setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { data = (ThreadsTableModel.ThreadData) value; return this; } protected void paintComponent(Graphics g) { LinkedList<ThreadsTableModel.ThreadData.ThreadStatePoint> list = data.getStatePoints(); g.setColor(getBackground()); g.fillRect(0,0, getWidth(), getHeight()); Color c = null; long now = System.currentTimeMillis(); long then = now - TIME_HISTORY; double last = 0d; for (ThreadsTableModel.ThreadData.ThreadStatePoint point : list) { switch (point.getState()) { case BLOCKED: c = blocked; break; case NEW: c = neww; break; case RUNNABLE: c = runnable; break; case TERMINATED: c = terminated; break; case TIMED_WAITING: c = timed_waiting; break; case WAITING: c = waiting; break; } g.setColor(c); int width = getWidth() - 4; int height = getHeight() - 4; double d = width * ((double) (point.getTime() - then) / TIME_HISTORY) + 2; if (last == 0) last = width * ((double) (point.getTime() - then - 1000) / TIME_HISTORY) + 2; g.fillRect(((int) (last)) + 1, 2, (int) d, height); last = d; } } } public static class PercentageCellRenderer extends DefaultTableCellRenderer { static NumberFormat f; static { f = DecimalFormat.getPercentInstance(); f.setMaximumFractionDigits(2); } public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { return super.getTableCellRendererComponent(table, f.format(value), isSelected, hasFocus, row, column); } } public static class ThreadStateCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Icon icon = null; if (value instanceof Thread.State) { switch ((Thread.State)value) { case BLOCKED: icon = threadBlockedIcon; break; case NEW: icon = threadIcon; break; case RUNNABLE: icon = threadRunningIcon; break; case TERMINATED: icon = threadTerminatedIcon; break; case TIMED_WAITING: icon = threadWaitingIcon; break; case WAITING: icon = threadWaitingIcon; break; } } else { icon = threadIcon; } setHorizontalAlignment(CENTER); setIcon(icon); return this; } private static Icon threadIcon = createImageIcon("images/Thread.gif"); private static Icon threadRunningIcon = createImageIcon("images/ThreadRunning.gif"); private static Icon threadWaitingIcon = createImageIcon("images/ThreadWaiting.gif"); private static Icon threadBlockedIcon = createImageIcon("images/ThreadBlocked.gif"); private static Icon threadTerminatedIcon = createImageIcon("images/ThreadTerminated.gif"); private static Icon stackElementIcon = createImageIcon("images/StackElement.gif"); /** * Returns an ImageIcon, or null if the path was invalid. */ protected static ImageIcon createImageIcon(String path) { java.net.URL imgURL = ThreadMBeanThreadBrowserComponent.class.getClassLoader().getResource(path); if (imgURL != null) { return new ImageIcon(imgURL); } else { System.err.println("Couldn't find file: " + path); return null; } } } public static class ThreadsTableModel extends AbstractTableModel { private static final String[] COLUMNS = new String[]{ "Id", "Name", "State", "History", "CPU Total","CPU %", "User Total", "Blocks", "Block Time", "Lock" }; ThreadMXBean threadBean; LinkedHashMap<Long, ThreadData> data = new LinkedHashMap<Long, ThreadData>(); List<Long> threadList = new ArrayList<Long>(); long lastTotalCpu; long currentTotalCpu; public ThreadsTableModel(ThreadMXBean threadBean) { this.threadBean = threadBean; } public synchronized void refresh() { // Refresh all at once so we don't get weird array out of bounds stuff or something like that // Threads never disappear from this list, that'd be confusing, but their data would obviously stop updating long[] threadIds = threadBean.getAllThreadIds(); ThreadInfo[] threadInfos = threadBean.getThreadInfo(threadIds); HashSet<Long> deadCheck = new HashSet<Long>(threadList); currentTotalCpu = 0L; for (ThreadInfo thread : threadInfos) { ThreadData d; if (!data.containsKey(thread.getThreadId())) { threadList.add(thread.getThreadId()); d = new ThreadData(); data.put(thread.getThreadId(), d); } else { d = data.get(thread.getThreadId()); } d.update(thread); long cpu = threadBean.getThreadCpuTime(thread.getThreadId()); d.setCpuTimeForInterval(cpu - d.getCpuTime()); // subtract last recorded cpu time d.setCpuTime(cpu); currentTotalCpu += d.getCpuTimeForInterval(); d.setUserTime(threadBean.getThreadUserTime(thread.getThreadId())); deadCheck.remove(thread.getThreadId()); } for (Long deadId : deadCheck) { data.get(deadId).setDead(true); } } public int getRowCount() { return threadList.size(); } public int getColumnCount() { return COLUMNS.length; } public String getColumnName(int column) { return COLUMNS[column]; } public ThreadData getData(int row) { return data.get(threadList.get(row)); } public synchronized Object getValueAt(int rowIndex, int columnIndex) { ThreadData d = data.get(threadList.get(rowIndex)); switch (columnIndex) { case 0: return d.getLastData().getThreadId(); case 1: return d.getLastData().getThreadName(); case 2: return (d.isDead()) ? "Dead" : d.getLastData().getThreadState(); case 3: return d; case 4: return d.getCpuTime(); case 5: return (double) d.getCpuTimeForInterval() / currentTotalCpu; case 6: return d.getUserTime(); case 7: return d.getLastData().getBlockedCount(); case 8: return d.getLastData().getBlockedTime(); case 9: return d.getLastData().getLockName(); } return null; } public static class ThreadData { boolean dead = false; ThreadInfo lastData; LinkedList<ThreadStatePoint> statePoints = new LinkedList<ThreadStatePoint>(); long cpuTimeForInterval; long cpuTime; long userTime; public void update(ThreadInfo info) { lastData = info; long oldest = System.currentTimeMillis() - TIME_HISTORY; while (statePoints.size() > 0 && statePoints.getFirst().getTime() < oldest) { statePoints.removeFirst(); } statePoints.add(new ThreadStatePoint(info.getThreadState())); } public long getCpuTimeForInterval() { return cpuTimeForInterval; } public void setCpuTimeForInterval(long cpuTimeForInterval) { this.cpuTimeForInterval = cpuTimeForInterval; } public long getCpuTime() { return cpuTime; } public void setCpuTime(long cpuTime) { this.cpuTime = cpuTime; } public long getUserTime() { return userTime; } public void setUserTime(long userTime) { this.userTime = userTime; } public ThreadInfo getLastData() { return lastData; } public LinkedList<ThreadStatePoint> getStatePoints() { return statePoints; } public boolean isDead() { return dead; } public void setDead(boolean dead) { this.dead = dead; } public static class ThreadStatePoint { private long time; private Thread.State state; public ThreadStatePoint(Thread.State state) { this.time = System.currentTimeMillis(); this.state = state; } public long getTime() { return time; } public Thread.State getState() { return state; } } } } } Index: MemoryUsageComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/jre15/components/MemoryUsageComponent.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** MemoryUsageComponent.java 5 Oct 2004 05:16:19 -0000 1.3 --- MemoryUsageComponent.java 12 Apr 2006 17:28:39 -0000 1.3.2.1 *************** *** 19,29 **** import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; - import org.mc4j.console.dashboard.components.NumericAttributeGraph; - import java.lang.management.MemoryUsage; - - import javax.management.MBeanAttributeInfo; import javax.management.openmbean.CompositeData; /** --- 19,26 ---- import org.jfree.data.time.Millisecond; import org.jfree.data.time.TimeSeries; import org.mc4j.console.dashboard.components.NumericAttributeGraph; import javax.management.openmbean.CompositeData; + import java.lang.management.MemoryUsage; /** *************** *** 55,63 **** ! for (int i = 0; i < attributeInfo.length; i++) { ! MBeanAttributeInfo info = attributeInfo[i]; ! ! String attributeName = info.getName(); ! Object value = this.server.getAttribute(this.objectName, attributeName); MemoryUsage usage = MemoryUsage.from((CompositeData) value); --- 52,57 ---- ! for (String attributeName : attributeSet) { ! Object value = this.emsBean.getAttribute(attributeName).refresh(); MemoryUsage usage = MemoryUsage.from((CompositeData) value); Index: MemoryUsagePieChartComponent.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/jre15/components/MemoryUsagePieChartComponent.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** MemoryUsagePieChartComponent.java 5 Oct 2004 05:16:19 -0000 1.4 --- MemoryUsagePieChartComponent.java 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 23,47 **** import org.jfree.chart.entity.ChartEntity; import org.jfree.chart.entity.PieSectionEntity; ! import org.jfree.chart.labels.StandardPieItemLabelGenerator; import org.jfree.chart.plot.PiePlot; ! import org.jfree.data.DefaultPieDataset; ! ! import org.openide.windows.IOProvider; ! ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.dashboard.Dashboard; import org.mc4j.console.dashboard.components.NumericAttributeGraph; ! import org.mc4j.console.install.ExplorerUtil; import java.awt.BorderLayout; import java.lang.management.MemoryUsage; - import java.util.Iterator; import java.util.List; import java.util.Map; - import javax.management.MBeanServer; - import javax.management.ObjectName; - import javax.management.openmbean.CompositeData; - /** * You use this like an Attribute Graph Panel and it shows a --- 23,40 ---- import org.jfree.chart.entity.ChartEntity; import org.jfree.chart.entity.PieSectionEntity; ! import org.jfree.chart.labels.StandardPieSectionLabelGenerator; import org.jfree.chart.plot.PiePlot; ! import org.jfree.data.general.DefaultPieDataset; ! import org.mc4j.console.dashboard.components.BeanListComponent; import org.mc4j.console.dashboard.components.NumericAttributeGraph; ! import org.mc4j.ems.connection.bean.EmsBean; ! import org.openide.windows.IOProvider; + import javax.management.openmbean.CompositeData; import java.awt.BorderLayout; import java.lang.management.MemoryUsage; import java.util.List; import java.util.Map; /** * You use this like an Attribute Graph Panel and it shows a *************** *** 51,55 **** * @version $Revision$($Author$ / $Date$) */ ! public class MemoryUsagePieChartComponent extends NumericAttributeGraph { public static final String COMMITTED = "Committed"; --- 44,48 ---- * @version $Revision$($Author$ / $Date$) */ ! public class MemoryUsagePieChartComponent extends NumericAttributeGraph implements BeanListComponent { public static final String COMMITTED = "Committed"; *************** *** 60,64 **** protected DefaultPieDataset pieDataset; ! protected List beanList; protected void initGraphPanel() { --- 53,57 ---- protected DefaultPieDataset pieDataset; ! protected List<EmsBean> beanList; protected void initGraphPanel() { *************** *** 66,70 **** pieDataset = new DefaultPieDataset(); ! this.chart = ChartFactory.createPieChart( "JVM Memory Pool Usage", // chart title pieDataset, // data --- 59,63 ---- pieDataset = new DefaultPieDataset(); ! this.chart = ChartFactory.createPieChart3D( "JVM Memory Pool Usage", // chart title pieDataset, // data *************** *** 73,76 **** --- 66,70 ---- false ); + // set the background color for the chart... *************** *** 78,82 **** PiePlot plot = (PiePlot) chart.getPlot(); ! plot.setLabelGenerator(new StandardPieItemLabelGenerator()); //StandardPieItemLabelGenerator spilg = new StandardPieItemLabelGenerator(); --- 72,76 ---- PiePlot plot = (PiePlot) chart.getPlot(); ! plot.setLabelGenerator(new StandardPieSectionLabelGenerator()); //StandardPieItemLabelGenerator spilg = new StandardPieItemLabelGenerator(); *************** *** 97,111 **** IOProvider.getDefault().getStdOut().println("Browsing to: " + pieSection.getSectionKey()); ! for (Iterator iterator = beanList.iterator(); iterator.hasNext();) { try { ! MBeanNode beanNode = (MBeanNode) iterator.next(); ! ! ObjectName objectName = beanNode.getObjectName(); ! ! // TODO GH: Don't need to get this from the server every time ! String name = (String) MemoryUsagePieChartComponent.this.server.getAttribute(objectName, "Name"); if (pieSection.getSectionKey().equals(name)) { ! ExplorerUtil.browseTo(beanNode); } } catch(Exception e) { --- 91,101 ---- IOProvider.getDefault().getStdOut().println("Browsing to: " + pieSection.getSectionKey()); ! for (EmsBean bean : beanList) { try { ! String name = (String) bean.getAttribute("Name").getValue(); if (pieSection.getSectionKey().equals(name)) { ! // TODO: How to do this now? ! //ExplorerUtil.browseTo(beanNode); } } catch(Exception e) { *************** *** 133,150 **** ! for (Iterator iterator = beanList.iterator(); iterator.hasNext();) { try { - MBeanNode beanNode = (MBeanNode) iterator.next(); - ObjectName objectName = beanNode.getObjectName(); // TODO GH: Don't need to get this from the server every time ! String name = (String) this.server.getAttribute(objectName, "Name"); - Object object = this.server.getAttribute(objectName, "Usage"); - MemoryUsage usage = MemoryUsage.from((CompositeData) object); ! // Old support for beta 1 ! //usage = (MemoryUsage) this.server.getAttribute(objectName, "Usage"); pieDataset.setValue(name, usage.getUsed()); --- 123,137 ---- ! for (EmsBean bean : beanList) { try { // TODO GH: Don't need to get this from the server every time ! String name = (String) bean.getAttribute("Name").getValue(); ! Object object = bean.getAttribute("Usage").refresh(); ! ! MemoryUsage usage = MemoryUsage.from((CompositeData) object); pieDataset.setValue(name, usage.getUsed()); *************** *** 165,174 **** } ! public void setContext(Map context) { ! List beanList = (List) context.get(Dashboard.CONTEXT_MBEAN_LIST); ! this.beanList = beanList; ! this.server = (MBeanServer) context.get(Dashboard.CONTEXT_MBEAN_SERVER); reschedule(); --- 152,160 ---- } ! public void setBeanList(List<EmsBean> beanList) { this.beanList = beanList; + } ! public void setContext(Map context) { reschedule(); |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:50
|
Update of /cvsroot/mc4j/mc4j In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793 Modified Files: Tag: ems_module_separation .cvsignore MC4JProject.ipr MC4JProject.iws Readme.txt ant.developer.properties build.xml Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: .cvsignore =================================================================== RCS file: /cvsroot/mc4j/mc4j/.cvsignore,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** .cvsignore 10 Nov 2004 15:50:09 -0000 1.1 --- .cvsignore 12 Apr 2006 17:28:39 -0000 1.1.2.1 *************** *** 1,2 **** .nbintdb ! Thumbs.db \ No newline at end of file --- 1,4 ---- .nbintdb ! Thumbs.db ! .nbattrs ! .DS_Store Index: build.xml =================================================================== RCS file: /cvsroot/mc4j/mc4j/build.xml,v retrieving revision 1.40 retrieving revision 1.40.2.1 diff -C2 -d -r1.40 -r1.40.2.1 *** build.xml 14 Mar 2005 15:09:00 -0000 1.40 --- build.xml 12 Apr 2006 17:28:39 -0000 1.40.2.1 *************** *** 44,47 **** --- 44,49 ---- <property name="module.jar" value="org-mc4j-console.jar"/> + <property name="platform.dir" value="platform6"/> + <property name="application.install" value="build/mc4j"/> *************** *** 49,53 **** name="init" description="Initializes the MC4J build system."> ! <echo message="MC4J Build Environment - Try [ant -projecthelp] for more info."/> --- 51,55 ---- name="init" description="Initializes the MC4J build system."> ! <echo message="MC4J Build Environment - Try [ant -projecthelp] for more info."/> *************** *** 56,74 **** <!-- Make sure we have all the directories we need to run a build. --> <mkdir dir="classes"/> ! <path id="classpath.compile"> <!-- When reasonable, replace these with specific paths --> <!-- to openide*.jar and whatever else you need. --> - <pathelement path="${application.install}/lib/openide.jar"/> - <pathelement path="${application.install}/lib/openide-loaders.jar"/> - <pathelement path="${application.install}/lib/ext/regexp*.jar"/> - <pathelement path="${application.install}/modules/autoload/openide-io.jar"/> ! <fileset dir="${application.install}/core"> ! <include name="*.jar"/> </fileset> ! <fileset dir="${application.install}/modules"> ! <include name="*.jar"/> </fileset> --- 58,80 ---- <!-- Make sure we have all the directories we need to run a build. --> <mkdir dir="classes"/> ! <path id="classpath.compile"> <!-- When reasonable, replace these with specific paths --> <!-- to openide*.jar and whatever else you need. --> ! <pathelement path="modules/ems/dist/org-mc4j-ems.jar"/> ! ! <fileset dir="${application.install}/${platform.dir}/core"> ! <include name="**/*.jar"/> </fileset> ! ! <fileset dir="${application.install}/${platform.dir}/lib"> ! <include name="**/*.jar"/> ! </fileset> ! ! ! <fileset dir="${application.install}/${platform.dir}/modules"> ! <include name="**/*.jar"/> </fileset> *************** *** 89,106 **** <available classpathref="classpath.compile" ! classname="org.openide.DialogDisplayer" property="installed.netbeans"/> ! ! <condition property="compile.target" value="jsr14" > <isset property="jre15Available"/> </condition> <condition property="compile.target" value="1.4"> ! <not><isset property="jre15Available"/></not> </condition> <condition property="compile.source" value="1.4"> ! <not><isset property="jre15Available"/></not> </condition> <condition property="compile.source" value="1.5"> --- 95,115 ---- <available classpathref="classpath.compile" ! classname="org.openide.DialogDisplayer" property="installed.netbeans"/> ! <condition property="compile.target" value="jsr14"> <isset property="jre15Available"/> </condition> <condition property="compile.target" value="1.4"> ! <not> ! <isset property="jre15Available"/> ! </not> </condition> <condition property="compile.source" value="1.4"> ! <not> ! <isset property="jre15Available"/> ! </not> </condition> <condition property="compile.source" value="1.5"> *************** *** 114,125 **** unless="installed.netbeans" message="Could not locate the NetBeans platform in the classpath. Make sure to follow the build instructions at http://mc4j.sourceforge.net/Building.html"/> ! </target> ! <target name="compile" depends="init" description="Compiles the MC4J, generic codebase."> <javac srcdir="src" destdir="classes" debug="true" source="${compile.source}" target="${compile.target}"> <exclude name="**/carbon/**"/> <exclude name="org/mc4j/jre15/**" unless="jre15Available"/> --- 123,135 ---- unless="installed.netbeans" message="Could not locate the NetBeans platform in the classpath. Make sure to follow the build instructions at http://mc4j.sourceforge.net/Building.html"/> ! </target> ! <target name="compile" depends="init, build-modules" description="Compiles the MC4J, generic codebase."> <javac srcdir="src" destdir="classes" debug="true" source="${compile.source}" target="${compile.target}"> + <exclude name="**/carbon/**"/> <exclude name="org/mc4j/jre15/**" unless="jre15Available"/> *************** *** 133,137 **** </target> ! <target name="jars" depends="compile" description="Builds the MC4J Module JAR Files" > --- 143,147 ---- </target> ! <target name="jars" depends="compile" description="Builds the MC4J Module JAR Files"> *************** *** 139,196 **** <fileset dir="."> <include name="${module.jar}"/> - <include name="mc4j_common.jar"/> </fileset> </delete> ! ! <jar jarfile="${module.jar}" manifest="dist/module_manifest.mf" update="true" compress="false"> <!-- OC4J support: put this into JAR for OC4J ApplicationClient to work--> <fileset dir="src/etc" includes="**/*"/> ! <fileset dir="classes" > ! ! <include name="**/persistence/**/*.class"/> ! <include name="**/install/**/*.class"/> ! ! <include name="**/IConnectionNode.class"/> ! <include name="**/swing/*.class"/> ! <include name="**/swing/html/*.class"/> ! <include name="**/welcome/*"/> ! <include name="**/swing/animate/*.class"/> ! <include name="**/ExtendedExplorerPanel.class"/> ! <include name="**/ManagementNode*.class"/> ! <include name="**/ConnectAction*.class"/> ! ! <include name="org/mc4j/console/DisplayConnectionExplorerAction*"/> ! <include name="org/mc4j/console/CreateConnectionAction*"/> ! <include name="org/mc4j/console/ConnectionExplorer*"/> ! <include name="org/mc4j/console/install/ExplorerUtil*"/> ! ! <include name="org/mc4j/console/util/*"/> ! ! <include name="org/mc4j/console/connection/wizard/*.class"/> ! <include name="org/mc4j/console/connection/wizard/**/*.class"/> ! ! <include name="org/mc4j/console/connection/DisconnectAction*"/> ! <include name="org/mc4j/console/connection/ReconnectAction*"/> ! <include name="org/mc4j/console/connection/RefreshAction*"/> ! ! ! <!--<include name="**/mejb/**/*"/>--> ! <!--<include name="**/mejb/ShowMEJBViewAction*"/>--> ! ! ! <exclude name="org/mc4j/console/connect/*Connection.class"/> ! ! <include name="org/mc4j/console/bean/attribute/watch/MonitorTopComponent*.class"/> ! <include name="org/mc4j/console/bean/attribute/watch/MonitorExplorer*.class"/> ! <include name="org/mc4j/console/bean/attribute/watch/MonitorRootNode*.class"/> ! ! <include name="org/mc4j/console/connection/install/*"/> ! </fileset> ! <fileset dir="dist"> <include name="org/**/*"/> <include name="Windows/**/*"/> --- 149,165 ---- <fileset dir="."> <include name="${module.jar}"/> </fileset> </delete> ! <jar jarfile="${module.jar}" manifest="application/dist/module_manifest.mf" update="true" compress="false"> <!-- OC4J support: put this into JAR for OC4J ApplicationClient to work--> <fileset dir="src/etc" includes="**/*"/> ! <fileset dir="classes"> ! <include name="**/*.class"/> </fileset> ! <fileset dir="application/dist"> <include name="org/**/*"/> <include name="Windows/**/*"/> *************** *** 212,218 **** <fileset dir="application"> <include name="dashboards/*.dtd"/> </fileset> ! <zipfileset src="lib/regexp.jar"><exclude name="META-INF/MANIFEST.MF"/></zipfileset> </jar> --- 181,188 ---- <fileset dir="application"> <include name="dashboards/*.dtd"/> + <include name="dashboards/Standard*.xml"/> </fileset> ! <!--<zipfileset src="lib/regexp.jar"><exclude name="META-INF/MANIFEST.MF"/></zipfileset>--> </jar> *************** *** 221,233 **** <!-- classes only, for delegated classloaders --> ! <jar jarfile="mc4j_common.jar" update="true" compress="false"> <fileset dir="classes"/> ! </jar> </target> ! <target name="all" depends="compile, jars, brand, install, run" description="Build the module."> </target> --- 191,231 ---- <!-- classes only, for delegated classloaders --> ! <!--<jar jarfile="mc4j_common.jar" update="true" compress="false"> <fileset dir="classes"/> ! </jar>--> </target> + <!--<property name="platform-file" value="netbeans-4_1-platform.zip"/>--> + <property name="platform-file" value="netbeans-5_0-beta2-bin-platform.zip"/> ! ! <target name="get-nb-platform"> ! <mkdir dir="build"/> ! <mkdir dir="build/download"/> ! <echo message="Downloading NetBeans Platform (~4.4 MB)"/> ! <!--<get dest="build/download/${platform-file}" ! src="http://www.netbeans.org/download/4_1/fcs/200505031930/66083d474e5fdfc80a1443fb851bd9d5/${platform-file}" ! verbose="true"/>--> ! <get dest="build/download/${platform-file}" ! src="http://www.netbeans.org/download/5_0/beta2/200511141730/${platform-file}" ! verbose="true"/> ! </target> ! ! <target name="prepare-platform"> ! ! <unzip src="build/download/${platform-file}" dest="build"/> ! <rename src="build/netbeans" dest="build/mc4j"/> ! </target> ! ! <target name="clean-dist"> ! <delete dir="build/mc4j"/> ! </target> ! ! ! <target name="build" depends="compile, jars, brand, install, run" description="Build the project"/> ! ! <target name="all" depends="compile, jars, brand, install, run" description="Build the project including preparation of the nb platform."> </target> *************** *** 237,244 **** </target> ! <target name="install" description="copy the jars."> <!-- install the modules --> ! <copy todir="${application.install}\modules" overwrite="yes"> <fileset dir="."> <include name="${module.jar}"/> --- 235,247 ---- </target> ! ! <target name="build-modules" description="Build the modules MC4J is dependent on"> ! <ant antfile="build.xml" target="dist" dir="modules/ems"/> ! </target> ! ! <target name="install" depends="brand, update-dashboards" description="Create the installation of MC4J over top a platform install."> <!-- install the modules --> ! <copy todir="${application.install}/${platform.dir}/modules" overwrite="yes"> <fileset dir="."> <include name="${module.jar}"/> *************** *** 246,249 **** --- 249,262 ---- </copy> + <copy todir="${application.install}/${platform.dir}/modules/ext" overwrite="yes"> + <fileset dir="lib/common" includes="*.jar"/> + <fileset dir="modules/ems/dist" includes="*.jar"/> + </copy> + + <copy todir="${basedir}/${application.install}/${platform.dir}/lib/" overwrite="yes"> + <fileset dir="lib/boot" includes="*.jar"/> + </copy> + + <!-- <copy todir="${application.install}" overwrite="yes"> *************** *** 262,272 **** <!-- install the external class libraries --> ! <mkdir dir="${application.install}\mc4jlib"/> <copy todir="${application.install}\mc4jlib" overwrite="yes"> <fileset dir="." includes="mc4j_common.jar"/> ! <fileset dir="lib/common"> ! <include name="*.jar"/> ! </fileset> ! </copy> <!-- install the extra mx4j libraries --> --- 275,282 ---- <!-- install the external class libraries --> ! <!--<mkdir dir="${application.install}\mc4jlib"/> <copy todir="${application.install}\mc4jlib" overwrite="yes"> <fileset dir="." includes="mc4j_common.jar"/> ! </copy>--> <!-- install the extra mx4j libraries --> *************** *** 295,328 **** - <copy todir="${application.install}" flatten="no" overwrite="yes"> - <fileset dir="application"> - <include name="dashboards/**/*.xml"/> - <include name="dashboards/**/*.html"/> - <include name="dashboards/**/*.dtd"/> - </fileset> - </copy> ! <copy todir="${application.install}/config/Modules" overwrite="yes"> <fileset dir="application/config" includes="*.xml"/> </copy> <copy todir="${application.install}/bin" overwrite="yes"> ! <fileset dir="dist"> <include name="ide.policy"/> </fileset> </copy> </target> <target name="brand" description="customize the netbeans platform for mc4j"> <copy ! todir="${application.install}/lib/" overwrite="yes" ! file="application/branding/branding" /> ! <mkdir dir="${application.install}/core/patches"/> <jar ! destfile="${application.install}/core/patches/Mc4jBranding.jar" basedir="application/branding/bundle"/> </target> --- 305,346 ---- ! <copy todir="${application.install}/${platform.dir}/config/Modules" overwrite="yes"> <fileset dir="application/config" includes="*.xml"/> </copy> <copy todir="${application.install}/bin" overwrite="yes"> ! <fileset dir="application/dist"> <include name="ide.policy"/> </fileset> </copy> + <copy todir="${application.install}" overwrite="yes"> + <fileset dir="."> + <include name="Readme.txt"/> + </fileset> + </copy> </target> + <target name="update-dashboards" description="Install the dashboard files in the installation directory."> + <copy todir="${application.install}" flatten="no" overwrite="yes"> + <fileset dir="application"> + <include name="dashboards/**/*.xml"/> + <include name="dashboards/**/*.html"/> + <include name="dashboards/**/*.dtd"/> + </fileset> + </copy> + + </target> <target name="brand" description="customize the netbeans platform for mc4j"> <copy ! todir="${application.install}/${platform.dir}/lib/" overwrite="yes" ! file="application/branding/branding"/> ! <mkdir dir="${application.install}/${platform.dir}/core/patches"/> <jar ! destfile="${application.install}/${platform.dir}/core/patches/Mc4jBranding.jar" basedir="application/branding/bundle"/> </target> *************** *** 350,358 **** <exec executable="${application.install}/bin/runide.exe"/> </target> ! ! ! <target name="run" description="Directly starts MC4J with the settings as the installer would use."> ! <echo>Starting MC4J</echo> <java classname="org.netbeans.Main" --- 368,375 ---- <exec executable="${application.install}/bin/runide.exe"/> </target> ! ! <target name="run" description="Directly starts MC4J with the settings as the installer would use."> ! <echo message="Starting MC4J with home of ${basedir}/${application.install}"/> <java classname="org.netbeans.Main" *************** *** 361,365 **** <jvmarg value="-Xms24m"/> ! <jvmarg value="-Xmx96m"/> <arg value="--branding"/> --- 378,382 ---- <jvmarg value="-Xms24m"/> ! <jvmarg value="-Xmx296m"/> <arg value="--branding"/> *************** *** 372,375 **** --- 389,395 ---- --> + <!--<env key="DYLD_LIBRARY_PATH" value="/Applications/YourKit Java Profiler 5.0.1.app/bin/mac"/> + <jvmarg value="-agentlib:yjpagent"/>--> + <!-- Under 1.5 JRE's this will start up the built-in jmxremoting support --> <sysproperty key="com.sun.management.jmxremote.port" value="8999"/> *************** *** 385,389 **** <!-- Define where the persistent files live --> ! <sysproperty key="netbeans.user" value="${user.home}/.mc4j/${application.version}"/> <!-- Provide stacktraces on exceptions --> <sysproperty key="netbeans.debug.exceptions" value="true"/> --- 405,409 ---- <!-- Define where the persistent files live --> ! <!-- <sysproperty key="netbeans.user" value="${user.home}/.mc4j/${application.version}"/>--> <!-- Provide stacktraces on exceptions --> <sysproperty key="netbeans.debug.exceptions" value="true"/> *************** *** 391,400 **** <sysproperty key="netbeans.logger.console" value="true"/> <!-- Set the runtime home dir --> ! <sysproperty key="netbeans.home" value="${application.install}"/> ! <sysproperty key="netbeans.dirs" value="${application.install}"/> <classpath> ! <pathelement path="${application.install}/lib/boot.jar"/> </classpath> --- 411,423 ---- <sysproperty key="netbeans.logger.console" value="true"/> <!-- Set the runtime home dir --> ! <sysproperty key="netbeans.home" value="${basedir}/${application.install}/${platform.dir}"/> ! <sysproperty key="netbeans.dirs" value=""/> <classpath> ! <pathelement path="${basedir}/${application.install}/${platform.dir}/lib/boot.jar"/> ! <!--<fileset dir="${basedir}/${application.install}/${platform.dir}/core"> ! <include name="*.jar"/> ! </fileset>--> </classpath> *************** *** 402,416 **** </target> ! <target name="run-debug" description="Directly starts MC4J with the settings as the installer would use."> <echo>Starting MC4J with debugger</echo> - <java - classname="org.netbeans.Main" - fork="yes" - dir="${application.install}"> ! <jvmarg value="-Xms32m"/> ! <jvmarg value="-Xmx128m"/> ! <!--<jvmarg value="-XX:+UseParallelGC"/>--> ! <!--<jvmarg value="-Xincgc"/> --> <!-- Support for running a debugger --> --- 425,437 ---- </target> ! <target name="run-debug" description="Directly starts MC4J with the settings as the installer would use."> <echo>Starting MC4J with debugger</echo> ! <java classname="org.netbeans.Main" fork="yes" dir="${application.install}"> ! ! <jvmarg value="-Xms96m"/> ! <jvmarg value="-Xmx256m"/> ! ! <sysproperty key="swing.aatext" value="true"/> <!-- Support for running a debugger --> *************** *** 421,445 **** <arg value="--branding"/> <arg value="mc4j"/> <sysproperty key="com.sun.management.jmxremote.port" value="8999"/> <sysproperty key="com.sun.management.jmxremote.ssl" value="false"/> <sysproperty key="com.sun.management.jmxremote.authenticate" value="false"/> ! <!-- JProfiler --> ! <!-- ! <jvmarg value="-Xint"/> ! <jvmarg value="-Xrunjprofiler"/> ! <jvmarg value="-Xbootclasspath/a:C:/Program Files/jprofiler/bin/agent.jar"/> ! --> ! ! <!-- YourKit profiler --> ! <!-- ! <jvmarg value="-Xint"/> ! <jvmarg value="-Xbootclasspath/a:C:/tools/yjp-3.0-eap-build400/bin/yjpagent.dll"/> ! <jvmarg value="-Xrunyjpagent"/> ! --> ! --- 442,463 ---- + <!--<jvmarg value="-agentpath:/Users/ghinkle/development/tools/NetBeansIDE5.0Beta2.app/Contents/Resources/NetBeans/profiler1/lib/deployed/jdk15/mac/libprofilerinterface.jnilib=/Users/ghinkle/development/tools/NetBeansIDE5.0Beta2.app/Contents/Resources/NetBeans/profiler1/lib,5140"/>--> + + <arg value="--branding"/> <arg value="mc4j"/> + + <sysproperty key="Plastic.defaultTheme" value="DesertBlue"/> + <arg value="-ui"/> <arg value="com.jgoodies.looks.plastic.PlasticLookAndFeel"/> + <!--<arg value="-laf"/> <arg value="com.Trendy.swing.plaf.TrendyLookAndFeel"/>--> + <sysproperty key="com.sun.management.jmxremote.port" value="8999"/> <sysproperty key="com.sun.management.jmxremote.ssl" value="false"/> <sysproperty key="com.sun.management.jmxremote.authenticate" value="false"/> ! <sysproperty key="apple.laf.useScreenMenuBar" value="true"/> ! <!--<sysproperty key="apple.awt.brushMetalLook" value="true"/>--> ! <!--<sysproperty key="swing.defaultlaf" value="javax.swing.plaf.metal.MetalLookAndFeel"/>--> *************** *** 453,462 **** <sysproperty key="netbeans.logger.console" value="true"/> <!-- Set the runtime home dir --> ! <sysproperty key="netbeans.home" value="${application.install}"/> <classpath> ! <pathelement path="${application.install}/lib/boot.jar"/> </classpath> </java> --- 471,488 ---- <sysproperty key="netbeans.logger.console" value="true"/> <!-- Set the runtime home dir --> ! <sysproperty key="netbeans.home" value="${basedir}/${application.install}/${platform.dir}"/> ! <sysproperty key="netbeans.dirs" value=""/> <classpath> + <pathelement path="${basedir}/${application.install}/${platform.dir}/lib/boot.jar"/> + <pathelement path="${basedir}/${application.install}/${platform.dir}/lib/org-openide-util.jar"/> + <pathelement path="${basedir}/${application.install}/${platform.dir}/lib/org-openide-modules.jar"/> ! <!-- TODO separate out the deepjar handler and nested classloader into a separate library for the boot classpath --> ! <!--<pathelement path="${basedir}/${application.install}/${platform.dir}/modules/ext/org-mc4j-ems.jar"/>--> ! ! <pathelement path="${basedir}/${application.install}/${platform.dir}/lib/looks-1.3.1.jar"/> + <pathelement path="${basedir}/${application.install}/${platform.dir}/lib/trendyDemoAndTrial.jar"/> </classpath> </java> *************** *** 465,468 **** --- 491,495 ---- <target name="clear-userdir" description="Cleans out the entire MC4J User Dir"> <deltree dir="${user.home}/.mc4j/${application.version}"/> + <delete file="build/mc4j/ConnectionNodes.db"/> </target> *************** *** 471,479 **** <target name="build-docs" depends="init" description="Generates html documentation tree"> <!-- **** Copy needed resources **** --> ! <copy todir="docs" overwrite="yes" > <fileset dir="${doc.build.dir}"> <include name="*.css"/> </fileset> ! <fileset dir="application/dashboards"> <include name="*.dtd"/> </fileset> --- 498,506 ---- <target name="build-docs" depends="init" description="Generates html documentation tree"> <!-- **** Copy needed resources **** --> ! <copy todir="docs" overwrite="yes"> <fileset dir="${doc.build.dir}"> <include name="*.css"/> </fileset> ! <fileset dir="application/dashboards"> <include name="*.dtd"/> </fileset> *************** *** 499,504 **** includes="**/*.xml"> </style> <mkdir dir="docs/printer"/> - <!-- Top Level Static Files --> <style basedir="${doc.build.dir}" destdir="docs/printer" --- 526,531 ---- includes="**/*.xml"> </style> + <mkdir dir="docs/printer"/> <style basedir="${doc.build.dir}" destdir="docs/printer" *************** *** 507,513 **** excludes="**/build.xml,**/module.xml" includes="**/*.xml"> ! <param name="module-menu" expression="nomenu"/> </style> ! --- 534,540 ---- excludes="**/build.xml,**/module.xml" includes="**/*.xml"> ! <param name="module-menu" expression="nomenu"/> </style> ! *************** *** 543,554 **** --> </target> - - <target - name="clean-docs" - description="Removes built documentation from disk."> ! <delete dir="docs"/> ! </target> </project> --- 570,599 ---- --> </target> ! <target ! name="clean-docs" ! description="Removes built documentation from disk."> ! ! <delete dir="docs"/> ! </target> + + <taskdef resource="simiantask.properties" classpath="lib/simian-2.2.4.jar"/> + + <target name="simian"> + <simian> + <fileset dir="src" includes="**/*.java"/> + <formatter type="xml" toFile="simian-log.xml"/> + </simian> + + <style + destdir="." + extension=".html" + style="simian.xsl" + includes="simian-log.xml"> + </style> + </target> + + </project> Index: MC4JProject.iws =================================================================== RCS file: /cvsroot/mc4j/mc4j/MC4JProject.iws,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** MC4JProject.iws 5 Oct 2004 05:17:17 -0000 1.4 --- MC4JProject.iws 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 3,7 **** <component name="AspectsView" /> <component name="BookmarkManager"> ! <editor_bookmark url="file://$PROJECT_DIR$/src/org/mc4j/console/bean/attribute/watch/monitor/StartMonitoringAction.java" line="69" number="9" /> </component> <component name="CheckinPanelState" /> --- 3,22 ---- <component name="AspectsView" /> <component name="BookmarkManager"> ! <editor_bookmark url="file://$PROJECT_DIR$/src/org/mc4j/console/dashboard/context/OgnlHelper.java" line="116" number="9" /> ! <editor_bookmark url="file://$PROJECT_DIR$/src/org/mc4j/console/dashboard/match/BeanMatch.java" line="71" number="0" /> [...4305 lines suppressed...] </entry> ! <entry file="file://$PROJECT_DIR$/application/dashboards/HtmlDocumentTest.xml"> <provider selected="true" editor-type-id="text-editor"> ! <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="0.0"> <folding /> </state> </provider> </entry> ! <entry file="file://$PROJECT_DIR$/application/dashboards/RelationsGraph2.xml"> <provider selected="true" editor-type-id="text-editor"> ! <state line="0" column="0" selection-start="0" selection-end="0" vertical-scroll-proportion="-0.33939394"> <folding /> </state> </provider> </entry> ! <entry file="file://$PROJECT_DIR$/application/dashboards/RelationsGraph.xml"> <provider selected="true" editor-type-id="text-editor"> ! <state line="47" column="16" selection-start="1910" selection-end="1910" vertical-scroll-proportion="0.6323232"> <folding /> </state> Index: ant.developer.properties =================================================================== RCS file: /cvsroot/mc4j/mc4j/ant.developer.properties,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** ant.developer.properties 4 Oct 2004 14:05:01 -0000 1.4 --- ant.developer.properties 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 5,9 **** # a strange location. See the online build instructions at # http://mc4j.sourceforge.net/Building.html - application.install = ${basedir}/../application/mc4j ! application.version = 1.2b7 \ No newline at end of file --- 5,8 ---- # a strange location. See the online build instructions at # http://mc4j.sourceforge.net/Building.html ! application.version = 1.3b1 \ No newline at end of file Index: Readme.txt =================================================================== RCS file: /cvsroot/mc4j/mc4j/Readme.txt,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** Readme.txt 19 Jan 2005 14:11:58 -0000 1.9 --- Readme.txt 12 Apr 2006 17:28:39 -0000 1.9.2.1 *************** *** 1,4 **** ! MC4J 1.2 beta 8 Read Me ! Release 1/18/05 http://mc4j.sourceforge.net --- 1,4 ---- ! MC4J 1.2 beta 9 Read Me ! Release 3/14/05 http://mc4j.sourceforge.net *************** *** 19,22 **** --- 19,26 ---- Release Notes + 1.2 beta 9 + * WebLogic 6, 7 and 8.1 support fixed + * WebSphere Studio test environment support added + 1.2 beta 8 * WebSphere 5 support fixed Index: MC4JProject.ipr =================================================================== RCS file: /cvsroot/mc4j/mc4j/MC4JProject.ipr,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** MC4JProject.ipr 5 Oct 2004 05:17:17 -0000 1.4 --- MC4JProject.ipr 12 Apr 2006 17:28:39 -0000 1.4.2.1 *************** *** 6,10 **** <additionalClassPath /> <antReference projectDefault="true" /> ! <customJdkName value="java version "1.5.0"" /> <maximumHeapSize value="128" /> <properties /> --- 6,17 ---- <additionalClassPath /> <antReference projectDefault="true" /> ! <customJdkName value="1.5" /> ! <maximumHeapSize value="128" /> ! <properties /> ! </buildFile> ! <buildFile url="file://$PROJECT_DIR$/modules/ems/build.xml"> ! <additionalClassPath /> ! <antReference projectDefault="true" /> ! <customJdkName value="1.5" /> <maximumHeapSize value="128" /> <properties /> *************** *** 39,42 **** --- 46,52 ---- <component name="DataSourceManager" /> <component name="DataSourceManagerImpl" /> + <component name="DependenciesAnalyzeManager"> + <option name="myForwardDirection" value="false" /> + </component> <component name="DependencyValidationManager" /> <component name="EjbActionsConfiguration"> *************** *** 64,68 **** <option name="ADDITIONAL_OPTIONS_STRING" value="-O" /> <option name="MAXIMUM_HEAP_SIZE" value="128" /> - <option name="USE_GENERICS_COMPILER" value="false" /> </component> <component name="JavadocGenerationManager"> --- 74,77 ---- *************** *** 197,203 **** <modules> <module fileurl="file://$PROJECT_DIR$/MC4J.iml" filepath="$PROJECT_DIR$/MC4J.iml" /> </modules> </component> ! <component name="ProjectRootManager" version="2" assert-keyword="false" jdk-15="false" project-jdk-name="java version "1.5.0"" /> <component name="RmicSettings"> <option name="IS_EANABLED" value="false" /> --- 206,213 ---- <modules> <module fileurl="file://$PROJECT_DIR$/MC4J.iml" filepath="$PROJECT_DIR$/MC4J.iml" /> + <module fileurl="file://$PROJECT_DIR$/modules/ems/ems.iml" filepath="$PROJECT_DIR$/modules/ems/ems.iml" /> </modules> </component> ! <component name="ProjectRootManager" version="2" assert-keyword="true" jdk-15="true" project-jdk-name="1.5" /> <component name="RmicSettings"> <option name="IS_EANABLED" value="false" /> *************** *** 270,293 **** </SOURCES> </library> - <library name="NetBeans"> - <CLASSES> - <root url="jar://$PROJECT_DIR$/../application/mc4j/lib/ext/boot.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/lib/core.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/lib/openide-loaders.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/lib/openide.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/lib/updater.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/core-ui.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/core-windows.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/text.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/autoload/core-output.jar!/" /> - <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/autoload/openide-io.jar!/" /> - </CLASSES> - <JAVADOC /> - <SOURCES> - <root url="file://C:/src/netbeans-src/openide/src" /> - <root url="file://C:/src/netbeans-src/core/src" /> - <root url="file://C:/src/netbeans-src/core/output/src" /> - </SOURCES> - </library> <library name="Carbon"> <CLASSES> --- 280,283 ---- *************** *** 305,345 **** <SOURCES /> </library> ! <library name="Netbeans4"> <CLASSES> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/mc4j_core.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-core-execution.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-core-multiview.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-core-output2.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-core-ui.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-core-windows.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-modules-autoupdate.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-modules-javahelp.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-modules-masterfs.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-modules-queries.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-modules-settings.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-netbeans-swing-tabcontrol.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-openide-execution.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/modules/org-openide-io.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/core/openide-loaders.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/core/core.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/core/openide.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/core/org-netbeans-swing-plaf.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/core/updater.jar!/" /> ! <root url="jar://$PROJECT_DIR$/../application/mc4j/lib/boot.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> ! <root url="file://E:/src/netbeans-src/core/settings/src" /> ! <root url="file://E:/src/netbeans-src/core/src" /> ! <root url="file://E:/src/netbeans-src/core/ide/src" /> ! <root url="file://E:/src/netbeans-src/core/windows/src" /> ! <root url="file://E:/src/netbeans-src/core/multiview/src" /> ! <root url="file://E:/src/netbeans-src/openide/src" /> ! <root url="file://E:/src/netbeans-src/core/output/src" /> ! <root url="file://E:/src/netbeans-src/core/output2/src" /> ! <root url="file://E:/src/netbeans-src/core/bootstrap/src" /> ! <root url="file://E:/src/netbeans-src/core/ui/src" /> </SOURCES> </library> </component> <component name="simpleUML.UMLToolWindowPlugin"> --- 295,336 ---- <SOURCES /> </library> ! <library name="NetBeans"> <CLASSES> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-core-execution.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-core-multiview.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-core-output2.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-core-ui.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-core-windows.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-modules-autoupdate.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-modules-javahelp.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-modules-masterfs.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-modules-queries.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-modules-settings.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-netbeans-swing-tabcontrol.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-openide-execution.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/modules/org-openide-io.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/core/core.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/core/openide-loaders.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/core/openide.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/core/org-netbeans-swing-plaf.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/core/updater.jar!/" /> ! <root url="jar://$PROJECT_DIR$/build/mc4j/platform5/lib/boot.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES> ! <root url="file://$PROJECT_DIR$/../../src/netbeans-src/core/src" /> ! <root url="file://$PROJECT_DIR$/../../src/netbeans-src/openide/src" /> ! <root url="file://$PROJECT_DIR$/../../src/netbeans-src/core/windows/src" /> ! <root url="file://$PROJECT_DIR$/../../src/netbeans-src/core/ui/src" /> ! <root url="file://$PROJECT_DIR$/../../src/netbeans-src/core/bootstrap/src" /> </SOURCES> </library> + <library name="chires"> + <CLASSES> + <root url="jar://$PROJECT_DIR$/../../chires/dist/chires.jar!/" /> + </CLASSES> + <JAVADOC /> + <SOURCES /> + </library> </component> <component name="simpleUML.UMLToolWindowPlugin"> *************** *** 382,385 **** --- 373,377 ---- <option name="COPY_FORMS_RUNTIME_TO_OUTPUT" value="false" /> </component> + <UsedPathMacros /> </project> |
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/chires/components/flow In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/chires/components/flow Added Files: Tag: ems_module_separation FlowModelProfilerViewComponent.java FlowModelTreeTableModel.java ProfilerModel.java ProfilerViewComponent.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: ProfilerViewComponent.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.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.model.history.flow.FlowStats; import org.chires.model.stack.BaseCallEntry; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.util.NodeUtil; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import org.jdesktop.swing.decorator.HighlighterPipeline; import org.jdesktop.swing.decorator.Highlighter; import org.jdesktop.swing.decorator.HierarchicalColumnHighlighter; import org.jdesktop.swing.decorator.AlternateRowHighlighter; import org.jdesktop.jdnc.JNTreeTable; import javax.swing.*; import javax.swing.table.DefaultTableCellRenderer; import javax.management.j2ee.statistics.TimeStatistic; import java.awt.*; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Sep 14, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:36 $) */ public class ProfilerViewComponent extends JPanel implements BeanComponent { EmsBean emsBean; EmsAttribute statsAttribute; FlowStats stats; // private JScrollPane jScrollPane; // private JXTreeTable treeTable; private JNTreeTable treeTableView; private ProfilerModel treeTableModel; /** Creates new form ObjectFrame */ public ProfilerViewComponent() { // initComponents(); //this.setName("Flow Model Profiler"); } public static void main(String[] args) { ProfilerViewComponent view = new ProfilerViewComponent(); view.stats = new FlowStats(); BaseCallEntry a = new BaseCallEntry("A", "Class1", "method1"); BaseCallEntry b,c,d; b = new BaseCallEntry("A", "Class2", "method2"); b.addChildEntry(new BaseCallEntry("A","Class3","method4")); a.addChildEntry(b); a.addChildEntry(new BaseCallEntry("A","Class2", "method3")); view.stats.registerCallStack(a); view.stats.registerCallStack(new BaseCallEntry("A", "Class1", "method2")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method3")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method4")); view.loadTree(); JFrame frame = new JFrame(); frame.getContentPane().add(view); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400,400); frame.setVisible(true); } public void setBean(EmsBean emsBean) { this.emsBean = emsBean; } public void setContext(Map context) { if (this.emsBean == null) { throw new IllegalStateException( "FlowModelProfilerViewComponent: attribute [emsBean] must be set with a Flow Model bean"); } statsAttribute = emsBean.getAttribute("stats"); retrieveData(); loadTree(); expandAll(); } private void retrieveData() { statsAttribute.refresh(); stats = (FlowStats) statsAttribute.getValue(); } public void refresh() { retrieveData(); treeTableModel.updateRoot(stats.getFlowEntryStats()[0]); repaint(); expandAll(); } private void expandAll() { treeTableView.expandAll(); } private void loadTree() { // TODO GH: Only loading the first child... not the root treeTableModel = new ProfilerModel(stats.getFlowEntryStats()[0]); this.treeTableView = new JNTreeTable(treeTableModel); this.treeTableView.setHasColumnControl(true); Highlighter alternateRowHighlighter = new AlternateRowHighlighter(); // Color fg = alternateRowHighlighter.getForeground(); // Color bg = alternateRowHighlighter.getBackground(); HierarchicalColumnHighlighter hierarchicalColumnHighlighter = new HierarchicalColumnHighlighter(/*fg, bg*/); HighlighterPipeline h = new HighlighterPipeline( new Highlighter[] { alternateRowHighlighter, hierarchicalColumnHighlighter}); this.treeTableView.setHighlighters(h); Icon icon = getIcon(); this.treeTableView.setOpenIcon(icon); // this.treeTableView.setClosedIcon(icon); // this.treeTableView.setCollapsedIcon(icon); // this.treeTableView.setLeafIcon(icon); this.treeTableView.getTreeTable().getColumnModel().getColumn(2).setCellRenderer(new TimeChartCellRenderer()); setLayout(new BorderLayout()); add(this.treeTableView,BorderLayout.CENTER); } public Icon getIcon() { return NodeUtil.getIcon("org/mc4j/console/mejb/img/Clock24.gif"); } public class TimeCellRenderer extends DefaultTableCellRenderer { public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Long t = (Long) value; FlowEntryStats rootStats = (FlowEntryStats) treeTableModel.getRoot(); TimeStatistic totalTime = (TimeStatistic) rootStats.getStatistic("Execution Time"); double size = ((double)t.longValue()) / ((double)totalTime.getTotalTime()) ; setIcon(NodeUtil.scaleIcon("org/mc4j/console/mejb/img/Clock24.gif", size)); setHorizontalTextPosition(SwingConstants.LEFT); return this; } } public class TimeChartCellRenderer extends DefaultTableCellRenderer { TimeComponent timeComponent = new TimeComponent(); public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { //super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); Long t = (Long) value; FlowEntryStats rootStats = (FlowEntryStats) treeTableModel.getRoot(); TimeStatistic totalTime = (TimeStatistic) rootStats.getStatistic("Execution Time"); double size = ((double)t.longValue()) / ((double)totalTime.getTotalTime()) ; timeComponent.setGraphLength(size); return timeComponent; } public class TimeComponent extends JComponent { double percentage; public void setGraphLength(double percentage) { this.percentage = percentage; } protected void paintComponent(Graphics g) { int a = (int) (percentage * getWidth()); g.setColor(Color.green); g.fillRect(0,0,a,getHeight()); g.setColor(Color.blue); g.fillRect(a,0,getWidth()-a,getHeight()); } } } /*public static class TimeHighlighter extends Highlighter { protected Component doHighlight(Component component, ComponentAdapter componentAdapter) { return component; } }*/ // TODO GH: When JDNC supports custom treetable tree column editors, support variable clock size on node } --- NEW FILE: FlowModelTreeTableModel.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.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.mc4j.console.swing.treetable.AbstractTreeTableModel; import org.mc4j.console.swing.treetable.TreeTableModel; import org.jfree.data.statistics.Statistics; import javax.management.j2ee.statistics.CountStatistic; import javax.management.j2ee.statistics.TimeStatistic; import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; import java.util.Arrays; /** * @author Greg Hinkle (gh...@us...), Nov 18, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:36 $) */ public class FlowModelTreeTableModel extends AbstractTreeTableModel { // Names of the columns. static protected String[] cNames = {"Name", "Calls", "Time", "Throws"}; static protected int[] cWidth = { 250, 40, 80, 40 }; // Types of the columns. static protected Class[] cTypes = { TreeTableModel.class, Long.class, String.class, String.class }; public FlowModelTreeTableModel(FlowEntryStats root) { super(root); } public void updateRoot(FlowEntryStats newRoot) { // TODO GH: Support the update of the stats (ugh) FlowEntryStats oldRoot = (FlowEntryStats) super.root; Statistic[] oldMethodStatistics = oldRoot.getStatistics(); Statistic[] newMethodStatistics = newRoot.getStatistics(); /*if (!Arrays.equals(oldMethodStatistics, newMethodStatistics)) { fireTreeNodesChanged(this,); }*/ super.root = newRoot; fireTreeStructureChanged(this, new Object[] { super.root }, null,null); } public Class getColumnClass(int column) { return cTypes[column]; } public int getColumnCount() { return cNames.length; } public String getColumnName(int column) { return cNames[column]; } public int getColumnWidth(int column) { return cWidth[column]; } public Object getValueAt(Object node, int column) { FlowEntryStats stat = (FlowEntryStats) node; Object value = null; TimeStatistic timeStatistic = (TimeStatistic) stat.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stat.getStatistic("Execution Failures"); switch(column) { case 0: value = stat.toString(); break; case 1: value = new Long(timeStatistic.getCount()); break; case 2: value = getTime(timeStatistic.getTotalTime()); break; case 3: value = new Long(failureStatistic.getCount()); break; } return value; } public Object getChild(Object parent, int index) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); if (children.length > index) return children[index]; return null; } public int getChildCount(Object parent) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); return children!=null?children.length:0; } public String getTime(long ms) { long mins = ms / (1000*60); long secs = (ms - (mins * 1000 * 60)) / 1000; long millis = ms - (mins * 1000 * 60) - (secs * 1000); StringBuffer buf = new StringBuffer(); if (millis > 0) { buf.append(millis); buf.append(" ms"); } if (secs > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " secs"); buf.insert(0, secs); } if (mins > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " mins"); buf.insert(0, mins); } return buf.toString(); } } --- NEW FILE: ProfilerModel.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.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.stat.ChiresTimeStatistic; import org.jfree.data.statistics.Statistics; import org.jdesktop.swing.treetable.AbstractTreeTableModel; import org.jdesktop.swing.treetable.TreeTableModel; import javax.management.j2ee.statistics.CountStatistic; import javax.management.j2ee.statistics.TimeStatistic; import javax.management.j2ee.statistics.Stats; import javax.management.j2ee.statistics.Statistic; import java.util.Arrays; import java.util.List; /** * @author Greg Hinkle (gh...@us...), Nov 18, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:36 $) */ public class ProfilerModel extends AbstractTreeTableModel { // Names of the columns. static protected String[] cNames = {"Name", "Calls", "Time (ms)", "Throws"}; static protected int[] cWidth = { 250, 40, 80, 40 }; // Types of the columns. static protected Class[] cTypes = { TreeTableModel.class, Long.class, Long.class, String.class }; public ProfilerModel(FlowEntryStats root) { super(root); } public void updateRoot(FlowEntryStats newRoot) { // TODO GH: Support the update of the stats (ugh) FlowEntryStats oldRoot = (FlowEntryStats) super.root; Statistic[] oldMethodStatistics = oldRoot.getStatistics(); Statistic[] newMethodStatistics = newRoot.getStatistics(); /*if (!Arrays.equals(oldMethodStatistics, newMethodStatistics)) { fireTreeNodesChanged(this,); }*/ super.root = newRoot; fireTreeStructureChanged(this, new Object[] { super.root }, null,null); } private void updateNode(FlowEntryStats oldStats, FlowEntryStats newStats) { if (!Arrays.equals(oldStats.getStatistics(),newStats.getStatistics())) { } FlowEntryStats[] oldChildren = oldStats.getFlowEntryStats(); FlowEntryStats[] newChildren = newStats.getFlowEntryStats(); for (int i = 0; i < oldChildren.length; i++) { if (oldChildren[i].getClassName() != newChildren[i].getClassName() || oldChildren[i].getMethodName() != newChildren[i].getMethodName()) { } } } public Class getColumnClass(int column) { return cTypes[column]; } public int getColumnCount() { return cNames.length; } public String getColumnName(int column) { return cNames[column]; } public int getColumnWidth(int column) { return cWidth[column]; } public Object getValueAt(Object node, int column) { FlowEntryStats stat = (FlowEntryStats) node; Object value = null; TimeStatistic timeStatistic = (TimeStatistic) stat.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stat.getStatistic("Execution Failures"); switch(column) { case 0: value = stat.toString(); break; case 1: value = new Long(timeStatistic.getCount()); break; case 2: value = new Long(timeStatistic.getTotalTime()); break; case 3: value = new Long(failureStatistic.getCount()); break; } return value; } public void setValueAt(Object o, Object o1, int i) { } public Object getChild(Object parent, int index) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); if (children.length > index) return children[index]; return null; } public int getChildCount(Object parent) { FlowEntryStats stat = (FlowEntryStats) parent; FlowEntryStats[] children = stat.getFlowEntryStats(); return children!=null?children.length:0; } public String getTime(long ms) { long mins = ms / (1000*60); long secs = (ms - (mins * 1000 * 60)) / 1000; long millis = ms - (mins * 1000 * 60) - (secs * 1000); StringBuffer buf = new StringBuffer(); if (millis > 0) { buf.append(millis); buf.append(" ms"); } if (secs > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " secs"); buf.insert(0, secs); } if (mins > 0) { if (buf.length() > 0) { buf.insert(0," "); } buf.insert(0, " mins"); buf.insert(0, mins); } return buf.toString(); } public static class CallInfoNode { long totalExecutionCount; long totalExecutionTime; long failureCount; String className; String methodName; List<CallInfoNode> callInfoNodes; public CallInfoNode(FlowEntryStats stats) { TimeStatistic timeStatistic = (TimeStatistic) stats.getStatistic("Execution Time"); CountStatistic failureStatistic = (CountStatistic) stats.getStatistic("Execution Failures"); ChiresTimeStatistic ts = new ChiresTimeStatistic(timeStatistic); } } } --- NEW FILE: FlowModelProfilerViewComponent.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.chires.components.flow; import org.chires.model.history.flow.FlowEntryStats; import org.chires.model.history.flow.FlowStats; import org.chires.model.stack.BaseCallEntry; import org.mc4j.console.dashboard.components.BeanComponent; import org.mc4j.console.swing.treetable.JTreeTable; import org.mc4j.ems.connection.bean.EmsBean; import org.mc4j.ems.connection.bean.attribute.EmsAttribute; import javax.swing.*; import javax.swing.table.TableColumn; import javax.swing.table.DefaultTableColumnModel; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreePath; import java.awt.*; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.util.Map; /** * @author Greg Hinkle (gh...@us...), Sep 14, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:36 $) */ public class FlowModelProfilerViewComponent extends JPanel implements BeanComponent { EmsBean emsBean; EmsAttribute statsAttribute; FlowStats stats; private javax.swing.JScrollPane jScrollPane; private JTreeTable treeTable; private FlowModelTreeTableModel treeTableModel; /** Creates new form ObjectFrame */ public FlowModelProfilerViewComponent() { initComponents(); //this.setName("Flow Model Profiler"); } public static void main(String[] args) { FlowModelProfilerViewComponent view = new FlowModelProfilerViewComponent(); view.stats = new FlowStats(); BaseCallEntry a = new BaseCallEntry("A", "Class1", "method1"); BaseCallEntry b,c,d; b = new BaseCallEntry("A", "Class2", "method2"); b.addChildEntry(new BaseCallEntry("A","Class3","method4")); a.addChildEntry(b); a.addChildEntry(new BaseCallEntry("A","Class2", "method3")); view.stats.registerCallStack(a); view.stats.registerCallStack(new BaseCallEntry("A", "Class1", "method2")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method3")); view.stats.getFlowEntryStats()[0].registerCallStack(new BaseCallEntry("A","Class2","method4")); view.loadTree(); JFrame frame = new JFrame(); frame.getContentPane().add(view); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setSize(400,400); frame.setVisible(true); } public void setBean(EmsBean emsBean) { this.emsBean = emsBean; } public void setContext(Map context) { if (this.emsBean == null) { throw new IllegalStateException( "FlowModelProfilerViewComponent: attribute [emsBean] must be set with a Flow Model bean"); } statsAttribute = emsBean.getAttribute("stats"); retrieveData(); loadTree(); expandAll(); } private void retrieveData() { statsAttribute.refresh(); stats = (FlowStats) statsAttribute.getValue(); } public void refresh() { retrieveData(); treeTableModel.updateRoot(stats.getFlowEntryStats()[0]); repaint(); expandAll(); } private void expandAll() { JTree tree = treeTable.getTree(); int count = tree.getRowCount(); for (int i=0;i<count;i++) { tree.expandRow(i); count = tree.getRowCount(); } } private void loadTree() { // TODO GH: Only loading the first child... not the root treeTableModel = new FlowModelTreeTableModel(stats.getFlowEntryStats()[0]); this.treeTable = new JTreeTable(treeTableModel); //this.tree = new JTree(treeTableModel); this.jScrollPane.setViewportView(treeTable); DefaultTableColumnModel cm = new DefaultTableColumnModel(); for (int i = 0; i < treeTableModel.getColumnCount();i++) { TableColumn column = new TableColumn(i,treeTableModel.getColumnWidth(i)); if (i>0) column.setPreferredWidth(treeTableModel.getColumnWidth(i)); column.setHeaderValue(treeTableModel.getColumnName(i)); cm.addColumn(column); } this.treeTable.setColumnModel(cm); //this.treeTable.getColumnModel().getColumn(0).setCellRenderer(new DefaultT); //this.treeTable.getTree().setCellRenderer(new DefaultTreeCellRenderer()); // this.treeTable.getTree().setCellRenderer(new CustomTreeTableCellRenderer()); // this.treeTable.getTree().setRootVisible(true); // this.treeTable.addMouseListener(new MouseHandler()); // this.treeTable.setRowHeight(22); this.jScrollPane.getComponent(0).setBackground(Color.white); this.jScrollPane.repaint(); } // private static Icon folderIcon = createImageIcon("images/FolderIcon.gif"); public class CustomTreeTableCellRenderer extends DefaultTreeCellRenderer { public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus); // TODO GH: Set icon return this; } } /** This method is called from within the constructor to * initialize the form. */ private void initComponents() { setLayout(new BorderLayout()); jScrollPane = new javax.swing.JScrollPane(); add(jScrollPane, BorderLayout.CENTER); } class MouseHandler extends MouseAdapter { public void mousePressed (MouseEvent e) { if (e.isPopupTrigger () && e.getClickCount () == 1) { doPopup (e.getX (), e.getY ()); } } public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger () && e.getClickCount () == 1) { doPopup (e.getX (), e.getY ()); } } public void doPopup (int x, int y) { // Get the tree element under the mouse TreePath clickedElement = treeTable.getTree().getPathForLocation (x, y); // Update the selection if necessary updateSelection (clickedElement); // Display the name of the selected tree element in the selection field String clickedElementName; if (clickedElement != null) clickedElementName = clickedElement.getLastPathComponent ().toString (); else clickedElementName = "NONE"; //currentSelectionField.setText ("Display Popup for: " + clickedElementName); // Get the desired context menu and show it JPopupMenu contextMenu = retrieveContextMenu (clickedElement); contextMenu.show (treeTable, x, y); } private JPopupMenu retrieveContextMenu (TreePath clickedElement) { JPopupMenu contextMenu; if (clickedElement != null) contextMenu = retrieveElementContextMenu (clickedElement); else contextMenu = retrieveTreeContextMenu (); if (contextMenu != null) { // This is the code that attempts but fails to shrink the menu to fit the current commands // Make sure the size of the menu is uptodate with any chages made to its actions before display contextMenu.invalidate (); contextMenu.pack (); } return contextMenu; } private JPopupMenu retrieveElementContextMenu (TreePath clickedElement) { if (clickedElement == null) return null; final FlowEntryStats stats = (FlowEntryStats) clickedElement.getLastPathComponent(); JPopupMenu contextMenu = null; contextMenu = new JPopupMenu("Tree Actions"); /*if (!treeNode.isFolder()) { JMenuItem editItem = new JMenuItem("Edit configuration"); editItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { IOProvider.getDefault().getStdOut().println("Editing document: " + treeNode.getPath()); treeTableModel.loadConfigurationNode(treeNode); ConfigurationEditor ce = new ConfigurationEditor(treeNode.getConfig()); ce.open(); } }); contextMenu.add(editItem); } else { JMenuItem refreshItem = new JMenuItem("Refresh folder"); refreshItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { } }); contextMenu.add(refreshItem); }*/ return contextMenu; } private JPopupMenu retrieveTreeContextMenu () { JPopupMenu treeMenu = new JPopupMenu ("Tree Context Menu"); return treeMenu; } private void updateSelection (TreePath clickedElement) { // Find out if the clicked on element is already selected boolean clickedElementSelected = false; TreePath[] selection = treeTable.getTree().getSelectionPaths (); if (clickedElement != null && selection != null) { // Determine if it one of the selected paths for (int index = 0; index < selection.length; ++index) { if (clickedElement.equals (selection[index])) { clickedElementSelected = true; break; } } } // Select the clicked on element or clear all selections if (!clickedElementSelected) { if (clickedElement != null) { // Clicked on unselected item - make it the selection treeTable.getTree().setSelectionPath (clickedElement); } else { // clicked over nothing clear the selection treeTable.getTree().clearSelection (); } } } } } |
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/swing/editor/xml Added Files: Tag: ems_module_separation BasicMBean.xml EditorDocument.java JEditorTest.java RETokenizer.java StyleTokens.java XMLStyleTokens.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: RETokenizer.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.swing.editor.xml; import java.util.regex.Matcher; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class RETokenizer { protected StyleTokens types; protected Matcher matcher; public RETokenizer(StyleTokens types, String text) { this.types = types; matcher = types.getMatcher(text); } /* protected Token getToken(int position) { for (int i = 0; i < types.getTokens().length; i++) { StyleTokens.StyleToken styleToken = types.getTokens()[i]; String tokenMatch = matcher.group(i); if (tokenMatch != null) { String type = styleToken.name; return new Token(tokenMatch, type, position); } } return null; }*/ protected Token getToken(int pos) { int count = types.getTokens().length; for (int i = 0; i < types.getTokens().length; i++) { StyleTokens.StyleToken styleToken = types.getTokens()[i]; String token = matcher.group(i+1); if (token != null) { String type = styleToken.name; return new Token(token, type, pos); } } return null; } public Token nextToken() { if (matcher.find()) { return getToken(matcher.start()); } return null; } public static class Token { public String token; public String type; protected int position; public Token(String token, String type, int getPosition) { this.token = token; this.type = type; this.position = getPosition; } public String getText() { return token; } public String getType() { return type; } public int getPosition() { return position; } public String toString() { return type + "(" + token + ", " + position + ')'; } } } --- NEW FILE: BasicMBean.xml --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE Dashboard PUBLIC "-//MC4J//DTD Dashboard 1.0//EN" "http://mc4j.sourceforge.net/Dashboard_1_0.dtd"> <!-- Document : BasicMBean.xml Created on : October 6, 2002, 10:01 PM Author : ghinkl Description: Displays the basic information of an MBean --> <Dashboard version="1.0" name="Basic MBean View"> <Description>Displays general information about any MBean in the system.</Description> <DashboardMatch type="Bean"> <BeanMatch id="BeanNode" type="Single"> <Condition type="BeanObjectNameCondition" filter=".*"/> </BeanMatch> </DashboardMatch> <LayoutManager type="java.awt.BorderLayout"/> <Content> <!-- *** The header section displays title and a refresh control *** --> <Component type="javax.swing.JPanel"> <Constraint type="BorderConstraints" direction="NORTH"/> <LayoutManager type="java.awt.BorderLayout"/> <Border type="javax.swing.border.EmptyBorder" top="(Literal)2" left="(Literal)5" bottom="(Literal)2" right="(Literal)5"/> <Content> <Component type="javax.swing.JPanel"> <Constraint type="BorderConstraints" direction="CENTER"/> <LayoutManager type="java.awt.BorderLayout"/> <Content> <Component type="javax.swing.JLabel" id="titleLable"> <Constraint type="BorderConstraints" direction="CENTER"/> <Attribute name="text" value="DashboardName"/> <Attribute name="font" value="(Literal)SansSerif bold 20"/> <Attribute name="foreground" value="(Literal)0x666666"/> </Component> <Component type="javax.swing.JTextArea"> <Constraint type="BorderConstraints" direction="SOUTH"/> <Attribute name="text" value="(Message)General information about {ObjectName}"/> <Attribute name="font" value="(Literal)DialogInput bold 14"/> <Attribute name="opaque" value="(Literal)false"/> <Attribute name="editable" value="(Literal)false"/> </Component> </Content> </Component> <Component type="org.mc4j.console.dashboard.components.RefreshControlComponent"> <Constraint type="BorderConstraints" direction="EAST"/> <Attribute name="refreshDelay" value="(Literal)30000"/> </Component> </Content> </Component> <!-- *** The main content is displayed within a scrollpane for easy viewing *** --> <Component type="javax.swing.JScrollPane"> <Constraint type="BorderConstraints" direction="CENTER"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <Content> <Component type="javax.swing.JPanel"> <Attribute name="background" value="(Literal)0xFFFFFF"/> <LayoutManager type="java.awt.BoxLayout" axis="Y_AXIS"/> <Content> <!-- *** A Section holder is an included component for providing hide-able parts *** --> <Component type="org.mc4j.console.swing.SectionHolder"> <Attribute name="title" value="(Literal)MBean Attributes"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <LayoutManager type="java.awt.BorderLayout"/> <Content> <!-- *** This component displays the attributes of an MBean *** --> <Component type="org.mc4j.console.dashboard.components.AttributeTreeTableExplorer"> <!-- *** Notice were setting the node that we matched above by name here *** --> <Attribute name="beanNode" value="BeanNode"/> <Constraint type="BorderConstraints" direction="CENTER"/> <Border type="javax.swing.border.LineBorder" color="(Literal)0x444444" thickness="(Literal)1"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> </Component> </Content> </Component> <Component type="org.mc4j.console.swing.SectionHolder"> <Attribute name="title" value="(Literal)MBean Operations"/> <Attribute name="background" value="(Literal)0xFFFFFF"/> <Content> <Component type="org.mc4j.console.dashboard.components.OperationListComponent"> <Attribute name="beanNode" value="BeanNode"/> <Attribute name="format" value="(Literal)FULL_FORMAT"/> </Component> </Content> </Component> <!-- <Component type="org.mc4j.console.dashboard.components.FillerComponent"> <Attribute name="type" value="(Literal)VERTICAL_GLUE_SHAPE"/> </Component> --> </Content> </Component> </Content> </Component> </Content> </Dashboard> --- NEW FILE: StyleTokens.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.swing.editor.xml; import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.swing.text.StyledDocument; import java.awt.*; import java.util.LinkedList; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class StyleTokens { protected LinkedList tokenList; public StyleTokens() { tokenList = new LinkedList(); } public void addTokenType(String name, String expression, Color color, boolean bold) { tokenList.add(new StyleToken(name, expression, color, bold)); } public StyleToken[] getTokens() { return (StyleToken[]) tokenList.toArray(new StyleToken[tokenList.size()]); } public void setStyles(StyledDocument doc) { for (int i = 0; i < tokenList.size(); i++) { StyleToken styleToken = (StyleToken) tokenList.get(i); Style style = doc.addStyle(styleToken.name,null); StyleConstants.setForeground(style,styleToken.color); StyleConstants.setBold(style, styleToken.bold); } // Add a special background colored, yellow // since I'm not sure how to do squiglies under text Style style = doc.addStyle("error",null); StyleConstants.setBackground(style, Color.yellow); } public String getExpression() { StringBuffer buffer = new StringBuffer(); for (int i = 0; i < tokenList.size(); i++) { StyleToken styleToken = (StyleToken) tokenList.get(i); if (i > 0) buffer.append('|'); buffer.append('('); buffer.append(styleToken.expression); buffer.append(')'); } return buffer.toString(); } public Pattern getPattern() { String expression = getExpression(); return Pattern.compile(expression, Pattern.MULTILINE); //Pattern.DOTALL); } public Matcher getMatcher(String text) { return getPattern().matcher(text); } public static class StyleToken { protected String name; protected String expression; protected Color color; protected boolean bold; public StyleToken(String name, String expr, Color color, boolean bold) { this.name = name; this.expression = expr; this.color = color; this.bold = bold; } } } --- NEW FILE: XMLStyleTokens.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.swing.editor.xml; import javax.swing.text.Document; import javax.swing.text.StyledEditorKit; import java.awt.*; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class XMLStyleTokens extends StyleTokens { public static final String TAG = "tag"; public static final String TEXT = "text"; public static final String COMMENT = "comment"; private static final String ATTRIBUTE = "attribute"; public XMLStyleTokens() { //"([^ >]*)=\"" // "<[^ >]* ([^ >])?" // "(\\w)+=\"?:[^\"]*\" addTokenType(COMMENT, "<!--[^--]*-->", Color.gray, false); addTokenType(TAG, "<[^ >]*|[\\?]?>", new Color(0,0,132), true); addTokenType(TEXT, "\"(?:\\\\.|[^\"\\\\])*\"", new Color(72,125,55), true); addTokenType(ATTRIBUTE, "\\w+(?<=)", Color.red, false); } public static class Kit extends StyledEditorKit { public Document createDefaultDocument() { return new EditorDocument(new XMLStyleTokens()); } } } --- NEW FILE: JEditorTest.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.swing.editor.xml; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ import javax.swing.*; import javax.swing.text.StyledEditorKit; import java.awt.*; import java.io.File; import java.io.FileReader; import java.io.IOException; public class JEditorTest extends JPanel { public JEditorTest(File file) throws IOException { //KeywordManager.loadKeywordFiles(); StyledEditorKit kit = null; if (file.getName().toLowerCase().endsWith(".xml")) { kit = new XMLStyleTokens.Kit(); } JEditorPane editor = new JEditorPane(); editor.setEditorKit(kit); editor.read(new FileReader(file), null); ((EditorDocument)editor.getDocument()).setValidating(true); setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4)); setLayout(new GridLayout()); add(new JScrollPane(editor)); } public static void main(String[] args) throws IOException { File file = new File("org/mc4j/console/swing/editor/xml/BasicMBean.xml"); JFrame frame = new JFrame("JEditor Test"); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane().add(new JEditorTest(file),BorderLayout.CENTER); frame.setSize(700, 550); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } } --- NEW FILE: EditorDocument.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.swing.editor.xml; import org.w3c.dom.Document; import org.xml.sax.ErrorHandler; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; import javax.swing.text.AttributeSet; import javax.swing.text.BadLocationException; import javax.swing.text.DefaultStyledDocument; import javax.swing.text.Style; import javax.swing.text.StyleConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import java.io.IOException; import java.io.InputStream; import java.io.StringBufferInputStream; /** * @author Greg Hinkle (gh...@us...), Nov 16, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class EditorDocument extends DefaultStyledDocument implements ErrorHandler { protected StyleTokens types; protected boolean validating = false; public EditorDocument(StyleTokens types) { Style defaultStyle = getStyle("default"); StyleConstants.setFontSize(defaultStyle, 12); StyleConstants.setFontFamily(defaultStyle, "Courier New"); Style tagStyle = addStyle("tag", defaultStyle); StyleConstants.setBold(tagStyle,true); this.types = types; types.setStyles(this); } public void insertString(int offset, String text, AttributeSet style) throws BadLocationException { super.insertString(offset, text, style); fireUpdate(); } public void remove(int offset, int length) throws BadLocationException { super.remove(offset, length); fireUpdate(); } private Thread updateThread = new Thread(new Runnable() { public void run() { while (true) { if (validating && needsUpdate) { needsUpdate = false; highlightSyntax(); validateSyntax(); } try { Thread.sleep(500); } catch (InterruptedException e) { e.printStackTrace(); } } } }); private boolean needsUpdate = false; public void fireUpdate() { needsUpdate = true; } public void warning(SAXParseException exception) throws SAXException { System.out.println(exception); highlightError(exception); } public void error(SAXParseException exception) throws SAXException { System.out.println(exception); highlightError(exception); } public void fatalError(SAXParseException exception) throws SAXException { System.out.println(exception); highlightError(exception); } public void validateSyntax() { long start = System.currentTimeMillis(); try { System.out.println("VALIDATING"); String text = getText(0, getLength()); InputStream s = new StringBufferInputStream(text); DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); // documentBuilderFactory.setValidating(true); DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder(); documentBuilder.setErrorHandler(this); Document doc = documentBuilder.parse(s); // System.out.println("VER: " + doc.getXmlVersion()); } catch (BadLocationException e) { // e.printStackTrace(); } catch (IOException e) { // e.printStackTrace(); } catch (ParserConfigurationException e) { // e.printStackTrace(); } catch (SAXException e) { // e.printStackTrace(); } finally { System.out.println("Validation took: " + (System.currentTimeMillis() - start) + "ms"); } } public void highlightError(SAXException se) { if (se instanceof SAXParseException) { try { String text = getText(0, getLength()); SAXParseException spe = (SAXParseException) se; int line = spe.getLineNumber(); int column = spe.getColumnNumber(); if (line < 1 || column < 1) return; String[] lines = text.split("\n"); int l = 0; for (int i=0;i<line-1;i++) { l += lines[i].length()+1; } int position = l + column; setCharacterAttributes(position,1,getStyle("error"),false); } catch (BadLocationException e) { e.printStackTrace(); } } } public void highlightSyntax() { try { String text = getText(0, getLength()); // Clear the existing styling setCharacterAttributes(0, getLength(), getStyle("default"), true); RETokenizer.Token token; RETokenizer tokenizer = new RETokenizer(types, text); while ((token = tokenizer.nextToken()) != null) { int pos = token.getPosition(); String type = token.getType(); String word = token.getText(); int len = word.length(); for (int i = 0; i < types.getTokens().length; i++) { StyleTokens.StyleToken styleToken = types.getTokens()[i]; String name = styleToken.name; if (type.equals(name)) { setCharacterAttributes(pos, len, getStyle(name), false); } } } } catch (Exception e) { e.printStackTrace(); } } public boolean isValidating() { return validating; } public void setValidating(boolean validating) { this.validating = validating; if (validating) { fireUpdate(); updateThread.start(); } } } |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:49
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/domain In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/domain Modified Files: Tag: ems_module_separation DomainNode.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: DomainNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/domain/DomainNode.java,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** DomainNode.java 5 Oct 2004 05:16:01 -0000 1.18 --- DomainNode.java 12 Apr 2006 17:28:38 -0000 1.18.2.1 *************** *** 19,22 **** --- 19,23 ---- import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.install.ExplorerUtil; + import org.mc4j.ems.connection.bean.EmsBeanName; import org.openide.nodes.AbstractNode; import org.openide.nodes.Children; *************** *** 26,44 **** import org.openide.util.actions.SystemAction; - import javax.management.ObjectName; import java.io.IOException; ! import java.util.ArrayList; ! import java.util.Collections; ! import java.util.Comparator; ! import java.util.Date; ! import java.util.Enumeration; ! import java.util.HashMap; ! import java.util.HashSet; ! import java.util.Hashtable; ! import java.util.Iterator; ! import java.util.List; ! import java.util.Map; ! import java.util.Set; ! import java.util.TreeMap; /** --- 27,32 ---- import org.openide.util.actions.SystemAction; import java.io.IOException; ! import java.util.*; /** *************** *** 108,114 **** MBeanNode beanNode = (MBeanNode) obj; ! ObjectName objectName = beanNode.getObjectName(); ! Hashtable props = objectName.getKeyPropertyList(); for (Iterator propsIterator = props.entrySet().iterator(); propsIterator.hasNext();) { Map.Entry entry = (Map.Entry) propsIterator.next(); --- 96,102 ---- MBeanNode beanNode = (MBeanNode) obj; ! EmsBeanName objectName = beanNode.getEmsBean().getBeanName(); ! Map<String,String> props = objectName.getKeyProperties(); for (Iterator propsIterator = props.entrySet().iterator(); propsIterator.hasNext();) { Map.Entry entry = (Map.Entry) propsIterator.next(); *************** *** 163,167 **** MBeanNode beanNode = (MBeanNode) listIterator.next(); if (!categorized.contains(beanNode)) { ! String significantValueMapKey = key + "=" + beanNode.getObjectName().getKeyProperty(key); List list = (List) resultMap.get(significantValueMapKey); if (list == null) { --- 151,155 ---- MBeanNode beanNode = (MBeanNode) listIterator.next(); if (!categorized.contains(beanNode)) { ! String significantValueMapKey = key + "=" + beanNode.getEmsBean().getBeanName().getKeyProperty(key); List list = (List) resultMap.get(significantValueMapKey); if (list == null) { *************** *** 310,314 **** if (childNode instanceof MBeanNode) { MBeanNode beanNode = (MBeanNode) childNode; //node to insert ! Hashtable props = beanNode.getObjectName().getKeyPropertyList(); //get properties that will be used to extract keys Children children = node.getChildren(); //get the nodes that are already part of the domain --- 298,302 ---- if (childNode instanceof MBeanNode) { MBeanNode beanNode = (MBeanNode) childNode; //node to insert ! Map<String,String> props = beanNode.getEmsBean().getBeanName().getKeyProperties(); //get properties that will be used to extract keys Children children = node.getChildren(); //get the nodes that are already part of the domain |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:48
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/swing/editor Added Files: Tag: ems_module_separation ButtonEditor.java ButtonRenderer.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: ButtonEditor.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.swing.editor; import javax.swing.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.*; /** * @author Greg Hinkle (gh...@us...), Feb 3, 2005 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class ButtonEditor extends DefaultCellEditor { protected JButton button; private String label; private boolean isPushed; public ButtonEditor(JCheckBox checkBox) { super(checkBox); button = new JButton(); button.setOpaque(true); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fireEditingStopped(); } }); } public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (isSelected) { button.setForeground(table.getSelectionForeground()); button.setBackground(table.getSelectionBackground()); } else { button.setForeground(table.getForeground()); button.setBackground(table.getBackground()); } label = (value == null) ? "" : value.toString(); button.setText(label); isPushed = true; return button; } public Object getCellEditorValue() { if (isPushed) { // // JOptionPane.showMessageDialog(button, label + ": Ouch!"); // System.out.println(label + ": Ouch!"); } isPushed = false; return new String(label); } public boolean stopCellEditing() { isPushed = false; return super.stopCellEditing(); } protected void fireEditingStopped() { super.fireEditingStopped(); } } --- NEW FILE: ButtonRenderer.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.swing.editor; import javax.swing.*; import javax.swing.table.TableCellRenderer; import java.awt.*; /** * @author Greg Hinkle (gh...@us...), Feb 3, 2005 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class ButtonRenderer extends JButton implements TableCellRenderer { public ButtonRenderer() { setOpaque(true); } public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (isSelected) { setForeground(table.getSelectionForeground()); setBackground(table.getSelectionBackground()); } else { setForeground(table.getForeground()); setBackground(UIManager.getColor("Button.background")); } setText((value == null) ? "" : value.toString()); return this; } } |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:48
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/match In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/dashboard/match Modified Files: Tag: ems_module_separation BeanCondition.java BeanMatch.java BeanObjectNameCondition.java DashboardMatch.java MatchExecutor.java ServerAttributeCondition.java Added Files: Tag: ems_module_separation BeanObjectNameRegexCondition.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: BeanCondition.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/match/BeanCondition.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** BeanCondition.java 5 Oct 2004 05:16:00 -0000 1.2 --- BeanCondition.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 18,21 **** --- 18,22 ---- import org.mc4j.console.bean.MBeanNode; + import org.mc4j.ems.connection.bean.EmsBean; import org.w3c.dom.Element; *************** *** 29,33 **** public void initializeCondition(Element rootElement); ! public boolean testCondition(MBeanNode node); --- 30,34 ---- public void initializeCondition(Element rootElement); ! public boolean testCondition(EmsBean node); Index: DashboardMatch.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/match/DashboardMatch.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** DashboardMatch.java 5 Oct 2004 05:16:00 -0000 1.2 --- DashboardMatch.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 32,36 **** public static final String TYPE_BEAN = "Bean"; ! private List beanMatchList = new ArrayList(); --- 32,36 ---- public static final String TYPE_BEAN = "Bean"; ! private List<BeanMatch> beanMatchList = new ArrayList<BeanMatch>(); *************** *** 59,67 **** } ! public List getBeanMatchList() { return beanMatchList; } ! public void setBeanMatchList(List beanMatchList) { this.beanMatchList = beanMatchList; } --- 59,67 ---- } ! public List<BeanMatch> getBeanMatchList() { return beanMatchList; } ! public void setBeanMatchList(List<BeanMatch> beanMatchList) { this.beanMatchList = beanMatchList; } Index: MatchExecutor.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/match/MatchExecutor.java,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** MatchExecutor.java 5 Oct 2004 05:16:00 -0000 1.3 --- MatchExecutor.java 12 Apr 2006 17:28:38 -0000 1.3.2.1 *************** *** 17,32 **** package org.mc4j.console.dashboard.match; - import java.util.ArrayList; - import java.util.Hashtable; - import java.util.Iterator; - import java.util.List; - import java.util.Map; - - import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.connection.ConnectionNode; import org.mc4j.console.dashboard.Dashboard; import org.mc4j.console.dashboard.context.ContextHelper; /** * @author Greg Hinkle (gh...@us...), Apr 5, 2004 * @version $Revision$($Author$ / $Date$) --- 17,30 ---- package org.mc4j.console.dashboard.match; import org.mc4j.console.connection.ConnectionNode; import org.mc4j.console.dashboard.Dashboard; import org.mc4j.console.dashboard.context.ContextHelper; + import org.mc4j.ems.connection.bean.EmsBean; + + import java.util.*; /** + * Matches dashboards against the list of currently known beans + * * @author Greg Hinkle (gh...@us...), Apr 5, 2004 * @version $Revision$($Author$ / $Date$) *************** *** 48,52 **** ! public boolean matchSingle(Dashboard dashboard, MBeanNode mBeanNode) { DashboardMatch dashboardMatch = dashboard.getDashboardMatch(); --- 46,50 ---- ! public boolean matchSingle(Dashboard dashboard, EmsBean bean) { DashboardMatch dashboardMatch = dashboard.getDashboardMatch(); *************** *** 58,73 **** BeanMatch beanMatch = (BeanMatch) beanMatchList.get(0); ! List conditionList = beanMatch.getConditionList(); ! if (beanConditionListMatch(conditionList, mBeanNode)) { ! dashboard.putContext(beanMatch.getId(), mBeanNode); ! // For single types, experimenting with placing their object name attributes in context ! Hashtable objectNameProps = mBeanNode.getObjectName().getKeyPropertyList(); ! for(Iterator iterator2 = objectNameProps.entrySet().iterator(); iterator2.hasNext(); ) { ! Map.Entry entry = (Map.Entry) iterator2.next(); ! String key = (String)entry.getKey(); ! String value = (String)entry.getValue(); dashboard.putContext(key, value); } --- 56,71 ---- BeanMatch beanMatch = (BeanMatch) beanMatchList.get(0); ! List<BeanCondition> conditionList = beanMatch.getConditionList(); ! if (beanConditionListMatch(conditionList, bean)) { ! dashboard.putContext(beanMatch.getId(), bean); ! beanMatch.addMatchedBean(bean); ! // For single types, experimenting with placing their object name attributes in context ! Map<String, String> objectNameProps = bean.getBeanName().getKeyProperties(); ! for (Map.Entry<String, String> entry : objectNameProps.entrySet()) { ! String key = (String) entry.getKey(); ! String value = (String) entry.getValue(); dashboard.putContext(key, value); } *************** *** 76,80 **** String newName = null; try { ! newName = (String) ContextHelper.getValue(currentName,dashboard.getContextStarter()); } catch (Exception e) { // This is ok, just assume its not a context lookup --- 74,78 ---- String newName = null; try { ! newName = (String) ContextHelper.getValue(currentName, dashboard.getContextStarter()); } catch (Exception e) { // This is ok, just assume its not a context lookup *************** *** 85,89 **** return true; ! } } return false; --- 83,87 ---- return true; ! } } return false; *************** *** 91,105 **** /** - * * @param dashboard * @param connectionNode * @return null if no matches are found, otherwise a list of dashboards with the ! * associated bindings. */ ! public List matchGlobalDashboards(Dashboard dashboard, ConnectionNode connectionNode) { ! List matches = new ArrayList(); DashboardMatch dashboardMatch = dashboard.getDashboardMatch(); List mbeanNodes = connectionNode.getMBeanList(); boolean allBeansMatched = true; --- 89,103 ---- /** * @param dashboard * @param connectionNode * @return null if no matches are found, otherwise a list of dashboards with the ! * associated bindings. */ ! public List<Dashboard> matchGlobalDashboards(Dashboard dashboard, ConnectionNode connectionNode) { ! List<Dashboard> matches = new ArrayList<Dashboard>(); DashboardMatch dashboardMatch = dashboard.getDashboardMatch(); List mbeanNodes = connectionNode.getMBeanList(); + SortedSet<EmsBean> beans = connectionNode.getEmsConnection().getBeans(); boolean allBeansMatched = true; *************** *** 107,124 **** if (DashboardMatch.TYPE_GLOBAL.equals(dashboardMatch.getType())) { ! List beanMatchList = dashboardMatch.getBeanMatchList(); ! for (Iterator iterator = beanMatchList.iterator(); iterator.hasNext();) { ! BeanMatch beanMatch = (BeanMatch) iterator.next(); ! List conditionList = beanMatch.getConditionList(); boolean beanMatched = false; if (BeanMatch.TYPE_MULTIPLE.equals(beanMatch.getType())) { ! List matchedBeanList = new ArrayList(); ! for (Iterator iterator1 = mbeanNodes.iterator(); iterator1.hasNext();) { ! MBeanNode mBeanNode = (MBeanNode) iterator1.next(); ! if (beanConditionListMatch(conditionList, mBeanNode)) { ! matchedBeanList.add(mBeanNode); beanMatched = true; } --- 105,124 ---- if (DashboardMatch.TYPE_GLOBAL.equals(dashboardMatch.getType())) { ! List<BeanMatch> beanMatchList = dashboardMatch.getBeanMatchList(); ! for (BeanMatch beanMatch : beanMatchList) { ! List<BeanCondition> conditionList = beanMatch.getConditionList(); boolean beanMatched = false; if (BeanMatch.TYPE_MULTIPLE.equals(beanMatch.getType())) { ! List<EmsBean> matchedBeanList = new ArrayList<EmsBean>(); ! // for (Iterator iterator1 = mbeanNodes.iterator(); iterator1.hasNext();) { ! // MBeanNode mBeanNode = (MBeanNode) iterator1.next(); ! for (EmsBean bean : beans) { ! ! if (beanConditionListMatch(conditionList, bean)) { ! matchedBeanList.add(bean); ! beanMatch.addMatchedBean(bean); beanMatched = true; } *************** *** 128,145 **** } else if (BeanMatch.TYPE_SINGLE.equals(beanMatch.getType())) { ! for (Iterator iterator1 = mbeanNodes.iterator(); iterator1.hasNext();) { ! MBeanNode mBeanNode = (MBeanNode) iterator1.next(); ! if (beanConditionListMatch(conditionList, mBeanNode)) { ! dashboard.putContext(beanMatch.getId(), mBeanNode); beanMatched = true; // For single types, experimenting with placing their object name attributes in context ! Hashtable objectNameProps = mBeanNode.getObjectName().getKeyPropertyList(); ! for(Iterator iterator2 = objectNameProps.entrySet().iterator(); iterator2.hasNext(); ) { ! Map.Entry entry = (Map.Entry) iterator2.next(); ! String key = (String)entry.getKey(); ! String value = (String)entry.getValue(); dashboard.putContext(key, value); } --- 128,144 ---- } else if (BeanMatch.TYPE_SINGLE.equals(beanMatch.getType())) { ! for (EmsBean bean : beans) { ! if (beanConditionListMatch(conditionList, bean)) { ! dashboard.putContext(beanMatch.getId(), bean); beanMatched = true; // For single types, experimenting with placing their object name attributes in context ! Map<String, String> objectNameProps = bean.getBeanName().getKeyProperties(); ! for (Map.Entry<String, String> entry : objectNameProps.entrySet()) { ! String key = entry.getKey(); ! String value = entry.getValue(); dashboard.putContext(key, value); + beanMatch.addMatchedBean(bean); } *************** *** 165,180 **** } - /** - * Test all conditions. * @param conditionList ! * @param mBeanNode ! * @return */ ! protected boolean beanConditionListMatch(List conditionList, MBeanNode mBeanNode) { boolean match = true; ! for (Iterator iterator = conditionList.iterator(); iterator.hasNext();) { ! BeanCondition beanCondition = (BeanCondition) iterator.next(); ! if (!beanCondition.testCondition(mBeanNode)) match = false; } --- 164,176 ---- } /** * @param conditionList ! * @param bean */ ! protected boolean beanConditionListMatch(List<BeanCondition> conditionList, EmsBean bean) { boolean match = true; ! ! for (BeanCondition beanCondition : conditionList) { ! if (!beanCondition.testCondition(bean)) match = false; } Index: BeanObjectNameCondition.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/match/BeanObjectNameCondition.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** BeanObjectNameCondition.java 5 Oct 2004 05:16:00 -0000 1.2 --- BeanObjectNameCondition.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 17,27 **** package org.mc4j.console.dashboard.match; ! import org.openide.ErrorManager; ! import org.openide.windows.IOProvider; ! ! import org.mc4j.console.bean.MBeanNode; ! ! import org.apache.regexp.RE; ! import org.apache.regexp.RESyntaxException; /** --- 17,21 ---- package org.mc4j.console.dashboard.match; ! import org.mc4j.ems.connection.bean.EmsBean; /** *************** *** 30,40 **** */ public class BeanObjectNameCondition extends AbstractBeanCondition { - private String filter; - private RE nameFilter; public String[] getConditionAttributes() { ! return new String[] { "filter" }; --- 24,32 ---- */ public class BeanObjectNameCondition extends AbstractBeanCondition { private String filter; public String[] getConditionAttributes() { ! return new String[]{ "filter" }; *************** *** 47,69 **** public void setFilter(String filter) { this.filter = filter; ! try { ! this.nameFilter = new RE(filter); ! //REUtil.createRE(filter); ! } catch (RESyntaxException rese) { ! ErrorManager.getDefault().notify(rese); ! IOProvider.getDefault().getStdOut().println( ! "Invalid dashboard matching regular expression [" + filter + ! "] in dashboard."); ! } ! } ! public boolean testCondition(MBeanNode node) { ! String cName = node.getObjectName().getCanonicalName(); ! ! if (this.nameFilter != null) { ! return this.nameFilter.match(cName); } else { return true; --- 39,50 ---- public void setFilter(String filter) { this.filter = filter; ! // TODO Check valid Filter } ! public boolean testCondition(EmsBean bean) { ! if (filter != null) { ! return bean.getBeanName().apply(filter); } else { return true; Index: BeanMatch.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/match/BeanMatch.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** BeanMatch.java 5 Oct 2004 05:16:00 -0000 1.2 --- BeanMatch.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 17,20 **** --- 17,22 ---- package org.mc4j.console.dashboard.match; + import org.mc4j.ems.connection.bean.EmsBean; + import java.util.List; import java.util.ArrayList; *************** *** 32,36 **** private String type; ! private List conditionList = new ArrayList(); public String getId() { --- 34,40 ---- private String type; ! private List<BeanCondition> conditionList = new ArrayList<BeanCondition>(); ! ! private List<EmsBean> matchedBeans = new ArrayList<EmsBean>(); public String getId() { *************** *** 54,62 **** } ! public List getConditionList() { return conditionList; } ! public void setConditionList(List conditionList) { this.conditionList = conditionList; } --- 58,66 ---- } ! public List<BeanCondition> getConditionList() { return conditionList; } ! public void setConditionList(List<BeanCondition> conditionList) { this.conditionList = conditionList; } *************** *** 65,67 **** --- 69,79 ---- this.conditionList.add(beanCondition); } + + public void addMatchedBean(EmsBean bean) { + this.matchedBeans.add(bean); + } + + public List<EmsBean> getMatchedBeans() { + return matchedBeans; + } } --- NEW FILE: BeanObjectNameRegexCondition.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.match; import org.mc4j.ems.connection.bean.EmsBean; import org.openide.ErrorManager; import org.openide.windows.IOProvider; import java.util.regex.Pattern; /** * @author Greg Hinkle (gh...@us...), Apr 5, 2004 * @version $Revision: 1.1.2.1 $($Author: ghinkl $ / $Date: 2006/04/12 17:28:38 $) */ public class BeanObjectNameRegexCondition extends AbstractBeanCondition { private String filter; private Pattern nameFilter; public String[] getConditionAttributes() { return new String[] { "filter" }; } public String getFilter() { return filter; } public void setFilter(String filter) { this.filter = filter; try { this.nameFilter = Pattern.compile(filter); //REUtil.createRE(filter); } catch (Exception rese) { ErrorManager.getDefault().notify(rese); IOProvider.getDefault().getStdOut().println( "Invalid dashboard matching regular expression [" + filter + "] in dashboard."); } } public boolean testCondition(EmsBean bean) { String cName = bean.getBeanName().getCanonicalName(); if (this.nameFilter != null) { return this.nameFilter.matcher(cName).find(); } else { return true; } } } Index: ServerAttributeCondition.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/dashboard/match/ServerAttributeCondition.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** ServerAttributeCondition.java 5 Oct 2004 05:35:41 -0000 1.4 --- ServerAttributeCondition.java 12 Apr 2006 17:28:38 -0000 1.4.2.1 *************** *** 18,21 **** --- 18,22 ---- import org.mc4j.console.bean.MBeanNode; + import org.mc4j.ems.connection.bean.EmsBean; /** *************** *** 39,43 **** } ! public boolean testCondition(MBeanNode node) { // TODO GH: Fixme return true; //serverType.equals(node.getConnectionNode().getgetConnectionType()); --- 40,44 ---- } ! public boolean testCondition(EmsBean bean) { // TODO GH: Fixme return true; //serverType.equals(node.getConnectionNode().getgetConnectionType()); |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:47
|
Update of /cvsroot/mc4j/mc4j/application/branding/bundle/org/netbeans/core/ui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/application/branding/bundle/org/netbeans/core/ui Added Files: Tag: ems_module_separation Bundle_mc4j.properties Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: Bundle_mc4j.properties --- LBL_ProductInformation=MC4J Management Console |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:46
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/graph/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/swing/graph/data Removed Files: Tag: ems_module_separation BoundedTimeTableXYDataset.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- BoundedTimeTableXYDataset.java DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:46
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor/jmx In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/swing/editor/jmx Modified Files: Tag: ems_module_separation CompositeDataEditor.java ObjectNameEditor.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: CompositeDataEditor.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor/jmx/CompositeDataEditor.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** CompositeDataEditor.java 5 Oct 2004 05:16:02 -0000 1.2 --- CompositeDataEditor.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 24,38 **** import org.openide.nodes.PropertySupport; import org.openide.nodes.Sheet; ! import java.awt.BorderLayout; ! import java.awt.Component; import java.beans.PropertyEditorSupport; import java.util.Iterator; import java.util.Set; - import javax.management.openmbean.CompositeData; - import javax.swing.JPanel; - - /** --- 24,38 ---- import org.openide.nodes.PropertySupport; import org.openide.nodes.Sheet; + import org.openide.windows.IOProvider; ! import javax.management.openmbean.CompositeData; ! import javax.management.openmbean.CompositeDataSupport; ! import javax.management.openmbean.OpenDataException; ! import javax.swing.*; ! import java.awt.*; import java.beans.PropertyEditorSupport; import java.util.Iterator; import java.util.Set; /** *************** *** 50,54 **** if (value instanceof CompositeData) { //return new CompositeDataPanel((CompositeData) value); ! return new CompositeDataNodePanel((CompositeData) value); } return null; --- 50,54 ---- if (value instanceof CompositeData) { //return new CompositeDataPanel((CompositeData) value); ! return new CompositeDataNodePanel((CompositeData) value, this); } return null; *************** *** 58,72 **** public static class CompositeDataNodePanel extends JPanel { ! public CompositeDataNodePanel(CompositeData data) { setLayout(new BorderLayout()); PropertySheet sheet = new PropertySheet(); ! CompositeDataNode node = new CompositeDataNode(data); try { ! sheet.setNodes(new Node[] { node }); ! } catch (Exception e) { ErrorManager.getDefault().notify(e); } ! add(sheet,BorderLayout.CENTER); } } --- 58,74 ---- public static class CompositeDataNodePanel extends JPanel { ! public CompositeDataNodePanel(CompositeData data, CompositeDataEditor cde) { setLayout(new BorderLayout()); PropertySheet sheet = new PropertySheet(); ! CompositeDataNode node = new CompositeDataNode(data, cde); try { ! sheet.setNodes(new Node[]{node}); ! } catch (Exception e) { ! ErrorManager.getDefault().notify(e); ! } ! add(sheet, BorderLayout.CENTER); } } *************** *** 75,81 **** public static class CompositeDataNode extends AbstractNode { CompositeData data; ! public CompositeDataNode(CompositeData data) { super(Children.LEAF); this.data = data; setDisplayName(this.data.getCompositeType().getDescription()); --- 77,86 ---- public static class CompositeDataNode extends AbstractNode { CompositeData data; ! CompositeDataEditor cde; ! ! public CompositeDataNode(CompositeData data, CompositeDataEditor cde) { super(Children.LEAF); this.data = data; + this.cde = cde; setDisplayName(this.data.getCompositeType().getDescription()); *************** *** 94,116 **** try { dataClass = Class.forName(this.data.getCompositeType().getType(keyName).getClassName()); ! } catch (ClassNotFoundException cnfe) { } String description = this.data.getCompositeType().getDescription(keyName); ! props.put( ! new PropertySupport.ReadWrite( ! keyName, ! dataClass, ! keyName, ! description) { ! public Object getValue() { ! Object value = data.get(keyName); ! return value; } ! public void setValue(Object value) { } ! }); } ! return new Node.PropertySet[] { props }; } --- 99,156 ---- try { dataClass = Class.forName(this.data.getCompositeType().getType(keyName).getClassName()); ! } catch (ClassNotFoundException cnfe) { ! } String description = this.data.getCompositeType().getDescription(keyName); ! props.put(new PropertySupport.ReadWrite(keyName, ! dataClass, ! keyName, ! description) { ! public Object getValue() { ! Object value = data.get(keyName); ! return value; ! } ! ! public void setValue(Object value) { ! CompositeDataSupport cds = null; ! try { ! cds = createCompositeData(value); ! data = cds; ! cde.setValue(data); ! } catch (OpenDataException e) { ! //ignore - we will just stay with the original data ! IOProvider.getDefault().getIO("MC4J Errors", false).getOut(). ! println("CompositeDataSupport exception: " + e.getMessage()); } + } ! /** ! * @param value ! * @return ! * @throws OpenDataException ! */ ! private CompositeDataSupport createCompositeData(Object value) throws OpenDataException { ! Set set = data.getCompositeType().keySet(); ! int i = 0; ! Object[] newData = new Object[set.size()]; ! String[] newDescriptions = new String[set.size()]; ! for (Iterator iter = set.iterator(); iter.hasNext();) { ! String key = (String) iter.next(); ! if (keyName.equals(key)) { ! newData[i] = value; ! } else { ! newData[i] = data.get(key); ! ; ! } ! newDescriptions[i] = key; ! i++; ! } ! CompositeDataSupport cds = new CompositeDataSupport(data.getCompositeType(), newDescriptions, newData); ! return cds; ! } ! }); } ! return new Node.PropertySet[]{props}; } Index: ObjectNameEditor.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/swing/editor/jmx/ObjectNameEditor.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** ObjectNameEditor.java 5 Oct 2004 05:16:02 -0000 1.2 --- ObjectNameEditor.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 17,20 **** --- 17,22 ---- package org.mc4j.console.swing.editor.jmx; + import org.mc4j.console.bean.MBeanNode; + import org.mc4j.console.connection.ConnectionNode; import org.openide.ErrorManager; import org.openide.explorer.propertysheet.ExPropertyEditor; *************** *** 24,33 **** import org.openide.nodes.Node; ! import org.mc4j.console.bean.MBeanNode; ! import org.mc4j.console.connection.ConnectionNode; ! ! import java.awt.Component; ! import java.awt.Graphics; ! import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; --- 26,32 ---- import org.openide.nodes.Node; ! import javax.management.ObjectName; ! import javax.swing.*; ! import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; *************** *** 38,49 **** import java.util.List; - import javax.management.ObjectName; - import javax.swing.DefaultListModel; - import javax.swing.DefaultListSelectionModel; - import javax.swing.JButton; - import javax.swing.JComponent; - import javax.swing.KeyStroke; - import javax.swing.ListSelectionModel; - --- 37,40 ---- *************** *** 54,58 **** public class ObjectNameEditor extends PropertyEditorSupport implements ExPropertyEditor, InplaceEditor.Factory { ! private ObjectName currentValue; private DefaultListModel listModel; --- 45,49 ---- public class ObjectNameEditor extends PropertyEditorSupport implements ExPropertyEditor, InplaceEditor.Factory { ! private String currentValue; private DefaultListModel listModel; *************** *** 71,78 **** public void setAsText(String text) throws IllegalArgumentException { for (int i = 0; i < this.listModel.getSize(); i++) { ! ObjectName objectName = (ObjectName)this.listModel.get(i); ! String name = objectName.toString(); if (name.equals(text)) { ! this.currentValue = objectName; this.selectionModel.setSelectionInterval(i,i); } --- 62,68 ---- public void setAsText(String text) throws IllegalArgumentException { for (int i = 0; i < this.listModel.getSize(); i++) { ! String name = (String) this.listModel.get(i); if (name.equals(text)) { ! this.currentValue = name; this.selectionModel.setSelectionInterval(i,i); } *************** *** 81,85 **** public String getAsText() { ! return (this.currentValue!= null)?this.currentValue.getCanonicalName():"<null>"; } --- 71,75 ---- public String getAsText() { ! return (this.currentValue!= null)?this.currentValue:"<null>"; } *************** *** 113,117 **** i++; //ObjectInstance instance = (ObjectInstance) ! ObjectName name = ((MBeanNode)instIter.next()).getObjectName(); //instance.getObjectName(); listModel.addElement(name); --- 103,108 ---- i++; //ObjectInstance instance = (ObjectInstance) ! String name = ((MBeanNode)instIter.next()).getEmsBean().getBeanName().getCanonicalName(); ! // ObjectName name = ((MBeanNode)instIter.next()).getObjectName(); //instance.getObjectName(); listModel.addElement(name); *************** *** 128,136 **** public void setValue(Object value) { if (value != null) { ! this.currentValue = (ObjectName) value; firePropertyChange(); for (int i = 0; i < this.listModel.getSize(); i++) { ! ObjectName objectName = (ObjectName)this.listModel.get(i); if (objectName.equals(value)) { --- 119,127 ---- public void setValue(Object value) { if (value != null) { ! this.currentValue = (String) value; firePropertyChange(); for (int i = 0; i < this.listModel.getSize(); i++) { ! String objectName = (String) this.listModel.get(i); if (objectName.equals(value)) { *************** *** 257,261 **** if ((value != null) && (value instanceof ObjectName)) { ! currentValue = (ObjectName) value; setText(getAsText()); } --- 248,252 ---- if ((value != null) && (value instanceof ObjectName)) { ! currentValue = (String) value; setText(getAsText()); } *************** *** 290,294 **** if ((value != null) && (value instanceof ObjectName)) { ! currentValue = (ObjectName) value; } } catch(Exception e) { --- 281,285 ---- if ((value != null) && (value instanceof ObjectName)) { ! currentValue = (String) value; } } catch(Exception e) { |
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/mejb/view Modified Files: Tag: ems_module_separation CompositeStatisticsView.java MEJBView.java StatisticNode.java StatisticsView.java StatsNode.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: MEJBView.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/MEJBView.java,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** MEJBView.java 15 Jan 2005 03:52:15 -0000 1.6 --- MEJBView.java 12 Apr 2006 17:28:38 -0000 1.6.2.1 *************** *** 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.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** StatisticsView.java 19 Jan 2005 14:09:40 -0000 1.6 --- StatisticsView.java 12 Apr 2006 17:28:38 -0000 1.6.2.1 *************** *** 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: StatsNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/StatsNode.java,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** StatsNode.java 15 Jan 2005 03:52:15 -0000 1.4 --- StatsNode.java 12 Apr 2006 17:28:38 -0000 1.4.2.1 *************** *** 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.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** CompositeStatisticsView.java 5 Oct 2004 05:16:02 -0000 1.2 --- CompositeStatisticsView.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 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); Index: StatisticNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/mejb/view/StatisticNode.java,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** StatisticNode.java 15 Jan 2005 03:52:15 -0000 1.2 --- StatisticNode.java 12 Apr 2006 17:28:38 -0000 1.2.2.1 *************** *** 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; } |
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/connection/install Removed Files: Tag: ems_module_separation AbstractConnectionTypeDescriptor.java ConnectionTypeDescriptor.java GeronimoConnectionTypeDescriptor.java J2SE5ConnectionTypeDescriptor.java JBossConnectionTypeDescriptor.java JDMKConnectionTypeDescriptor.java JSR160ConnectionTypeDescriptor.java Mx4jConnectionTypeDescriptor.java Oc4jConnectionTypeDescriptor.java PramatiConnectionTypeDescriptor.java SJSASConnectionTypeDescriptor.java Tomcat55ConnectionTypeDescriptor.java Weblogic9ConnectionTypeDescriptor.java Weblogic9Jsr77ConnectionTypeDescriptor.java WeblogicConnectionTypeDescriptor.java WebsphereConnectionTypeDescriptor.java WebsphereStudioConnectionTypeDescriptor.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- JSR160ConnectionTypeDescriptor.java DELETED --- --- AbstractConnectionTypeDescriptor.java DELETED --- --- Weblogic9Jsr77ConnectionTypeDescriptor.java DELETED --- --- PramatiConnectionTypeDescriptor.java DELETED --- --- WebsphereStudioConnectionTypeDescriptor.java DELETED --- --- J2SE5ConnectionTypeDescriptor.java DELETED --- --- Weblogic9ConnectionTypeDescriptor.java DELETED --- --- Mx4jConnectionTypeDescriptor.java DELETED --- --- JDMKConnectionTypeDescriptor.java DELETED --- --- JBossConnectionTypeDescriptor.java DELETED --- --- GeronimoConnectionTypeDescriptor.java DELETED --- --- Oc4jConnectionTypeDescriptor.java DELETED --- --- ConnectionTypeDescriptor.java DELETED --- --- Tomcat55ConnectionTypeDescriptor.java DELETED --- --- WebsphereConnectionTypeDescriptor.java DELETED --- --- WeblogicConnectionTypeDescriptor.java DELETED --- --- SJSASConnectionTypeDescriptor.java DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:44
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Modes/editor In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/application/dist/org/mc4j/console/Windows2/Modes/editor Added Files: Tag: ems_module_separation welcomepanel.wstcref Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: welcomepanel.wstcref --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd"> <tc-ref version="2.0"> <module name="org.mc4j.console" spec="1.3" /> <tc-id id="welcomepanel" /> <state opened="true" /> </tc-ref> |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:44
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/connection/jboss In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/connection/jboss Removed Files: Tag: ems_module_separation ConnectorFinder.java JBossConnectorFinder.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- JBossConnectorFinder.java DELETED --- --- ConnectorFinder.java DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:44
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Modes/explorer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/application/dist/org/mc4j/console/Windows2/Modes/explorer Added Files: Tag: ems_module_separation connectionexplorer.wstcref filesystems.wstcref_hidden filesystems4.wstcref_hidden Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: filesystems4.wstcref_hidden --- <?xml version="1.0" encoding="UTF-8"?> <tc-ref version="2.0"> <module name="org.netbeans.core.ui/1" spec="1.2" /> <tc-id id="filesystems" /> <state opened="true" /> </tc-ref> --- NEW FILE: connectionexplorer.wstcref --- <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE tc-ref PUBLIC "-//NetBeans//DTD Top Component in Mode Properties 2.0//EN" "http://www.netbeans.org/dtds/tc-ref2_0.dtd"> <tc-ref version="2.0"> <module name="org.mc4j.console" spec="1.3" /> <tc-id id="connectionexplorer" /> <state opened="true" /> </tc-ref> --- NEW FILE: filesystems.wstcref_hidden --- <?xml version="1.0" encoding="UTF-8"?> <tc-ref version="2.0"> <module name="org.netbeans.core.ui/1" spec="1.2" /> <tc-id id="filesystems" /> <state opened="true" /> </tc-ref> |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:44
|
Update of /cvsroot/mc4j/mc4j/application/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/application/images Removed Files: Tag: ems_module_separation splash.psd Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- splash.psd DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:43
|
Update of /cvsroot/mc4j/mc4j/application/dist/org/mc4j/console/Windows2/Modes/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/application/dist/org/mc4j/console/Windows2/Modes/properties Added Files: Tag: ems_module_separation properties.wstcref Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- NEW FILE: properties.wstcref --- <?xml version="1.0" encoding="UTF-8"?> <tc-ref version="2.0"> <module name="org.netbeans.core.ui/1" spec="1.2" /> <tc-id id="properties" /> <state opened="true" /> </tc-ref> |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:43
|
Update of /cvsroot/mc4j/mc4j/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/lib Removed Files: Tag: ems_module_separation regexp.jar Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. --- regexp.jar DELETED --- |
From: Greg H. <gh...@us...> - 2006-04-12 17:28:43
|
Update of /cvsroot/mc4j/mc4j/src/org/mc4j/console/query In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6793/src/org/mc4j/console/query Modified Files: Tag: ems_module_separation QueryNode.java Log Message: Lots of changes towards the 2.0 alpha that I should've checked in a long time ago. Lots of stuff still broken. Only JBoss and JDK 1.5 have been tested. Index: QueryNode.java =================================================================== RCS file: /cvsroot/mc4j/mc4j/src/org/mc4j/console/query/QueryNode.java,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** QueryNode.java 7 Jan 2005 05:08:49 -0000 1.11 --- QueryNode.java 12 Apr 2006 17:28:38 -0000 1.11.2.1 *************** *** 19,47 **** import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.connection.ConnectionNode; - import org.mc4j.console.mejb.MBeanFilterNode; import org.openide.ErrorManager; - import org.openide.awt.StatusDisplayer; import org.openide.actions.OpenLocalExplorerAction; import org.openide.actions.PropertiesAction; import org.openide.actions.ToolsAction; ! import org.openide.nodes.AbstractNode; ! import org.openide.nodes.Children; ! import org.openide.nodes.Node; ! import org.openide.nodes.PropertySupport; ! import org.openide.nodes.Sheet; ! import org.openide.nodes.FilterNode; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.SystemAction; ! import javax.management.MBeanServer; ! import javax.management.MalformedObjectNameException; ! import javax.management.ObjectInstance; ! import javax.management.ObjectName; ! import java.lang.reflect.InvocationTargetException; import java.util.Iterator; - import java.util.Set; import java.util.List; ! import java.util.ArrayList; import java.util.regex.Pattern; --- 19,36 ---- import org.mc4j.console.bean.MBeanNode; import org.mc4j.console.connection.ConnectionNode; import org.openide.ErrorManager; import org.openide.actions.OpenLocalExplorerAction; import org.openide.actions.PropertiesAction; import org.openide.actions.ToolsAction; ! import org.openide.awt.StatusDisplayer; ! import org.openide.nodes.*; import org.openide.util.HelpCtx; import org.openide.util.NbBundle; import org.openide.util.actions.SystemAction; ! import java.util.ArrayList; import java.util.Iterator; import java.util.List; ! import java.util.Set; import java.util.regex.Pattern; *************** *** 102,106 **** Object obj = iter.next(); MBeanNode mBeanNode = (MBeanNode) obj; ! String canonicalName = mBeanNode.getObjectName().getCanonicalName(); StatusDisplayer.getDefault().setStatusText("Searching MBean [" + i++ + " of " + list.size() + "]"); --- 91,95 ---- Object obj = iter.next(); MBeanNode mBeanNode = (MBeanNode) obj; ! String canonicalName = mBeanNode.getEmsBean().getBeanName().getCanonicalName(); StatusDisplayer.getDefault().setStatusText("Searching MBean [" + i++ + " of " + list.size() + "]"); |