1 4 package com.tc.admin.dso; 5 6 import org.jfree.chart.JFreeChart; 7 8 import com.tc.admin.AdminClient; 9 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) { 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 insert(new ClientsNode(cc), i++); 34 35 PollerNode node; 36 ObjectName bean = DSOHelper.getHelper().getDSOMBean(cc); 37 String statName; 38 String header; 39 StatisticPanel panel; 40 String xLabel = null; 41 String yLabel = acc.getMessage("dso.cache.rate.range.label"); 42 43 CacheActivityPanel cacheActivityPanel = new CacheActivityPanel(cc, bean, SwingConstants.VERTICAL); 44 header = acc.getMessage("dso.cache.activity"); 45 node = new PollerNode(header, cacheActivityPanel); 46 47 cacheActivityPanel.setNode(node); 48 insert(node, i++); 49 50 statName = "TransactionRate"; 51 header = acc.getMessage("dso.transaction.rate"); 52 yLabel = acc.getMessage("dso.transaction.rate.range.label"); 53 panel = new RatePanel(cc, bean, statName, header, xLabel, yLabel) { 54 public JFreeChart createChart() { 55 return DemoChartFactory.getXYBarChart("", "", "", m_timeSeries); 56 } 57 }; 58 node = new PollerNode(header, panel); 59 60 panel.setNode(node); 61 insert(node, i++); 62 63 statName = "CacheMissRate"; 64 header = acc.getMessage("dso.cache.miss.rate"); 65 yLabel = acc.getMessage("dso.cache.miss.rate.label"); 66 panel = new RatePanel(cc, bean, statName, header, xLabel, yLabel); 67 node = new PollerNode(header, panel); 68 69 panel.setNode(node); 70 insert(node, i++); 71 72 insert(new GCStatsNode(cc), i++); 73 74 StatsPanel statsPanel = new StatsPanel(cc, bean); 75 node = new PollerNode(acc.getMessage("dso.all.statistics"), statsPanel); 76 77 statsPanel.setNode(node); 78 insert(node, i++); 79 } 80 } 81 | Popular Tags |