From f185946cfbced2bf5e6bf8deb0993a18057664d5 Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Thu, 20 Sep 2007 15:55:05 -0400 Subject: Squashed commit of the following: commit 2eba3087584d54d3ba98ef50724710fd34d84e0b Author: Bernard Normier Date: Thu Sep 20 15:53:49 2007 -0400 New ice-version attribute, IceGrid now generates Ice.Admin.* properties --- cpp/src/IceGrid/NodeCache.cpp | 51 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 44 insertions(+), 7 deletions(-) (limited to 'cpp/src/IceGrid/NodeCache.cpp') diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index c222c680cad..f88258488fc 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -824,6 +824,9 @@ NodeEntry::finishedRegistration(const Ice::Exception& ex) InternalServerDescriptorPtr NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const { + // + // Note that at this point all variables in info have been resolved + // assert(_session); InternalServerDescriptorPtr server = new InternalServerDescriptor(); @@ -846,7 +849,7 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const } server->options = info.descriptor->options; server->envs = info.descriptor->envs; - server->processRegistered = false; // Assigned for each communicator (see below) + // server->logs: assigned for each communicator (see below) // server->adapters: assigned for each communicator (see below) // server->dbEnvs: assigned for each communicator (see below) @@ -857,7 +860,30 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const // PropertyDescriptorSeq& props = server->properties["config"]; props.push_back(createProperty("# Server configuration")); - props.push_back(createProperty("Ice.ServerId", info.descriptor->id)); + + // + // For newer versions of Ice, we generate Ice.Admin properties: + // + int iceVersion = 0; + if(info.descriptor->iceVersion != "") + { + iceVersion = getMMVersion(info.descriptor->iceVersion); + } + + 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") != ""; + } + else + { + props.push_back(createProperty("Ice.ServerId", info.descriptor->id)); + server->processRegistered = false; // Assigned for each communicator (see below) + } + + // props.push_back(createProperty("Ice.ServerId", info.descriptor->id)); props.push_back(createProperty("Ice.ProgramName", info.descriptor->id)); // @@ -877,11 +903,22 @@ NodeEntry::getInternalServerDescriptor(const ServerInfo& info) const } props.push_back(createProperty("IceBox.LoadOrder", servicesStr)); - if(iceBox->adapters.empty() && - getProperty(iceBox->propertySet.properties, "IceBox.ServiceManager.RegisterProcess") != "0") - { - server->processRegistered = true; - } + + if(iceVersion != 0 && iceVersion < 30300) + { + if(isSet(iceBox->propertySet.properties, "IceBox.ServiceManager.RegisterProcess")) + { + if(getProperty(iceBox->propertySet.properties, "IceBox.ServiceManager.RegisterProcess") != "0") + { + server->processRegistered = true; + } + } + else + { + props.push_back(createProperty("IceBox.ServiceManager.RegisterProcess", "1")); + server->processRegistered = true; + } + } } // -- cgit v1.2.3