diff options
author | Benoit Foucher <benoit@zeroc.com> | 2002-07-15 20:30:49 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2002-07-15 20:30:49 +0000 |
commit | 0873a7dc59a90c37b38170d82743e36889d3570c (patch) | |
tree | d198f4dda08354fd6115b009cb347900af0aa46e /cpp/src/IceBox/ServiceManagerI.cpp | |
parent | Added IceBox.Name configuration variable. (diff) | |
download | ice-0873a7dc59a90c37b38170d82743e36889d3570c.tar.bz2 ice-0873a7dc59a90c37b38170d82743e36889d3570c.tar.xz ice-0873a7dc59a90c37b38170d82743e36889d3570c.zip |
Added IceBox.Name configuration variable
Diffstat (limited to 'cpp/src/IceBox/ServiceManagerI.cpp')
-rw-r--r-- | cpp/src/IceBox/ServiceManagerI.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/cpp/src/IceBox/ServiceManagerI.cpp b/cpp/src/IceBox/ServiceManagerI.cpp index 97c67085191..c8ef663aba8 100644 --- a/cpp/src/IceBox/ServiceManagerI.cpp +++ b/cpp/src/IceBox/ServiceManagerI.cpp @@ -56,14 +56,29 @@ IceBox::ServiceManagerI::run() { ServiceManagerPtr obj = this; + // + // Prefix the adapter name and object identity with the value + // of the IceBox.Name property. + // + PropertiesPtr properties = _server->communicator()->getProperties(); + string namePrefix = properties->getProperty("IceBox.Name"); + if(!namePrefix.empty()) + { + namePrefix += "."; + } + // // Create an object adapter. Services probably should NOT share // this object adapter, as the endpoint(s) for this object adapter // will most likely need to be firewalled for security reasons. // - ObjectAdapterPtr adapter = _server->communicator()->createObjectAdapterFromProperty("ServiceManagerAdapter", - "IceBox.ServiceManager.Endpoints"); - adapter->add(obj, stringToIdentity("ServiceManager")); + ObjectAdapterPtr adapter = + _server->communicator()->createObjectAdapterFromProperty(namePrefix + "ServiceManagerAdapter", + "IceBox.ServiceManager.Endpoints"); + + string identity = properties->getPropertyWithDefault("IceBox.ServiceManager.Identity", + namePrefix + "ServiceManager"); + adapter->add(obj, stringToIdentity(identity)); // // Load and initialize the services defined in the property set @@ -73,7 +88,7 @@ IceBox::ServiceManagerI::run() // IceBox.Service.Foo=entry_point [args] // const string prefix = "IceBox.Service."; - PropertiesPtr properties = _server->communicator()->getProperties(); + PropertyDict services = properties->getPropertiesForPrefix(prefix); PropertyDict::const_iterator p; for(p = services.begin(); p != services.end(); ++p) |