KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > ClusterMemberTableModel


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;
5
6 import com.tc.admin.common.XObjectTableModel;
7   
8 public class ClusterMemberTableModel extends XObjectTableModel {
9   private static final String JavaDoc[] CLUSTER_MEMBERS_FIELDS = {"Name", "Hostname", "JMXPortNumber"};
10   private static final String JavaDoc[] CLUSTER_MEMBERS_HEADERS = {"Name", "Host", "Admin Port"};
11
12   public ClusterMemberTableModel() {
13     super(ServerConnectionManager.class,
14           CLUSTER_MEMBERS_FIELDS,
15           CLUSTER_MEMBERS_HEADERS);
16   }
17   
18   public void addClusterMember(ServerConnectionManager scm) {
19     add(scm);
20   }
21   
22   public ServerConnectionManager getClusterMemberAt(int row) {
23     return (ServerConnectionManager)getObjectAt(row);
24   }
25   
26   public void clear() {
27     int count = getRowCount();
28     for(int i = 0; i < count; i++) {
29       getClusterMemberAt(i).tearDown();
30     }
31     super.clear();
32   }
33   
34   public void tearDown() {
35     clear();
36   }
37 }
38
39
Popular Tags