KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > sessions > SessionMonitorTable


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.admin.sessions;
5
6 import com.tc.admin.common.PropertyTable;
7 import com.tc.admin.common.PropertyTableModel;
8 import com.tc.management.beans.sessions.SessionMonitorMBean;
9
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 JavaDoc[] fields = {
23       "RequestCount",
24       "RequestRatePerSecond",
25       "CreatedSessionCount",
26       "SessionCreationRatePerMinute",
27       "DestroyedSessionCount",
28       "SessionDestructionRatePerMinute"
29     };
30     SessionMonitorWrapper wrapper = new SessionMonitorWrapper(m_bean = bean);
31     PropertyTableModel model = new PropertyTableModel(wrapper, fields);
32     setModel(model);
33   }
34   
35   public void refresh() {
36     PropertyTableModel model = (PropertyTableModel)getModel();
37     model.setInstance(new SessionMonitorWrapper(m_bean));
38   }
39 }
40
Popular Tags