diff options
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())); } } |