summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/ApplicationBuilder.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2002-09-17 21:24:51 +0000
committerBenoit Foucher <benoit@zeroc.com>2002-09-17 21:24:51 +0000
commit77f2ff38b10a12f7189ab10dba239f7b53417986 (patch)
treee203c24868f907dc8c3f8e5525e1c4c68aa308fb /cpp/src/IcePack/ApplicationBuilder.cpp
parentAdded support for --case-sensitive option (attribute casesensitive). (diff)
downloadice-77f2ff38b10a12f7189ab10dba239f7b53417986.tar.bz2
ice-77f2ff38b10a12f7189ab10dba239f7b53417986.tar.xz
ice-77f2ff38b10a12f7189ab10dba239f7b53417986.zip
Added ${parent} variable to get the name of the parent component.
Added attribute targets to server and service elements. More clean up.
Diffstat (limited to 'cpp/src/IcePack/ApplicationBuilder.cpp')
-rw-r--r--cpp/src/IcePack/ApplicationBuilder.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/cpp/src/IcePack/ApplicationBuilder.cpp b/cpp/src/IcePack/ApplicationBuilder.cpp
index 687a1e11150..2725670d1ea 100644
--- a/cpp/src/IcePack/ApplicationBuilder.cpp
+++ b/cpp/src/IcePack/ApplicationBuilder.cpp
@@ -164,11 +164,13 @@ IcePack::ApplicationHandler::startElement(const XMLCh* name, AttributeList& attr
throw DeploySAXParseException("Server element is not allowed outside the scope of a node element",
_locator);
}
+
string name = getAttributeValue(attrs, "name");
string descriptor = _builder.toLocation(getAttributeValue(attrs, "descriptor"));
string binpath = _builder.toLocation(getAttributeValueWithDefault(attrs, "binpath", ""));
string libpath = getAttributeValueWithDefault(attrs, "libpath", "");
- _builder.addServer(name, _currentNode, descriptor, binpath, libpath);
+ string targets = getAttributeValueWithDefault(attrs, "targets", "");
+ _builder.addServer(name, _currentNode, descriptor, binpath, libpath, targets);
}
}
@@ -192,7 +194,7 @@ IcePack::ApplicationHandler::endElement(const XMLCh* name)
IcePack::ApplicationBuilder::ApplicationBuilder(const Ice::CommunicatorPtr& communicator,
const NodeRegistryPtr& nodeRegistry,
const vector<string>& targets) :
- ComponentBuilder(communicator, "", targets),
+ ComponentBuilder(communicator, map<string, string>(), targets),
_nodeRegistry(nodeRegistry)
{
}
@@ -210,7 +212,8 @@ IcePack::ApplicationBuilder::addServer(const string& name,
const string& nodeName,
const string& descriptor,
const string& binpath,
- const string& libpath)
+ const string& libpath,
+ const string& additionalTargets)
{
if(name.empty())
{
@@ -224,6 +227,9 @@ IcePack::ApplicationBuilder::addServer(const string& name,
{
throw DeploySAXParseException("descriptor attribute value is empty", _locator);
}
+
+ vector<string> targets = toTargets(additionalTargets);
+ copy(_targets.begin(), _targets.end(), back_inserter(targets));
NodePrx node;
try
@@ -242,7 +248,7 @@ IcePack::ApplicationBuilder::addServer(const string& name,
try
{
ServerDeployerPrx deployer = node->getServerDeployer();
- _tasks.push_back(new AddServer(deployer, nodeName, name, descriptor, binpath, libpath, _targets));
+ _tasks.push_back(new AddServer(deployer, nodeName, name, descriptor, binpath, libpath, targets));
}
catch(::Ice::LocalException&)
{