diff options
author | Dwayne Boone <dwayne@zeroc.com> | 2002-07-17 17:40:04 +0000 |
---|---|---|
committer | Dwayne Boone <dwayne@zeroc.com> | 2002-07-17 17:40:04 +0000 |
commit | 56c88ea1a2fe81678664adabec8fb181711a8188 (patch) | |
tree | 220a2f90219113e597f8b6929bce3cd4f0b97f2a /cpp | |
parent | Modified configuration (diff) | |
download | ice-56c88ea1a2fe81678664adabec8fb181711a8188.tar.bz2 ice-56c88ea1a2fe81678664adabec8fb181711a8188.tar.xz ice-56c88ea1a2fe81678664adabec8fb181711a8188.zip |
Adapter and TopicManager name configurable based on service name
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/demo/IceStorm/clock/Publisher.cpp | 10 | ||||
-rw-r--r-- | cpp/demo/IceStorm/clock/Subscriber.cpp | 10 | ||||
-rw-r--r-- | cpp/demo/IceStorm/clock/config | 5 | ||||
-rw-r--r-- | cpp/src/IceStorm/Admin.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IceStorm/Service.cpp | 4 |
5 files changed, 23 insertions, 18 deletions
diff --git a/cpp/demo/IceStorm/clock/Publisher.cpp b/cpp/demo/IceStorm/clock/Publisher.cpp index 2d59891689e..dd09515c34d 100644 --- a/cpp/demo/IceStorm/clock/Publisher.cpp +++ b/cpp/demo/IceStorm/clock/Publisher.cpp @@ -34,15 +34,15 @@ Publisher::run(int argc, char* argv[]) { Ice::PropertiesPtr properties = communicator()->getProperties(); - static const string endpointsProperty = "IceStorm.TopicManager.Endpoints"; - string endpoints = properties->getProperty(endpointsProperty); - if(endpoints.empty()) + static const string referenceProperty = "IceStorm.TopicManager"; + string reference = properties->getProperty(referenceProperty); + if(reference.empty()) { - cerr << appName() << ": property `" << endpointsProperty << "' not set" << endl; + cerr << appName() << ": property `" << referenceProperty << "' not set" << endl; return EXIT_FAILURE; } - Ice::ObjectPrx base = communicator()->stringToProxy("TopicManager:" + endpoints); + Ice::ObjectPrx base = communicator()->stringToProxy(reference); IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); if(!manager) { diff --git a/cpp/demo/IceStorm/clock/Subscriber.cpp b/cpp/demo/IceStorm/clock/Subscriber.cpp index 8ff22bbd6c9..6e266e6d3b8 100644 --- a/cpp/demo/IceStorm/clock/Subscriber.cpp +++ b/cpp/demo/IceStorm/clock/Subscriber.cpp @@ -37,15 +37,15 @@ Subscriber::run(int argc, char* argv[]) { Ice::PropertiesPtr properties = communicator()->getProperties(); - static const string endpointsProperty = "IceStorm.TopicManager.Endpoints"; - string endpoints = properties->getProperty(endpointsProperty); - if(endpoints.empty()) + static const string referenceProperty = "IceStorm.TopicManager"; + string reference = properties->getProperty(referenceProperty); + if(reference.empty()) { - cerr << appName() << ": property `" << endpointsProperty << "' not set" << endl; + cerr << appName() << ": property `" << referenceProperty << "' not set" << endl; return EXIT_FAILURE; } - Ice::ObjectPrx base = communicator()->stringToProxy("TopicManager:" + endpoints); + Ice::ObjectPrx base = communicator()->stringToProxy(reference); IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); if(!manager) { diff --git a/cpp/demo/IceStorm/clock/config b/cpp/demo/IceStorm/clock/config index 0e57696bb9c..a7e2c7be493 100644 --- a/cpp/demo/IceStorm/clock/config +++ b/cpp/demo/IceStorm/clock/config @@ -5,6 +5,11 @@ IceStorm.TopicManager.Endpoints=default -p 10000 # +# This property is used by the clients to connect to IceStorm. +# +IceStorm.TopicManager=IceStorm.TopicManager: default -p 10000 + +# # TopicManager Tracing # # 0 = no tracing diff --git a/cpp/src/IceStorm/Admin.cpp b/cpp/src/IceStorm/Admin.cpp index 60236265772..c06a44b304b 100644 --- a/cpp/src/IceStorm/Admin.cpp +++ b/cpp/src/IceStorm/Admin.cpp @@ -157,19 +157,19 @@ Client::run(int argc, char* argv[]) return EXIT_FAILURE; } - const char* managerEndpointsProperty = "IceStorm.TopicManager.Endpoints"; - string managerEndpoints = properties->getProperty(managerEndpointsProperty); - if(managerEndpoints.empty()) + const char* managerReferenceProperty = "IceStorm.TopicManager"; + string managerReference = properties->getProperty(managerReferenceProperty); + if(managerReference.empty()) { - cerr << appName() << ": property `" << managerEndpointsProperty << "' is not set" << endl; + cerr << appName() << ": property `" << managerReferenceProperty << "' is not set" << endl; return EXIT_FAILURE; } - ObjectPrx base = communicator()->stringToProxy("TopicManager:" + managerEndpoints); + ObjectPrx base = communicator()->stringToProxy(managerReference); IceStorm::TopicManagerPrx manager = IceStorm::TopicManagerPrx::checkedCast(base); if(!manager) { - cerr << appName() << ": `" << managerEndpoints << "' is not running" << endl; + cerr << appName() << ": `" << managerReference << "' is not running" << endl; return EXIT_FAILURE; } diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp index 3c40543cd16..6edbcb58bf3 100644 --- a/cpp/src/IceStorm/Service.cpp +++ b/cpp/src/IceStorm/Service.cpp @@ -76,9 +76,9 @@ IceStorm::Service::start(const string& name, TraceLevelsPtr traceLevels = new TraceLevels(name, properties, communicator->getLogger()); string endpoints = properties->getProperty(name + ".TopicManager.Endpoints"); - _adapter = communicator->createObjectAdapterWithEndpoints("TopicManager", endpoints); + _adapter = communicator->createObjectAdapterWithEndpoints(name + ".TopicManagerAdapter", endpoints); _manager = new TopicManagerI(communicator, _adapter, traceLevels, dbEnv, dbTopicManager); - _adapter->add(_manager, stringToIdentity("TopicManager")); + _adapter->add(_manager, stringToIdentity(name + ".TopicManager")); _adapter->activate(); } |