summaryrefslogtreecommitdiff
path: root/cpp/src/IcePack/ServerBuilder.cpp
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2004-02-29 20:42:15 +0000
committerMark Spruiell <mes@zeroc.com>2004-02-29 20:42:15 +0000
commita475885faf424df5a1b5a1c32db87e98fb8cb2fe (patch)
tree1e79c93d560dcd4fa983a45346602343fa71d696 /cpp/src/IcePack/ServerBuilder.cpp
parentfix (diff)
downloadice-a475885faf424df5a1b5a1c32db87e98fb8cb2fe.tar.bz2
ice-a475885faf424df5a1b5a1c32db87e98fb8cb2fe.tar.xz
ice-a475885faf424df5a1b5a1c32db87e98fb8cb2fe.zip
adding Ice::Process for graceful shutdown of IcePack servers
Diffstat (limited to 'cpp/src/IcePack/ServerBuilder.cpp')
-rw-r--r--cpp/src/IcePack/ServerBuilder.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/cpp/src/IcePack/ServerBuilder.cpp b/cpp/src/IcePack/ServerBuilder.cpp
index 1d0283daaea..c267e7189d2 100644
--- a/cpp/src/IcePack/ServerBuilder.cpp
+++ b/cpp/src/IcePack/ServerBuilder.cpp
@@ -254,9 +254,9 @@ IcePack::ServerHandler::startElement(const string& name, const IceXML::Attribute
// TODO: is the server name a good category?
//
_builder.addProperty("IceBox.ServiceManager.Identity", _builder.substitute("${name}/ServiceManager"));
-
+
_builder.registerAdapter("IceBox.ServiceManager",
- getAttributeValue(attrs, "endpoints"),
+ getAttributeValue(attrs, "endpoints"), true,
_builder.getDefaultAdapterId("IceBox.ServiceManager"));
}
else if(kind == "java-icebox")
@@ -271,7 +271,7 @@ IcePack::ServerHandler::startElement(const string& name, const IceXML::Attribute
_builder.addProperty("IceBox.ServiceManager.Identity", _builder.substitute("${name}/ServiceManager"));
_builder.registerAdapter("IceBox.ServiceManager",
- getAttributeValue(attrs, "endpoints"),
+ getAttributeValue(attrs, "endpoints"), true,
_builder.getDefaultAdapterId("IceBox.ServiceManager"));
}
}
@@ -286,7 +286,9 @@ IcePack::ServerHandler::startElement(const string& name, const IceXML::Attribute
{
assert(!_currentAdapterId.empty());
string adapterName = getAttributeValue(attrs, "name");
- _builder.registerAdapter(adapterName, getAttributeValue(attrs, "endpoints"), _currentAdapterId);
+ bool registerProcess = getAttributeValueWithDefault(attrs, "register", "false") == "true";
+ _builder.registerAdapter(adapterName, getAttributeValue(attrs, "endpoints"), registerProcess,
+ _currentAdapterId);
}
}
@@ -533,7 +535,8 @@ IcePack::ServerBuilder::registerServer()
}
void
-IcePack::ServerBuilder::registerAdapter(const string& name, const string& endpoints, const string& adapterId)
+IcePack::ServerBuilder::registerAdapter(const string& name, const string& endpoints, bool registerProcess,
+ const string& adapterId)
{
AdapterRegistryPrx adapterRegistry = _nodeInfo->getAdapterRegistry();
if(!adapterRegistry)
@@ -568,6 +571,10 @@ IcePack::ServerBuilder::registerAdapter(const string& name, const string& endpoi
//
addProperty(name + ".Endpoints", endpoints);
addProperty(name + ".AdapterId", adapterId);
+ if(registerProcess)
+ {
+ addProperty(name + ".RegisterProcess", "1");
+ }
}
void