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