diff options
author | Benoit Foucher <benoit@zeroc.com> | 2013-09-03 15:42:19 +0200 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2013-09-03 15:42:19 +0200 |
commit | 91f6ebb998532b36fc70187b641a5b7404060422 (patch) | |
tree | ac88e961c68e4b09eb819f4b57b9ecac56854567 /cpp/src/IceGrid/SessionManager.cpp | |
parent | ICE-5378 - Remove slice35d.dll from Windows installer (diff) | |
download | ice-91f6ebb998532b36fc70187b641a5b7404060422.tar.bz2 ice-91f6ebb998532b36fc70187b641a5b7404060422.tar.xz ice-91f6ebb998532b36fc70187b641a5b7404060422.zip |
Fixed ICE-5358 - allow IceGrid replica to initialize its database from another replica
Diffstat (limited to 'cpp/src/IceGrid/SessionManager.cpp')
-rw-r--r-- | cpp/src/IceGrid/SessionManager.cpp | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/cpp/src/IceGrid/SessionManager.cpp b/cpp/src/IceGrid/SessionManager.cpp index 409d931e5ee..540c61afcff 100644 --- a/cpp/src/IceGrid/SessionManager.cpp +++ b/cpp/src/IceGrid/SessionManager.cpp @@ -13,30 +13,28 @@ using namespace std; using namespace IceGrid; -SessionManager::SessionManager() +SessionManager::SessionManager(const Ice::CommunicatorPtr& communicator) : _communicator(communicator) { -} - -void -SessionManager::initQueryObjects(const Ice::LocatorPrx& prx) -{ - if(!prx) + if(communicator->getDefaultLocator()) { - return; - } + Ice::ObjectPrx prx = communicator->getDefaultLocator(); - // - // Derive the query objects from the locator proxy endpoints. - // - Ice::EndpointSeq endpoints = prx->ice_getEndpoints(); - Ice::Identity id = prx->ice_getIdentity(); - id.name = "Query"; - QueryPrx query = QueryPrx::uncheckedCast(prx->ice_identity(id)); - for(Ice::EndpointSeq::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) - { - Ice::EndpointSeq singleEndpoint; - singleEndpoint.push_back(*p); - _queryObjects.push_back(QueryPrx::uncheckedCast(query->ice_endpoints(singleEndpoint))); + // + // Derive the query objects from the locator proxy endpoints. + // + Ice::EndpointSeq endpoints = prx->ice_getEndpoints(); + Ice::Identity id = prx->ice_getIdentity(); + id.name = "Query"; + QueryPrx query = QueryPrx::uncheckedCast(prx->ice_identity(id)); + for(Ice::EndpointSeq::const_iterator p = endpoints.begin(); p != endpoints.end(); ++p) + { + Ice::EndpointSeq singleEndpoint; + singleEndpoint.push_back(*p); + _queryObjects.push_back(QueryPrx::uncheckedCast(query->ice_endpoints(singleEndpoint))); + } + + id.name = "InternalRegistry-Master"; + _master = InternalRegistryPrx::uncheckedCast(prx->ice_identity(id)->ice_endpoints(Ice::EndpointSeq())); } } |