diff options
author | Bernard Normier <bernard@zeroc.com> | 2006-08-03 20:02:57 +0000 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2006-08-03 20:02:57 +0000 |
commit | fe50c3c9389caf6989e35b09c2a171db59eb163f (patch) | |
tree | 7bf735fc84efb805a4587441f5565a50e4ee51c6 /cpp/src/IceBox/ServiceManagerI.cpp | |
parent | update dependencies (diff) | |
download | ice-fe50c3c9389caf6989e35b09c2a171db59eb163f.tar.bz2 ice-fe50c3c9389caf6989e35b09c2a171db59eb163f.tar.xz ice-fe50c3c9389caf6989e35b09c2a171db59eb163f.zip |
Fixed bugs #1284 and #1288
Diffstat (limited to 'cpp/src/IceBox/ServiceManagerI.cpp')
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 64 |
1 files changed, 40 insertions, 24 deletions
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index fa45e173c05..d9a0e8e983e 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -283,41 +283,57 @@ IceBox::ServiceManagerI::start(const string& service, const string& entryPoint, // property set. // PropertiesPtr properties = _communicator->getProperties(); + if(properties->getPropertyAsInt("IceBox.UseSharedCommunicator." + service) > 0) { - PropertiesPtr fileProperties = createProperties(serviceArgs); - properties->parseCommandLineOptions("", fileProperties->getCommandLineOptions()); - - serviceArgs = properties->parseIceCommandLineOptions(serviceArgs); - serviceArgs = properties->parseCommandLineOptions(service, serviceArgs); - } - else - { - PropertiesPtr serviceProperties = properties->clone(); + PropertiesPtr serviceProperties = createProperties(serviceArgs, properties); // - // Append the service name to the program name if not empty. + // Erase properties in 'properties' // - string name = serviceProperties->getProperty("Ice.ProgramName"); - if(name != service) + PropertyDict allProps = properties->getPropertiesForPrefix(""); + for(PropertyDict::iterator p = allProps.begin(); p != allProps.end(); ++p) { - name = name.empty() ? service : name + "-" + service; + if(serviceProperties->getProperty(p->first) == "") + { + properties->setProperty(p->first, ""); + } } - + // - // Load property file eventually specified with - // --Ice.Config and add the properties from the file to - // the service properties. + // Put all serviceProperties into 'properties' // - PropertiesPtr fileProperties = createProperties(serviceArgs); - serviceProperties->parseCommandLineOptions("", fileProperties->getCommandLineOptions()); - - serviceProperties->setProperty("Ice.ProgramName", name); - + properties->parseCommandLineOptions("", serviceProperties->getCommandLineOptions()); + + // + // Parse <service>.* command line options + // (the Ice command line options were parse by the createProperties above) + // + serviceArgs = properties->parseCommandLineOptions(service, serviceArgs); + } + else + { + string name = properties->getProperty("Ice.ProgramName"); + PropertiesPtr serviceProperties = createProperties(serviceArgs, properties); + + if(name == properties->getProperty("Ice.ProgramName")) + { + // + // If the service did not set its own program-name, and + // the icebox program-name != service, append the service name to the + // program name. + // + if(name != service) + { + name = name.empty() ? service : name + "-" + service; + } + serviceProperties->setProperty("Ice.ProgramName", name); + } + // - // Parse Ice and <service>.* command line options. + // Parse <service>.* command line options + // (the Ice command line options were parsed by the createProperties above) // - serviceArgs = serviceProperties->parseIceCommandLineOptions(serviceArgs); serviceArgs = serviceProperties->parseCommandLineOptions(service, serviceArgs); // |