summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/NodeI.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2005-11-11 13:56:10 +0000
committerBenoit Foucher <benoit@zeroc.com>2005-11-11 13:56:10 +0000
commit930e9797f420ed538bc4e55ffeb76b8596e12715 (patch)
tree2fdac6237a544c168430c6e94804551117e094e0 /cpp/src/IceGrid/NodeI.cpp
parentfix a copy problem (diff)
downloadice-930e9797f420ed538bc4e55ffeb76b8596e12715.tar.bz2
ice-930e9797f420ed538bc4e55ffeb76b8596e12715.tar.xz
ice-930e9797f420ed538bc4e55ffeb76b8596e12715.zip
:activate() would contact the locator even if the OA id was empty.
Fixed a bug where ${node.os} for example couldn't be used in distribution directories. Unknown elements in XML file are now treated as errors.
Diffstat (limited to 'cpp/src/IceGrid/NodeI.cpp')
-rw-r--r--cpp/src/IceGrid/NodeI.cpp38
1 files changed, 23 insertions, 15 deletions
diff --git a/cpp/src/IceGrid/NodeI.cpp b/cpp/src/IceGrid/NodeI.cpp
index 2b428ff04af..0fdb413263c 100644
--- a/cpp/src/IceGrid/NodeI.cpp
+++ b/cpp/src/IceGrid/NodeI.cpp
@@ -273,8 +273,8 @@ NodeI::destroyServer_async(const AMD_Node_destroyServerPtr& amdCB, const string&
void
NodeI::patch(const string& application,
+ const string& server,
const DistributionDescriptor& appDistrib,
- const DistributionDescriptorDict& serverDistribs,
bool shutdown,
const Ice::Current&)
{
@@ -288,20 +288,17 @@ NodeI::patch(const string& application,
}
_patchInProgress.insert(application);
- if(!appDistrib.icepatch.empty())
+ if(server.empty() || !appDistrib.icepatch.empty())
{
servers = getApplicationServers(application);
}
else
{
- for(DistributionDescriptorDict::const_iterator p = serverDistribs.begin(); p != serverDistribs.end(); ++p)
+ Ice::Identity id = createServerIdentity(server);
+ ServerIPtr svr = ServerIPtr::dynamicCast(_adapter->find(id));
+ if(svr)
{
- Ice::Identity id = createServerIdentity(p->first);
- ServerIPtr server = ServerIPtr::dynamicCast(_adapter->find(id));
- if(server)
- {
- servers.insert(server);
- }
+ servers.insert(svr);
}
}
}
@@ -323,7 +320,7 @@ NodeI::patch(const string& application,
}
}
- if(!running.empty())
+ if((servers.empty() || !appDistrib.icepatch.empty()) && !running.empty())
{
PatchException ex;
ex.reason = "patch on node `" + _name + "' failed:\n";
@@ -360,16 +357,27 @@ NodeI::patch(const string& application,
}
//
- // Patch the servers.
+ // Patch the server(s).
//
- for(DistributionDescriptorDict::const_iterator p = serverDistribs.begin(); p != serverDistribs.end(); ++p)
+ for(s = servers.begin(); s != servers.end(); ++s)
{
- icepatch = FileServerPrx::checkedCast(getCommunicator()->stringToProxy(p->second.icepatch));
+ if(!server.empty() && (*s)->getId() != server)
+ {
+ continue;
+ }
+
+ DistributionDescriptor dist = (*s)->getDistribution();
+ icepatch = FileServerPrx::checkedCast(getCommunicator()->stringToProxy(dist.icepatch));
if(!icepatch)
{
- throw "proxy `" + p->second.icepatch + "' is not a file server.";
+ throw "proxy `" + dist.icepatch + "' is not a file server.";
+ }
+ patch(icepatch, "servers/" + (*s)->getId() + "/distrib", dist.directories);
+
+ if(!server.empty())
+ {
+ break;
}
- patch(icepatch, "servers/" + p->first + "/distrib", p->second.directories);
}
}
catch(const Ice::LocalException& ex)