01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.admin.dso;
05:
06: import org.jfree.chart.JFreeChart;
07:
08: import com.tc.admin.AdminClient;
09: import com.tc.admin.AdminClientContext;
10: import com.tc.admin.ConnectionContext;
11: import com.tc.admin.common.ComponentNode;
12: import com.tc.admin.common.DemoChartFactory;
13: import com.tc.admin.common.PollerNode;
14: import com.tc.admin.common.RatePanel;
15: import com.tc.admin.common.StatisticPanel;
16:
17: import javax.management.ObjectName;
18: import javax.swing.SwingConstants;
19:
20: public class DSONode extends ComponentNode {
21: public DSONode(ConnectionContext cc) throws Exception {
22: super ();
23:
24: AdminClientContext acc = AdminClient.getContext();
25:
26: setLabel(acc.getMessage("dso"));
27: setComponent(new DSOPanel(cc));
28:
29: int i = 0;
30: insert(new RootsNode(cc), i++);
31: insert(new ClassesNode(cc), i++);
32: try {
33: insert(new LocksNode(cc), i++);
34: } catch (Throwable t) {/**/
35: }
36: insert(new ClientsNode(cc), i++);
37:
38: PollerNode node;
39: ObjectName bean = DSOHelper.getHelper().getDSOMBean(cc);
40: String statName;
41: String header;
42: StatisticPanel panel;
43: String xLabel = null;
44: String yLabel = acc.getMessage("dso.cache.rate.range.label");
45:
46: CacheActivityPanel cacheActivityPanel = new CacheActivityPanel(
47: cc, bean, SwingConstants.VERTICAL);
48: header = acc.getMessage("dso.cache.activity");
49: node = new PollerNode(header, cacheActivityPanel);
50:
51: cacheActivityPanel.setNode(node);
52: insert(node, i++);
53:
54: statName = "TransactionRate";
55: header = acc.getMessage("dso.transaction.rate");
56: yLabel = acc.getMessage("dso.transaction.rate.range.label");
57: panel = new RatePanel(cc, bean, statName, header, xLabel,
58: yLabel) {
59: public JFreeChart createChart() {
60: return DemoChartFactory.getXYBarChart("", "", "",
61: m_timeSeries);
62: }
63: };
64: node = new PollerNode(header, panel);
65:
66: panel.setNode(node);
67: insert(node, i++);
68:
69: statName = "CacheMissRate";
70: header = acc.getMessage("dso.cache.miss.rate");
71: yLabel = acc.getMessage("dso.cache.miss.rate.label");
72: panel = new RatePanel(cc, bean, statName, header, xLabel,
73: yLabel);
74: node = new PollerNode(header, panel);
75:
76: panel.setNode(node);
77: insert(node, i++);
78:
79: insert(new GCStatsNode(cc), i++);
80:
81: StatsPanel statsPanel = new StatsPanel(cc, bean);
82: node = new PollerNode(acc.getMessage("dso.all.statistics"),
83: statsPanel);
84:
85: statsPanel.setNode(node);
86: insert(node, i++);
87: }
88: }
|