KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mc4j > console > cluster > ClusterConnection


1 /*
2  * Copyright 2002-2004 Greg Hinkle
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.mc4j.console.cluster;
18
19 import org.mc4j.console.connection.ConnectionNode;
20 import org.mc4j.ems.connection.settings.ConnectionSettings;
21 import org.openide.nodes.Node;
22 import org.openide.util.actions.SystemAction;
23
24 import java.util.ArrayList JavaDoc;
25 import java.util.Iterator JavaDoc;
26 import java.util.List JavaDoc;
27
28 /**
29  *
30  * @author Greg Hinkle (ghinkle@users.sourceforge.net), January 2002
31  * @version $Revision: 570 $($Author: ghinkl $ / $Date: 2006-04-12 15:14:16 -0400 (Wed, 12 Apr 2006) $)
32  */

33 public class ClusterConnection extends ConnectionNode {
34     
35     List JavaDoc connectionNodes = new ArrayList JavaDoc();
36     
37     private static final String JavaDoc CONNECTIONS_NODE = "servers";
38     
39     /** Creates a new instance of ClusterConnection */
40     public ClusterConnection() {
41         super(new ConnectionSettings());
42
43         setIconBase("org/mc4j/console/connection/DisconnectedConnectionNodeIcon");
44         // Set FeatureDescriptor stuff:
45
setName("loading");
46     }
47
48     public void connect() throws Exception JavaDoc {
49         
50     }
51     
52     protected SystemAction[] createActions() {
53         return super.createActions();
54     }
55     
56     public void disconnect() throws Exception JavaDoc {
57         
58     }
59     
60     public void addConnection(ConnectionNode node) {
61         this.connectionNodes.add(node);
62         this.getChildren().findChild(CONNECTIONS_NODE).getChildren().add(new Node[] { node });
63     }
64     
65     public void initialize(ConnectionSettings settings) {
66     }
67
68     
69     public Node.PropertySet[] getPropertySets() {
70         return super.getPropertySets();
71     }
72     
73     protected void loadConnectionNodeChildren() throws Exception JavaDoc {
74         Iterator JavaDoc iter = this.connectionNodes.iterator();
75         while (iter.hasNext()) {
76             ConnectionNode connection = (ConnectionNode)iter.next();
77             connection.refresh(); //loadConnectionNodeChildren();
78

79             //getChildren().add(connection.getChildren().getNodes());
80

81         }
82     }
83
84     
85 }
86
Popular Tags