diff options
author | Benoit Foucher <benoit@zeroc.com> | 2008-04-25 12:25:28 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2008-04-25 12:25:28 +0200 |
commit | 9ed9d3b18e2040091056ed3e10c52877a1edcc98 (patch) | |
tree | 6f4d5eff20a82b367218f3655bcee97289037a18 /cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=3025 - Bogus IceStorm Make... (diff) | |
download | ice-9ed9d3b18e2040091056ed3e10c52877a1edcc98.tar.bz2 ice-9ed9d3b18e2040091056ed3e10c52877a1edcc98.tar.xz ice-9ed9d3b18e2040091056ed3e10c52877a1edcc98.zip |
Fixed bug 3039
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/demo/IceGrid/secure/application.xml | 1 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorBuilder.cpp | 25 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorBuilder.h | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/NodeCache.cpp | 23 | ||||
-rw-r--r-- | cpp/src/IceGrid/Util.cpp | 9 | ||||
-rw-r--r-- | cpp/src/IceGrid/Util.h | 2 |
6 files changed, 24 insertions, 38 deletions
diff --git a/cpp/demo/IceGrid/secure/application.xml b/cpp/demo/IceGrid/secure/application.xml index b838382d74d..30cf2770347 100644 --- a/cpp/demo/IceGrid/secure/application.xml +++ b/cpp/demo/IceGrid/secure/application.xml @@ -20,6 +20,7 @@ <property name="IceSSL.DefaultDir" value="certs"/> <property name="Ice.Admin.Endpoints" value="ssl -h 127.0.0.1"/> + <property name="IceSSL.TrustOnly.Client" value="CN=IceGrid Registry"/> <property name="IceSSL.TrustOnly.Server.Ice.Admin" value="CN=IceGrid Node"/> </properties> diff --git a/cpp/src/IceGrid/DescriptorBuilder.cpp b/cpp/src/IceGrid/DescriptorBuilder.cpp index c27b233fa94..67438840742 100644 --- a/cpp/src/IceGrid/DescriptorBuilder.cpp +++ b/cpp/src/IceGrid/DescriptorBuilder.cpp @@ -841,16 +841,6 @@ ServerDescriptorBuilder::init(const ServerDescriptorPtr& desc, const XmlAttribut _descriptor->iceVersion = attrs("ice-version", ""); } -void -ServerDescriptorBuilder::finish() -{ - if(!isSet(_descriptor->propertySet.properties, "Ice.Admin.Endpoints")) - { - _hiddenProperties.push_back(createProperty("Ice.Admin.Endpoints", "tcp -h 127.0.0.1")); - } - CommunicatorDescriptorBuilder::finish(); -} - ServiceDescriptorBuilder* ServerDescriptorBuilder::createService(const XmlAttributesHelper& attrs) { @@ -915,21 +905,6 @@ IceBoxDescriptorBuilder::init(const IceBoxDescriptorPtr& desc, const XmlAttribut _descriptor = desc; } -void -IceBoxDescriptorBuilder::finish() -{ - if(!isSet(_descriptor->propertySet.properties, "IceBox.InstanceName")) - { - _hiddenProperties.push_back(createProperty("IceBox.InstanceName", "${server}")); - } - - // - // The NodeCache takes care of setting Endpoints and RegisterProcess for old IceBox servers - // - - ServerDescriptorBuilder::finish(); -} - ServiceDescriptorBuilder* IceBoxDescriptorBuilder::createService(const XmlAttributesHelper& attrs) { diff --git a/cpp/src/IceGrid/DescriptorBuilder.h b/cpp/src/IceGrid/DescriptorBuilder.h index e6f23e573d4..f7c72393e39 100644 --- a/cpp/src/IceGrid/DescriptorBuilder.h +++ b/cpp/src/IceGrid/DescriptorBuilder.h @@ -257,7 +257,6 @@ public: ServerDescriptorBuilder(const Ice::CommunicatorPtr&); void init(const ServerDescriptorPtr&, const XmlAttributesHelper&); - virtual void finish(); virtual ServiceDescriptorBuilder* createService(const XmlAttributesHelper&); virtual ServiceInstanceDescriptorBuilder* createServiceInstance(const XmlAttributesHelper&); @@ -283,7 +282,6 @@ public: IceBoxDescriptorBuilder(const Ice::CommunicatorPtr&, const XmlAttributesHelper&); void init(const IceBoxDescriptorPtr&, const XmlAttributesHelper&); - virtual void finish(); virtual ServiceDescriptorBuilder* createService(const XmlAttributesHelper&); virtual ServiceInstanceDescriptorBuilder* createServiceInstance(const XmlAttributesHelper&); diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index 7e193f1f601..5bdb1e12b75 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -897,15 +897,26 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const iceVersion = getMMVersion(info.descriptor->iceVersion); } + server->processRegistered = false; if(iceVersion == 0 || iceVersion >= 30300) { props.push_back(createProperty("Ice.Admin.ServerId", info.descriptor->id)); - server->processRegistered = getProperty(info.descriptor->propertySet.properties, "Ice.Admin.Endpoints") != ""; + if(hasProperty(info.descriptor->propertySet.properties, "Ice.Admin.Endpoints")) + { + if(getProperty(info.descriptor->propertySet.properties, "Ice.Admin.Endpoints") != "") + { + server->processRegistered = true; + } + } + else + { + props.push_back(createProperty("Ice.Admin.Endpoints", "tcp -h 127.0.0.1")); + server->processRegistered = true; + } } else { props.push_back(createProperty("Ice.ServerId", info.descriptor->id)); - server->processRegistered = false; // Assigned for each communicator (see below) } props.push_back(createProperty("Ice.ProgramName", info.descriptor->id)); @@ -924,11 +935,15 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const props.push_back(createProperty("IceBox.Service." + s->name, s->entry + " --Ice.Config=\"" + path + "\"")); servicesStr += s->name + " "; } + if(!hasProperty(info.descriptor->propertySet.properties, "IceBox.InstanceName")) + { + props.push_back(createProperty("IceBox.InstanceName", server->id)); + } props.push_back(createProperty("IceBox.LoadOrder", servicesStr)); if(iceVersion != 0 && iceVersion < 30300) { - if(isSet(iceBox->propertySet.properties, "IceBox.ServiceManager.RegisterProcess")) + if(hasProperty(iceBox->propertySet.properties, "IceBox.ServiceManager.RegisterProcess")) { if(getProperty(iceBox->propertySet.properties, "IceBox.ServiceManager.RegisterProcess") != "0") { @@ -940,7 +955,7 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const props.push_back(createProperty("IceBox.ServiceManager.RegisterProcess", "1")); server->processRegistered = true; } - if(!isSet(iceBox->propertySet.properties, "IceBox.ServiceManager.Endpoints")) + if(!hasProperty(iceBox->propertySet.properties, "IceBox.ServiceManager.Endpoints")) { props.push_back(createProperty("IceBox.ServiceManager.Endpoints", "tcp -h 127.0.0.1")); } diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp index 3525eb7ba92..81675c30696 100644 --- a/cpp/src/IceGrid/Util.cpp +++ b/cpp/src/IceGrid/Util.cpp @@ -76,18 +76,16 @@ IceGrid::getProperty(const PropertyDescriptorSeq& properties, const string& name } bool -IceGrid::isSet(const PropertyDescriptorSeq& properties, const string& name) +IceGrid::hasProperty(const PropertyDescriptorSeq& properties, const string& name) { - bool result = false; - for(PropertyDescriptorSeq::const_iterator q = properties.begin(); q != properties.end(); ++q) { if(q->name == name) { - result = (q->value != ""); + return true; } } - return result; + return false; } PropertyDescriptor @@ -99,7 +97,6 @@ IceGrid::createProperty(const string& name, const string& value) return prop; } - int IceGrid::getMMVersion(const string& o) { diff --git a/cpp/src/IceGrid/Util.h b/cpp/src/IceGrid/Util.h index b6405185e0e..805f870dc69 100644 --- a/cpp/src/IceGrid/Util.h +++ b/cpp/src/IceGrid/Util.h @@ -42,7 +42,7 @@ std::string toString(const std::vector<std::string>&, const std::string& = std:: std::string toString(const Ice::Exception&); std::string getProperty(const PropertyDescriptorSeq&, const std::string&, const std::string& = std::string()); -bool isSet(const PropertyDescriptorSeq&, const std::string&); +bool hasProperty(const PropertyDescriptorSeq&, const std::string&); PropertyDescriptor createProperty(const std::string&, const std::string& = std::string()); |