diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-07-25 17:25:58 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-07-25 17:25:58 +0000 |
commit | 95779a66eb32286140dec13a1641f5723d322168 (patch) | |
tree | dd86f141a0460bfa7746bc563cde037eedd7cd84 /cpp/src/IceGrid/IceGridNode.cpp | |
parent | http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=1189 (diff) | |
download | ice-95779a66eb32286140dec13a1641f5723d322168.tar.bz2 ice-95779a66eb32286140dec13a1641f5723d322168.tar.xz ice-95779a66eb32286140dec13a1641f5723d322168.zip |
More replication work.
Diffstat (limited to 'cpp/src/IceGrid/IceGridNode.cpp')
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index 51e168fdff6..219b70a4457 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -253,20 +253,19 @@ NodeService::start(int argc, char* argv[]) } // - // TODO: XXX: set communicator->setDefaultLocator() here?! I - // believe this is necessary for the NodeSessionManager. - // - - - // - // Set the Ice.Default.Locator property to point to the - // collocated locator (this property is passed by the - // activator to each activated server). + // Set the default locator property to point to the collocated + // locator (this property is passed by the activator to each + // activated server). The default locator is also needed by + // the node session manager. // - const string instanceNameProperty = "IceGrid.InstanceName"; - const string locatorId = properties->getPropertyWithDefault(instanceNameProperty, "IceGrid") + "/Locator"; - string locatorPrx = locatorId + ":" + properties->getProperty("IceGrid.Registry.Client.Endpoints"); - properties->setProperty("Ice.Default.Locator", locatorPrx); + if(properties->getProperty("Ice.Default.Locator").empty()) + { + const string instanceNameProperty = "IceGrid.InstanceName"; + const string locatorId = properties->getPropertyWithDefault(instanceNameProperty, "IceGrid") + "/Locator"; + string locatorPrx = locatorId + ":" + properties->getProperty("IceGrid.Registry.Client.Endpoints"); + communicator()->setDefaultLocator(LocatorPrx::uncheckedCast(communicator()->stringToProxy(locatorPrx))); + properties->setProperty("Ice.Default.Locator", locatorPrx); + } } else if(properties->getProperty("Ice.Default.Locator").empty()) { @@ -455,8 +454,8 @@ NodeService::start(int argc, char* argv[]) AdminPrx admin; try { - const string instanceNameProperty = "IceGrid.InstanceName"; - const string adminId = properties->getPropertyWithDefault(instanceNameProperty, "IceGrid") + "/Admin"; + const string instanceName = communicator()->getDefaultLocator()->ice_getIdentity().category; + const string adminId = instanceName + "/Admin"; admin = AdminPrx::checkedCast(communicator()->stringToProxy(adminId)); } catch(const LocalException& ex) |