summaryrefslogtreecommitdiff
path: root/java/src/IceGrid/TreeNode/ServiceInstance.java
blob: 3cf2ddf41ac4e590a2cd7d6ec35e5d5e46c24ed2 (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
// **********************************************************************
//
// 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.ServiceInstanceDescriptor;
import IceGrid.TemplateDescriptor;

class ServiceInstance extends Parent
{
    ServiceInstance(ServiceInstanceDescriptor descriptor)
    {
	super(descriptor.descriptor.name);
	_descriptor = descriptor;
	
	if(_descriptor.descriptor != null)
	{
	    _adapters = new Adapters(_descriptor.descriptor.adapters, false);
	    addChild(_adapters);
	    
	    _dbEnvs = new DbEnvs(_descriptor.descriptor.dbEnvs, false);
	    addChild(_dbEnvs);
	}
    }

    public String toString()
    {
	String result = _descriptor.descriptor.name;

	if(!_descriptor.template.equals(""))
	{
	    result += ": " + templateLabel(_descriptor.template, 
					   _descriptor.parameterValues.values());
	}
	return result;
    }

    private ServiceInstanceDescriptor _descriptor;
    private Adapters _adapters;
    private DbEnvs _dbEnvs;
}