summaryrefslogtreecommitdiff
path: root/java/src/IceGrid/TreeNode/SimpleContainer.java
blob: bd2dde0a577a56a3b32f7a5652b764e636ebf8f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// **********************************************************************
//
// Copyright (c) 2003-2005 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
package IceGrid.TreeNode;

import IceGrid.Model;

//
// A simple container, for example: Services, Adapters, DbEnvs
//
class SimpleContainer extends Parent
{
    protected SimpleContainer(String id, Model model, boolean root)
    {
	super(id, model, root);
    }

    protected SimpleContainer(String id, Model model)
    {
	this(id, model, false);
    }
    
    void addDescriptor(Object descriptor)
    {
	_descriptors.add(descriptor);
    }

    void removeDescriptor(Object descriptor)
    {
	//
	// A straight remove uses equals(), which is not the desired behavior
	//
	java.util.Iterator p = _descriptors.iterator();
	while(p.hasNext())
	{
	    if(descriptor == p.next())
	    {
		p.remove();
		break;
	    }
	}
    }
    
    protected java.util.List _descriptors;
}