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.sessions;
05:
06: import com.tc.admin.common.PropertyTable;
07: import com.tc.admin.common.PropertyTableModel;
08: import com.tc.management.beans.sessions.SessionMonitorMBean;
09:
10: public class SessionMonitorTable extends PropertyTable {
11: private SessionMonitorMBean m_bean;
12:
13: public SessionMonitorTable() {
14: super ();
15: }
16:
17: void setBean(SessionMonitorMBean bean) {
18: if (bean == null) {
19: return;
20: }
21:
22: String[] fields = { "RequestCount", "RequestRatePerSecond",
23: "CreatedSessionCount", "SessionCreationRatePerMinute",
24: "DestroyedSessionCount",
25: "SessionDestructionRatePerMinute" };
26: SessionMonitorWrapper wrapper = new SessionMonitorWrapper(
27: m_bean = bean);
28: PropertyTableModel model = new PropertyTableModel(wrapper,
29: fields);
30: setModel(model);
31: }
32:
33: public void refresh() {
34: PropertyTableModel model = (PropertyTableModel) getModel();
35: model.setInstance(new SessionMonitorWrapper(m_bean));
36: }
37: }
|