KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > admin > dso > LockTreeModel


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.dso;
5
6 import com.tc.admin.ConnectionContext;
7 import com.tc.admin.common.XTreeModel;
8 import com.tc.admin.common.XTreeNode;
9
10 import com.tc.objectserver.lockmanager.api.LockMBean;
11
12 public class LockTreeModel extends XTreeModel {
13   private ConnectionContext m_cc;
14
15   public LockTreeModel(ConnectionContext cc) {
16     super();
17     m_cc = cc;
18   }
19
20   public void setLocks(LockMBean[] locks) {
21     XTreeNode rootNode = (XTreeNode)getRoot();
22
23     rootNode.tearDownChildren();
24
25     for(int i = 0; i < locks.length; i++) {
26       insertNodeInto(new LockTreeNode(m_cc, locks[i]), rootNode, i);
27     }
28
29     nodeStructureChanged(rootNode);
30   }
31 }
32
Popular Tags