diff options
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/IceBox/Admin.cpp | 34 | ||||
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 6 |
2 files changed, 32 insertions, 8 deletions
diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp index ba7420c9511..07d05a0899c 100644 --- a/cpp/src/IceBox/Admin.cpp +++ b/cpp/src/IceBox/Admin.cpp @@ -88,22 +88,40 @@ Client::run(int argc, char* argv[]) return EXIT_SUCCESS; } - const char* managerProperty = "IceBox.ServiceManager"; - string managerProxy = properties->getProperty(managerProperty); - if(managerProxy.empty()) + + // + // TODO: Simplify configuration, this is way too complicated. We + // should most likely have only two configuration variables, one + // for the identity and the other one for the endpoints. + // + + string namePrefix = properties->getProperty("IceBox.Name"); + if(!namePrefix.empty()) { - const char* nameProperty = "IceBox.Name"; - string name = properties->getProperty(nameProperty); - if(!properties->getProperty("Ice.Default.Locator").empty() && !name.empty()) + namePrefix += "."; + } + + string managerProxy; + + string managerEndpoints = properties->getProperty("IceBox.ServiceManager.Endpoints"); + if(managerEndpoints.empty()) + { + if(!properties->getProperty("Ice.Default.Locator").empty() && !namePrefix.empty()) { - managerProxy = name + ".ServiceManager@" + name + ".ServiceManagerAdapter"; + managerProxy = namePrefix + "ServiceManager@" + namePrefix + "ServiceManagerAdapter"; } else { - cerr << appName() << ": property `" << managerProperty << "' is not set" << endl; + cerr << appName() << ": property `IceBox.ServiceManager.Endpoints' is not set" << endl; return EXIT_FAILURE; } } + else + { + string managerIdentity = properties->getPropertyWithDefault("IceBox.ServiceManager.Identity", + "ServiceManager"); + managerProxy = namePrefix + managerIdentity + ":" + managerEndpoints; + } ObjectPrx base = communicator()->stringToProxy(managerProxy); IceBox::ServiceManagerPrx manager = IceBox::ServiceManagerPrx::checkedCast(base); diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index 12c67a7d124..b39622d032a 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -57,6 +57,12 @@ IceBox::ServiceManagerI::run() ServiceManagerPtr obj = this; // + // TODO: Simplify configuration, this is way too complicated. We + // should most likely have only two configuration properties, one + // for the identity and the other one for the endpoints. + // + + // // Prefix the adapter name and object identity with the value // of the IceBox.Name property. // |