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 com.tc.admin.AdminClient;
07: import com.tc.admin.AdminClientContext;
08: import com.tc.admin.ConnectionContext;
09: import com.tc.admin.common.ComponentNode;
10: import com.tc.admin.common.PollerNode;
11: import com.tc.admin.common.RatePanel;
12:
13: import javax.management.ObjectName;
14: import javax.swing.SwingConstants;
15:
16: public class ClientTreeNode extends ComponentNode {
17: private DSOClient m_client;
18: private CacheActivityPanel m_cacheActivity;
19: private RatePanel m_txnRate;
20: private ClientStatsPanel m_clientStats;
21:
22: public ClientTreeNode(ConnectionContext cc, DSOClient client) {
23: super (client.getRemoteAddress());
24: setComponent(new ClientPanel(m_client = client));
25:
26: AdminClientContext acc = AdminClient.getContext();
27: int i = 0;
28: ObjectName bean = client.getObjectName();
29: ComponentNode node;
30:
31: m_cacheActivity = new CacheActivityPanel(cc, bean,
32: SwingConstants.VERTICAL);
33: node = new PollerNode(acc.getMessage("dso.cache.activity"),
34: m_cacheActivity);
35:
36: m_cacheActivity.setNode(node);
37: insert(node, i++);
38:
39: String stat = "TransactionRate";
40: String header = acc.getMessage("dso.transaction.rate");
41: String xAxis = null;
42: String yAxis = acc
43: .getMessage("dso.transaction.rate.range.label");
44:
45: m_txnRate = new RatePanel(cc, bean, stat, header, xAxis, yAxis);
46: m_txnRate.setNode(node = new PollerNode(header, m_txnRate));
47: insert(node, i++);
48:
49: m_clientStats = new ClientStatsPanel(cc, bean);
50: node = new PollerNode(acc.getMessage("dso.all.statistics"),
51: m_clientStats);
52: m_clientStats.setNode(node);
53: insert(node, i++);
54: }
55:
56: public DSOClient getClient() {
57: return m_client;
58: }
59:
60: public void tearDown() {
61: m_cacheActivity.stop();
62: m_txnRate.stop();
63: m_clientStats.stop();
64:
65: super.tearDown();
66:
67: m_cacheActivity = null;
68: m_txnRate = null;
69: m_clientStats = null;
70: }
71: }
|