diff options
author | Bernard Normier <bernard@zeroc.com> | 2016-07-27 19:30:37 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2016-07-27 19:30:37 -0400 |
commit | 883edab4361e58957796f25d5fc55cfb41f0f6ea (patch) | |
tree | fc90adc372b66bf0becf4c0912794c64af250a29 /cpp/src/IceGrid | |
parent | ICE-7242 - Cross test updates (diff) | |
download | ice-883edab4361e58957796f25d5fc55cfb41f0f6ea.tar.bz2 ice-883edab4361e58957796f25d5fc55cfb41f0f6ea.tar.xz ice-883edab4361e58957796f25d5fc55cfb41f0f6ea.zip |
Deprecate Communicator::stringToIdentity and identityToString
Diffstat (limited to 'cpp/src/IceGrid')
-rw-r--r-- | cpp/src/IceGrid/AdminI.cpp | 6 | ||||
-rw-r--r-- | cpp/src/IceGrid/AllocatableObjectCache.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceGrid/Client.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/Database.cpp | 18 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorBuilder.cpp | 7 | ||||
-rw-r--r-- | cpp/src/IceGrid/DescriptorHelper.cpp | 12 | ||||
-rw-r--r-- | cpp/src/IceGrid/IceGridNode.cpp | 2 | ||||
-rw-r--r-- | cpp/src/IceGrid/LocatorI.cpp | 8 | ||||
-rw-r--r-- | cpp/src/IceGrid/ObjectCache.cpp | 17 | ||||
-rw-r--r-- | cpp/src/IceGrid/Parser.cpp | 10 | ||||
-rw-r--r-- | cpp/src/IceGrid/RegistryI.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceGrid/ReplicaSessionManager.cpp | 4 | ||||
-rw-r--r-- | cpp/src/IceGrid/Util.cpp | 4 |
13 files changed, 51 insertions, 51 deletions
diff --git a/cpp/src/IceGrid/AdminI.cpp b/cpp/src/IceGrid/AdminI.cpp index edfb98f03a7..0e5f6a1f8be 100644 --- a/cpp/src/IceGrid/AdminI.cpp +++ b/cpp/src/IceGrid/AdminI.cpp @@ -688,7 +688,7 @@ AdminI::updateObject(const Ice::ObjectPrx& proxy, const ::Ice::Current&) if(id.category == _database->getInstanceName()) { DeploymentException ex; - ex.reason = "updating object `" + _database->getCommunicator()->identityToString(id) + "' is not allowed:\n"; + ex.reason = "updating object `" + identityToString(id) + "' is not allowed:\n"; ex.reason += "objects with identity category `" + id.category + "' are managed by IceGrid"; throw ex; } @@ -709,7 +709,7 @@ AdminI::addObjectWithType(const Ice::ObjectPrx& proxy, const string& type, const if(id.category == _database->getInstanceName()) { DeploymentException ex; - ex.reason = "adding object `" + _database->getCommunicator()->identityToString(id) + "' is not allowed:\n"; + ex.reason = "adding object `" + identityToString(id) + "' is not allowed:\n"; ex.reason += "objects with identity category `" + id.category + "' are managed by IceGrid"; throw ex; } @@ -727,7 +727,7 @@ AdminI::removeObject(const Ice::Identity& id, const Ice::Current&) if(id.category == _database->getInstanceName()) { DeploymentException ex; - ex.reason = "removing object `" + _database->getCommunicator()->identityToString(id) + "' is not allowed:\n"; + ex.reason = "removing object `" + identityToString(id) + "' is not allowed:\n"; ex.reason += "objects with identity category `" + id.category + "' are managed by IceGrid"; throw ex; } diff --git a/cpp/src/IceGrid/AllocatableObjectCache.cpp b/cpp/src/IceGrid/AllocatableObjectCache.cpp index 3a9799e1eac..ae3294bb51c 100644 --- a/cpp/src/IceGrid/AllocatableObjectCache.cpp +++ b/cpp/src/IceGrid/AllocatableObjectCache.cpp @@ -134,7 +134,7 @@ AllocatableObjectCache::add(const ObjectInfo& info, const AllocatablePtr& parent if(getImpl(id)) { Ice::Error out(_communicator->getLogger()); - out << "can't add duplicate allocatable object `" << _communicator->identityToString(id) << "'"; + out << "can't add duplicate allocatable object `" << identityToString(id) << "'"; return; } @@ -151,7 +151,7 @@ AllocatableObjectCache::add(const ObjectInfo& info, const AllocatablePtr& parent if(_traceLevels && _traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << "added allocatable object `" << _communicator->identityToString(id) << "'"; + out << "added allocatable object `" << identityToString(id) << "'"; } } @@ -177,7 +177,7 @@ AllocatableObjectCache::remove(const Ice::Identity& id) if(!entry) { Ice::Error out(_communicator->getLogger()); - out << "can't remove unknown object `" << _communicator->identityToString(id) << "'"; + out << "can't remove unknown object `" << identityToString(id) << "'"; } removeImpl(id); @@ -191,7 +191,7 @@ AllocatableObjectCache::remove(const Ice::Identity& id) if(_traceLevels && _traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << "removed allocatable object `" << _communicator->identityToString(id) << "'"; + out << "removed allocatable object `" << identityToString(id) << "'"; } } diff --git a/cpp/src/IceGrid/Client.cpp b/cpp/src/IceGrid/Client.cpp index 2087bb3359e..1876182b942 100644 --- a/cpp/src/IceGrid/Client.cpp +++ b/cpp/src/IceGrid/Client.cpp @@ -449,7 +449,7 @@ Client::run(StringSeq& originalArgs) ObjectAdapterPtr adapter = communicator()->createObjectAdapterWithEndpoints("FileParser", "tcp -h localhost"); adapter->activate(); - ObjectPrx proxy = adapter->add(new FileParserI, communicator()->stringToIdentity("FileParser")); + ObjectPrx proxy = adapter->add(new FileParserI, stringToIdentity("FileParser")); cout << proxy << endl; communicator()->waitForShutdown(); diff --git a/cpp/src/IceGrid/Database.cpp b/cpp/src/IceGrid/Database.cpp index b51c056048b..694d59c073d 100644 --- a/cpp/src/IceGrid/Database.cpp +++ b/cpp/src/IceGrid/Database.cpp @@ -1483,7 +1483,7 @@ Database::addObject(const ObjectInfo& info) if(_traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << "added object `" << _communicator->identityToString(id) << "' (serial = `" << dbSerial << "')"; + out << "added object `" << identityToString(id) << "' (serial = `" << dbSerial << "')"; } } _objectObserverTopic->waitForSyncedSubscribers(serial); @@ -1539,7 +1539,7 @@ Database::addOrUpdateObject(const ObjectInfo& info, Ice::Long dbSerial) if(_traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << (!update ? "added" : "updated") << " object `" << _communicator->identityToString(id) << "' (serial = `" << dbSerial << "')"; + out << (!update ? "added" : "updated") << " object `" << identityToString(id) << "' (serial = `" << dbSerial << "')"; } } _objectObserverTopic->waitForSyncedSubscribers(serial); @@ -1556,7 +1556,7 @@ Database::removeObject(const Ice::Identity& id, Ice::Long dbSerial) if(_objectCache.has(id)) { DeploymentException ex; - ex.reason = "removing object `" + _communicator->identityToString(id) + "' is not allowed:\n"; + ex.reason = "removing object `" + identityToString(id) + "' is not allowed:\n"; ex.reason += "the object was added with the application descriptor `"; ex.reason += _objectCache.get(id)->getApplication(); ex.reason += "'"; @@ -1590,7 +1590,7 @@ Database::removeObject(const Ice::Identity& id, Ice::Long dbSerial) if(_traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << "removed object `" << _communicator->identityToString(id) << "' (serial = `" << dbSerial << "')"; + out << "removed object `" << identityToString(id) << "' (serial = `" << dbSerial << "')"; } } _objectObserverTopic->waitForSyncedSubscribers(serial); @@ -1609,7 +1609,7 @@ Database::updateObject(const Ice::ObjectPrx& proxy) if(_objectCache.has(id)) { DeploymentException ex; - ex.reason = "updating object `" + _communicator->identityToString(id) + "' is not allowed:\n"; + ex.reason = "updating object `" + identityToString(id) + "' is not allowed:\n"; ex.reason += "the object was added with the application descriptor `"; ex.reason += _objectCache.get(id)->getApplication(); ex.reason += "'"; @@ -1644,7 +1644,7 @@ Database::updateObject(const Ice::ObjectPrx& proxy) if(_traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << "updated object `" << _communicator->identityToString(id) << "' (serial = `" << dbSerial << "')"; + out << "updated object `" << identityToString(id) << "' (serial = `" << dbSerial << "')"; } } _objectObserverTopic->waitForSyncedSubscribers(serial); @@ -1833,7 +1833,7 @@ Database::getAllObjectInfos(const string& expression) ObjectsMapROCursor cursor(_objects, txn); while(cursor.get(id, info, MDB_NEXT)) { - if(expression.empty() || IceUtilInternal::match(_communicator->identityToString(id), expression, true)) + if(expression.empty() || IceUtilInternal::match(identityToString(id), expression, true)) { infos.push_back(info); } @@ -2089,7 +2089,7 @@ Database::checkObjectForAddition(const Ice::Identity& objectId, if(found) { DeploymentException ex; - ex.reason = "object `" + _communicator->identityToString(objectId) + "' is already registered"; + ex.reason = "object `" + identityToString(objectId) + "' is already registered"; throw ex; } } @@ -2761,7 +2761,7 @@ Database::addObject(const IceDB::ReadWriteTxn& txn, const ObjectInfo& info, bool catch(const IceDB::KeyTooLongException& ex) { throw DeploymentException("object identity `" + - _communicator->identityToString(info.proxy->ice_getIdentity()) + identityToString(info.proxy->ice_getIdentity()) + "' is too long: " + ex.what()); } try diff --git a/cpp/src/IceGrid/DescriptorBuilder.cpp b/cpp/src/IceGrid/DescriptorBuilder.cpp index ab6def85669..217cba7e7d6 100644 --- a/cpp/src/IceGrid/DescriptorBuilder.cpp +++ b/cpp/src/IceGrid/DescriptorBuilder.cpp @@ -10,6 +10,7 @@ #include <Ice/Communicator.h> #include <Ice/LoggerUtil.h> #include <Ice/LocalException.h> +#include <Ice/Initialize.h> #include <IceGrid/DescriptorBuilder.h> #include <IceGrid/Util.h> @@ -318,7 +319,7 @@ ApplicationDescriptorBuilder::addObject(const XmlAttributesHelper& attrs) { ObjectDescriptor object; object.type = attrs("type", ""); - object.id = _communicator->stringToIdentity(attrs("identity")); + object.id = Ice::stringToIdentity(attrs("identity")); object.proxyOptions = attrs("proxy-options", ""); if(attrs.contains("property")) { @@ -697,7 +698,7 @@ CommunicatorDescriptorBuilder::addObject(const XmlAttributesHelper& attrs) { ObjectDescriptor object; object.type = attrs("type", ""); - object.id = _communicator->stringToIdentity(attrs("identity")); + object.id = Ice::stringToIdentity(attrs("identity")); object.proxyOptions = attrs("proxy-options", ""); if(attrs.contains("property")) { @@ -711,7 +712,7 @@ CommunicatorDescriptorBuilder::addAllocatable(const XmlAttributesHelper& attrs) { ObjectDescriptor object; object.type = attrs("type", ""); - object.id = _communicator->stringToIdentity(attrs("identity")); + object.id = Ice::stringToIdentity(attrs("identity")); object.proxyOptions = attrs("proxy-options", ""); if(attrs.contains("property")) { diff --git a/cpp/src/IceGrid/DescriptorHelper.cpp b/cpp/src/IceGrid/DescriptorHelper.cpp index bd0d57cb333..7e1a531dbb5 100644 --- a/cpp/src/IceGrid/DescriptorHelper.cpp +++ b/cpp/src/IceGrid/DescriptorHelper.cpp @@ -650,11 +650,11 @@ Ice::Identity Resolver::operator()(const Ice::Identity& value, const string& name) const { assert(_communicator); - string str = asId(_communicator->identityToString(value), name, false); - Ice::Identity id = _communicator->stringToIdentity(str); + string str = asId(identityToString(value), name, false); + Ice::Identity id = Ice::stringToIdentity(str); if(id.name.empty()) { - exception("invalid object identity `" + _communicator->identityToString(value) + "': name empty"); + exception("invalid object identity `" + identityToString(value) + "': name empty"); } return id; } @@ -1387,7 +1387,7 @@ CommunicatorHelper::printObjectAdapter(const Ice::CommunicatorPtr& communicator, { out << nl << "well-known object"; out << sb; - out << nl << "identity = `" << communicator->identityToString(p->id) << "' "; + out << nl << "identity = `" << identityToString(p->id) << "' "; if(!p->type.empty()) { out << nl << "type = `" << p->type << "'"; @@ -1402,7 +1402,7 @@ CommunicatorHelper::printObjectAdapter(const Ice::CommunicatorPtr& communicator, { out << nl << "allocatable"; out << sb; - out << nl << "identity = `" << communicator->identityToString(p->id) << "' "; + out << nl << "identity = `" << identityToString(p->id) << "' "; if(!p->type.empty()) { out << nl << "type = `" << p->type << "'"; @@ -2825,7 +2825,7 @@ ApplicationHelper::ApplicationHelper(const Ice::CommunicatorPtr& communicator, { if(objectIds.count(*o) > 1) { - resolve.exception("duplicate object `" + _communicator->identityToString(*o) + "'"); + resolve.exception("duplicate object `" + identityToString(*o) + "'"); } } } diff --git a/cpp/src/IceGrid/IceGridNode.cpp b/cpp/src/IceGrid/IceGridNode.cpp index b835c65be04..63b7a20a755 100644 --- a/cpp/src/IceGrid/IceGridNode.cpp +++ b/cpp/src/IceGrid/IceGridNode.cpp @@ -470,7 +470,7 @@ NodeService::startImpl(int argc, char* argv[], int& status) // for the server and server adapter. It also takes care of installing the // evictors and object factories necessary to store these objects. // - Identity id = communicator()->stringToIdentity(instanceName + "/Node-" + name); + Identity id = stringToIdentity(instanceName + "/Node-" + name); NodePrx nodeProxy = NodePrx::uncheckedCast(_adapter->createProxy(id)); _node = new NodeI(_adapter, *_sessions, _activator, _timer, traceLevels, nodeProxy, name, mapper, instanceName); _adapter->add(_node, nodeProxy->ice_getIdentity()); diff --git a/cpp/src/IceGrid/LocatorI.cpp b/cpp/src/IceGrid/LocatorI.cpp index a39b69ae487..1ca7a9645d6 100644 --- a/cpp/src/IceGrid/LocatorI.cpp +++ b/cpp/src/IceGrid/LocatorI.cpp @@ -198,7 +198,7 @@ public: return; } - _amdCB->ice_response(proxy->ice_identity(_locator->getCommunicator()->stringToIdentity("dummy"))); + _amdCB->ice_response(proxy->ice_identity(Ice::stringToIdentity("dummy"))); } virtual void @@ -390,7 +390,7 @@ public: return; } - _proxies[id] = proxy->ice_identity(_locator->getCommunicator()->stringToIdentity("dummy")); + _proxies[id] = proxy->ice_identity(Ice::stringToIdentity("dummy")); // // If we received all the required proxies, it's time to send the @@ -548,14 +548,14 @@ public: if(_count > 1) { - Ice::ObjectPrx p = proxy->ice_identity(_locator->getCommunicator()->stringToIdentity("dummy")); + Ice::ObjectPrx p = proxy->ice_identity(Ice::stringToIdentity("dummy")); LocatorI::RequestPtr request = new ReplicaGroupRequest(_amdCB, _locator, _id, _encoding, _adapters, _count, p); request->execute(); } else { - _amdCB->ice_response(proxy->ice_identity(_locator->getCommunicator()->stringToIdentity("dummy"))); + _amdCB->ice_response(proxy->ice_identity(Ice::stringToIdentity("dummy"))); } _adapters.clear(); } diff --git a/cpp/src/IceGrid/ObjectCache.cpp b/cpp/src/IceGrid/ObjectCache.cpp index 12e210c62ad..9d7138e7050 100644 --- a/cpp/src/IceGrid/ObjectCache.cpp +++ b/cpp/src/IceGrid/ObjectCache.cpp @@ -82,7 +82,7 @@ ObjectCache::add(const ObjectInfo& info, const string& application) if(getImpl(id)) { Ice::Error out(_communicator->getLogger()); - out << "can't add duplicate object `" << _communicator->identityToString(id) << "'"; + out << "can't add duplicate object `" << identityToString(id) << "'"; return; } @@ -99,8 +99,8 @@ ObjectCache::add(const ObjectInfo& info, const string& application) if(_traceLevels && _traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << "added object `" << _communicator->identityToString(id) << "'"; - } + out << "added object `" << identityToString(id) << "'"; + } } ObjectEntryPtr @@ -123,7 +123,7 @@ ObjectCache::remove(const Ice::Identity& id) if(!entry) { Ice::Error out(_communicator->getLogger()); - out << "can't remove unknown object `" << _communicator->identityToString(id) << "'"; + out << "can't remove unknown object `" << identityToString(id) << "'"; return; } removeImpl(id); @@ -131,15 +131,15 @@ ObjectCache::remove(const Ice::Identity& id) map<string, TypeEntry>::iterator p = _types.find(entry->getType()); assert(p != _types.end()); if(p->second.remove(entry)) - { + { _types.erase(p); } if(_traceLevels && _traceLevels->object > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->objectCat); - out << "removed object `" << _communicator->identityToString(id) << "'"; - } + out << "removed object `" << identityToString(id) << "'"; + } } Ice::ObjectProxySeq @@ -167,7 +167,7 @@ ObjectCache::getAll(const string& expression) ObjectInfoSeq infos; for(map<Ice::Identity, ObjectEntryPtr>::const_iterator p = _entries.begin(); p != _entries.end(); ++p) { - if(expression.empty() || IceUtilInternal::match(_communicator->identityToString(p->first), expression, true)) + if(expression.empty() || IceUtilInternal::match(identityToString(p->first), expression, true)) { infos.push_back(p->second->getObjectInfo()); } @@ -229,4 +229,3 @@ ObjectEntry::canRemove() { return true; } - diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index 01c80978f1c..db58e8f242a 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -2100,7 +2100,7 @@ Parser::removeObject(const list<string>& args) try { - _admin->removeObject(_communicator->stringToIdentity((*(args.begin())))); + _admin->removeObject(stringToIdentity((*(args.begin())))); } catch(const Ice::Exception& ex) { @@ -2148,7 +2148,7 @@ Parser::describeObject(const list<string>& args) string arg = *(args.begin()); if(arg.find('*') == string::npos) { - ObjectInfo info = _admin->getObjectInfo(_communicator->stringToIdentity(arg)); + ObjectInfo info = _admin->getObjectInfo(stringToIdentity(arg)); cout << "proxy = `" << _communicator->proxyToString(info.proxy) << "'" << endl; cout << "type = `" << info.type << "'" << endl; return; @@ -2198,7 +2198,7 @@ Parser::listObject(const list<string>& args) for(ObjectInfoSeq::const_iterator p = objects.begin(); p != objects.end(); ++p) { - cout << _communicator->identityToString(p->proxy->ice_getIdentity()) << endl; + cout << identityToString(p->proxy->ice_getIdentity()) << endl; } } catch(const Ice::Exception& ex) @@ -2957,11 +2957,11 @@ Parser::exception(const Ice::Exception& ex) } catch(const ObjectNotRegisteredException& ex) { - error("couldn't find object `" + _communicator->identityToString(ex.id) + "'"); + error("couldn't find object `" + identityToString(ex.id) + "'"); } catch(const ObjectExistsException& ex) { - error("object `" + _communicator->identityToString(ex.id) + "' already exists"); + error("object `" + identityToString(ex.id) + "' already exists"); } catch(const DeploymentException& ex) { diff --git a/cpp/src/IceGrid/RegistryI.cpp b/cpp/src/IceGrid/RegistryI.cpp index d246b26dd9c..8ca6830132a 100644 --- a/cpp/src/IceGrid/RegistryI.cpp +++ b/cpp/src/IceGrid/RegistryI.cpp @@ -589,7 +589,7 @@ RegistryI::startImpl() // // Add the locator finder object to the client adapter. // - _clientAdapter->add(new FinderI(_wellKnownObjects), _communicator->stringToIdentity("Ice/LocatorFinder")); + _clientAdapter->add(new FinderI(_wellKnownObjects), stringToIdentity("Ice/LocatorFinder")); // // Setup the discovery object adapter and also add it the lookup @@ -624,7 +624,7 @@ RegistryI::startImpl() try { - Ice::Identity lookupId = _communicator->stringToIdentity("IceLocatorDiscovery/Lookup"); + Ice::Identity lookupId = stringToIdentity("IceLocatorDiscovery/Lookup"); discoveryAdapter = _communicator->createObjectAdapter("IceGrid.Registry.Discovery"); discoveryAdapter->add(new LookupI(_instanceName, _wellKnownObjects), lookupId); } diff --git a/cpp/src/IceGrid/ReplicaSessionManager.cpp b/cpp/src/IceGrid/ReplicaSessionManager.cpp index 96a3fd4261f..77c324aea27 100644 --- a/cpp/src/IceGrid/ReplicaSessionManager.cpp +++ b/cpp/src/IceGrid/ReplicaSessionManager.cpp @@ -177,7 +177,7 @@ public: { ostringstream os; os << ex << ":\n"; - os << "id: " << info.proxy->ice_getCommunicator()->identityToString(info.proxy->ice_getIdentity()); + os << "id: " << identityToString(info.proxy->ice_getIdentity()); failure = os.str(); } receivedUpdate(ObjectObserverTopicName, serial, failure); @@ -196,7 +196,7 @@ public: { ostringstream os; os << ex << ":\n"; - os << "id: " << info.proxy->ice_getCommunicator()->identityToString(info.proxy->ice_getIdentity()); + os << "id: " << identityToString(info.proxy->ice_getIdentity()); failure = os.str(); } catch(const DeploymentException& ex) diff --git a/cpp/src/IceGrid/Util.cpp b/cpp/src/IceGrid/Util.cpp index 1553c8be228..de544ef43b1 100644 --- a/cpp/src/IceGrid/Util.cpp +++ b/cpp/src/IceGrid/Util.cpp @@ -207,7 +207,7 @@ IceGrid::toObjectInfo(const Ice::CommunicatorPtr& communicator, const ObjectDesc ObjectInfo info; info.type = obj.type; ostringstream proxyStr; - proxyStr << "\"" << communicator->identityToString(obj.id) << "\""; + proxyStr << "\"" << identityToString(obj.id) << "\""; if(!obj.proxyOptions.empty()) { proxyStr << ' ' << obj.proxyOptions; @@ -220,7 +220,7 @@ IceGrid::toObjectInfo(const Ice::CommunicatorPtr& communicator, const ObjectDesc catch(const Ice::ProxyParseException&) { ostringstream fallbackProxyStr; - fallbackProxyStr << "\"" << communicator->identityToString(obj.id) << "\"" << " @ " << adapterId; + fallbackProxyStr << "\"" << identityToString(obj.id) << "\"" << " @ " << adapterId; info.proxy = communicator->stringToProxy(fallbackProxyStr.str()); } return info; |