diff options
Diffstat (limited to 'cpp/src')
32 files changed, 108 insertions, 109 deletions
diff --git a/cpp/src/Glacier2/Blobject.cpp b/cpp/src/Glacier2/Blobject.cpp index 1f58da34ffb..4b822469c81 100644 --- a/cpp/src/Glacier2/Blobject.cpp +++ b/cpp/src/Glacier2/Blobject.cpp @@ -261,7 +261,7 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd } if(_reverseConnection) { - out << "\nidentity = " << _instance->communicator()->identityToString(proxy->ice_getIdentity()); + out << "\nidentity = " << identityToString(proxy->ice_getIdentity()); } else { @@ -310,7 +310,7 @@ Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amd out << "routing override"; if(_reverseConnection) { - out << "\nidentity = " << _instance->communicator()->identityToString(proxy->ice_getIdentity()); + out << "\nidentity = " << identityToString(proxy->ice_getIdentity()); } else { diff --git a/cpp/src/Glacier2/ClientBlobject.cpp b/cpp/src/Glacier2/ClientBlobject.cpp index d7aef4ae401..f10c3d614b8 100644 --- a/cpp/src/Glacier2/ClientBlobject.cpp +++ b/cpp/src/Glacier2/ClientBlobject.cpp @@ -120,7 +120,7 @@ Glacier2::ClientBlobject::ice_invoke_async(const Ice::AMD_Object_ice_invokePtr& { Trace out(_instance->logger(), "Glacier2"); out << "rejecting request: " << rejectedFilters << "\n"; - out << "identity: " << _instance->communicator()->identityToString(current.id); + out << "identity: " << identityToString(current.id); } ObjectNotExistException ex(__FILE__, __LINE__); diff --git a/cpp/src/Glacier2/FilterManager.cpp b/cpp/src/Glacier2/FilterManager.cpp index a384a072a04..95c52f9633a 100644 --- a/cpp/src/Glacier2/FilterManager.cpp +++ b/cpp/src/Glacier2/FilterManager.cpp @@ -61,7 +61,7 @@ stringToSeq(const CommunicatorPtr& comm, const string& str, vector<Identity>& se // // TODO: should this be an unmatched quote error? // - seq.push_back(comm->stringToIdentity(str.substr(current))); + seq.push_back(stringToIdentity(str.substr(current))); break; } @@ -76,7 +76,7 @@ stringToSeq(const CommunicatorPtr& comm, const string& str, vector<Identity>& se if(markString) { ++current; - seq.push_back(comm->stringToIdentity(str.substr(current, end-current))); + seq.push_back(stringToIdentity(str.substr(current, end-current))); break; } else @@ -95,7 +95,7 @@ stringToSeq(const CommunicatorPtr& comm, const string& str, vector<Identity>& se { end = str.find_first_of(ws, current); string::size_type len = (end == string::npos) ? string::npos : end - current; - seq.push_back(comm->stringToIdentity(str.substr(current, len))); + seq.push_back(stringToIdentity(str.substr(current, len))); break; } } diff --git a/cpp/src/Glacier2/RouterI.cpp b/cpp/src/Glacier2/RouterI.cpp index e6fa92b78e2..c1935786ce0 100644 --- a/cpp/src/Glacier2/RouterI.cpp +++ b/cpp/src/Glacier2/RouterI.cpp @@ -40,7 +40,7 @@ Glacier2::RouterI::RouterI(const InstancePtr& instance, const ConnectionPtr& con if(_instance->properties()->getPropertyAsInt("Glacier2.ReturnClientProxy") > 0) { const_cast<Ice::ObjectPrx&>(_clientProxy) = - _instance->clientObjectAdapter()->createProxy(_instance->communicator()->stringToIdentity("dummy")); + _instance->clientObjectAdapter()->createProxy(stringToIdentity("dummy")); } if(_instance->serverObjectAdapter()) diff --git a/cpp/src/Glacier2/SessionRouterI.cpp b/cpp/src/Glacier2/SessionRouterI.cpp index 4d46d210726..f259ea49cde 100644 --- a/cpp/src/Glacier2/SessionRouterI.cpp +++ b/cpp/src/Glacier2/SessionRouterI.cpp @@ -1,4 +1,3 @@ - // ********************************************************************** // // Copyright (c) 2003-2016 ZeroC, Inc. All rights reserved. @@ -1151,7 +1150,7 @@ SessionRouterI::getRouterImpl(const ConnectionPtr& connection, const Ice::Identi { Trace out(_instance->logger(), "Glacier2"); out << "rejecting request. no session is associated with the connection.\n"; - out << "identity: " << _instance->communicator()->identityToString(id); + out << "identity: " << identityToString(id); } connection->close(true); throw ObjectNotExistException(__FILE__, __LINE__); diff --git a/cpp/src/Glacier2Lib/NullPermissionsVerifier.cpp b/cpp/src/Glacier2Lib/NullPermissionsVerifier.cpp index abc76a3b6e8..31d33ad00a4 100644 --- a/cpp/src/Glacier2Lib/NullPermissionsVerifier.cpp +++ b/cpp/src/Glacier2Lib/NullPermissionsVerifier.cpp @@ -111,12 +111,12 @@ Init::checkPermissionVerifier(const string& val) // check if it's actually a stringified identity // (with typically missing " " because the category contains a space) - if(val == _communicator->identityToString(_nullPVId)) + if(val == identityToString(_nullPVId)) { createObjects(); return _adapter->createProxy(_nullPVId)->ice_toString(); // Return valid proxy to rewrite the property } - else if(val == _communicator->identityToString(_nullSSLPVId)) + else if(val == identityToString(_nullSSLPVId)) { createObjects(); return _adapter->createProxy(_nullSSLPVId)->ice_toString(); // Return valid proxy to rewrite the property diff --git a/cpp/src/Ice/InstrumentationI.cpp b/cpp/src/Ice/InstrumentationI.cpp index 0f816647a11..64ff4f91e07 100644 --- a/cpp/src/Ice/InstrumentationI.cpp +++ b/cpp/src/Ice/InstrumentationI.cpp @@ -334,7 +334,7 @@ public: string getIdentity() const { - return _current.adapter->getCommunicator()->identityToString(_current.id); + return identityToString(_current.id); } private: @@ -443,7 +443,7 @@ public: catch(const Exception&) { // Either a fixed proxy or the communicator is destroyed. - os << _proxy->ice_getCommunicator()->identityToString(_proxy->ice_getIdentity()); + os << identityToString(_proxy->ice_getIdentity()); os << " [" << _operation << ']'; } } @@ -474,7 +474,7 @@ public: { if(_proxy) { - return _proxy->ice_getCommunicator()->identityToString(_proxy->ice_getIdentity()); + return identityToString(_proxy->ice_getIdentity()); } else { diff --git a/cpp/src/IceBox/Admin.cpp b/cpp/src/IceBox/Admin.cpp index c7c76bac161..bf7fa5d5a05 100644 --- a/cpp/src/IceBox/Admin.cpp +++ b/cpp/src/IceBox/Admin.cpp @@ -116,7 +116,7 @@ Client::run(int argc, char* argv[]) return EXIT_FAILURE; } - managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" :" + managerEndpoints; + managerProxy = "\"" + identityToString(managerIdentity) + "\" :" + managerEndpoints; } else { @@ -127,7 +127,7 @@ Client::run(int argc, char* argv[]) return EXIT_FAILURE; } - managerProxy = "\"" + communicator()->identityToString(managerIdentity) + "\" @" + managerAdapterId; + managerProxy = "\"" + identityToString(managerIdentity) + "\" @" + managerAdapterId; } base = communicator()->stringToProxy(managerProxy); diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp index 615e0eeec96..975d50976ff 100644 --- a/cpp/src/IceDiscovery/PluginI.cpp +++ b/cpp/src/IceDiscovery/PluginI.cpp @@ -154,7 +154,7 @@ PluginI::initialize() // Add lookup and lookup reply Ice objects // _lookup = ICE_MAKE_SHARED(LookupI, locatorRegistry, ICE_UNCHECKED_CAST(LookupPrx, lookupPrx), properties); - _multicastAdapter->add(_lookup, _communicator->stringToIdentity("IceDiscovery/Lookup")); + _multicastAdapter->add(_lookup, Ice::stringToIdentity("IceDiscovery/Lookup")); Ice::ObjectPrxPtr lookupReply = _replyAdapter->addWithUUID(ICE_MAKE_SHARED(LookupReplyI, _lookup))->ice_datagram(); _lookup->setLookupReply(ICE_UNCHECKED_CAST(LookupReplyPrx, lookupReply)); 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; diff --git a/cpp/src/IceStorm/IceStormDB.cpp b/cpp/src/IceStorm/IceStormDB.cpp index b3a927c719e..9a3c81022e3 100644 --- a/cpp/src/IceStorm/IceStormDB.cpp +++ b/cpp/src/IceStorm/IceStormDB.cpp @@ -231,8 +231,8 @@ Client::run(int argc, char* argv[]) { if(debug) { - cout << " KEY = TOPIC(" << communicator()->identityToString(q->first.topic) - << ") ID(" << communicator()->identityToString(q->first.id) << ")" <<endl; + cout << " KEY = TOPIC(" << identityToString(q->first.topic) + << ") ID(" << identityToString(q->first.id) << ")" <<endl; } subscriberMap.put(txn, q->first, q->second); } @@ -286,8 +286,8 @@ Client::run(int argc, char* argv[]) { if(debug) { - cout << " KEY = TOPIC(" << communicator()->identityToString(key.topic) - << ") ID(" << communicator()->identityToString(key.id) << ")" <<endl; + cout << " KEY = TOPIC(" << identityToString(key.topic) + << ") ID(" << identityToString(key.id) << ")" <<endl; } data.subscribers.insert(std::make_pair(key, record)); } diff --git a/cpp/src/IceStorm/InstrumentationI.cpp b/cpp/src/IceStorm/InstrumentationI.cpp index 017a5196fd3..ad3495429c9 100644 --- a/cpp/src/IceStorm/InstrumentationI.cpp +++ b/cpp/src/IceStorm/InstrumentationI.cpp @@ -174,7 +174,7 @@ public: } catch(const ::Ice::FixedProxyException&) { - _id = _proxy->ice_getCommunicator()->identityToString(_proxy->ice_getIdentity()); + _id = identityToString(_proxy->ice_getIdentity()); } } return _id; @@ -206,7 +206,7 @@ public: string getIdentity() const { - return _proxy->ice_getCommunicator()->identityToString(_proxy->ice_getIdentity()); + return identityToString(_proxy->ice_getIdentity()); } private: diff --git a/cpp/src/IceStorm/Parser.cpp b/cpp/src/IceStorm/Parser.cpp index fc00848fe65..6f802b11569 100644 --- a/cpp/src/IceStorm/Parser.cpp +++ b/cpp/src/IceStorm/Parser.cpp @@ -364,7 +364,7 @@ Parser::subscribers(const list<string>& args) IdentitySeq subscribers = topic->getSubscribers(); for(IdentitySeq::const_iterator j = subscribers.begin(); j != subscribers.end(); ++j) { - cout << "\t" << _communicator->identityToString(*j) << endl; + cout << "\t" << identityToString(*j) << endl; } } } @@ -379,7 +379,7 @@ Parser::current(const list<string>& args) { if(args.empty()) { - cout << _communicator->identityToString(_defaultManager->ice_getIdentity()) << endl; + cout << identityToString(_defaultManager->ice_getIdentity()) << endl; return; } else if(args.size() > 1) @@ -618,7 +618,7 @@ Parser::parse(const std::string& commands, bool debug) TopicManagerPrx Parser::findManagerById(const string& full, string& arg) const { - Ice::Identity id = _communicator->stringToIdentity(full); + Ice::Identity id = stringToIdentity(full); arg = id.name; if(id.category.empty()) { diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp index de1393e554e..9d925c9bff1 100644 --- a/cpp/src/IceStorm/Service.cpp +++ b/cpp/src/IceStorm/Service.cpp @@ -403,7 +403,7 @@ ServiceI::start( } topicAdapter->add(new FinderI(TopicManagerPrx::uncheckedCast(topicAdapter->createProxy(topicManagerId))), - communicator->stringToIdentity("IceStorm/Finder")); + stringToIdentity("IceStorm/Finder")); topicAdapter->activate(); publishAdapter->activate(); diff --git a/cpp/src/IceStorm/Subscriber.cpp b/cpp/src/IceStorm/Subscriber.cpp index 4b53be621e1..a4b89d09e1b 100644 --- a/cpp/src/IceStorm/Subscriber.cpp +++ b/cpp/src/IceStorm/Subscriber.cpp @@ -546,7 +546,7 @@ Subscriber::create( Ice::Identity perId; perId.category = instance->instanceName(); perId.name = "topic." + rec.topicName + ".publish." + - instance->communicator()->identityToString(rec.obj->ice_getIdentity()); + identityToString(rec.obj->ice_getIdentity()); Ice::ObjectPrx proxy = instance->publishAdapter()->add(per, perId); TraceLevelsPtr traceLevels = instance->traceLevels(); SubscriberPtr subscriber; @@ -798,7 +798,7 @@ Subscriber::error(bool dec, const Ice::Exception& e) if(_currentRetry == 0) { Ice::Warning warn(traceLevels->logger); - warn << traceLevels->subscriberCat << ":" << _instance->communicator()->identityToString(_rec.id); + warn << traceLevels->subscriberCat << ":" << identityToString(_rec.id); if(traceLevels->subscriber > 1) { warn << " endpoints: " << IceStormInternal::describeEndpoints(_rec.obj); @@ -811,7 +811,7 @@ Subscriber::error(bool dec, const Ice::Exception& e) if(traceLevels->subscriber > 0) { Ice::Trace out(traceLevels->logger, traceLevels->subscriberCat); - out << _instance->communicator()->identityToString(_rec.id); + out << identityToString(_rec.id); if(traceLevels->subscriber > 1) { out << " endpoints: " << IceStormInternal::describeEndpoints(_rec.obj); @@ -839,7 +839,7 @@ Subscriber::error(bool dec, const Ice::Exception& e) if(traceLevels->subscriber > 0) { Ice::Trace out(traceLevels->logger, traceLevels->subscriberCat); - out << _instance->communicator()->identityToString(_rec.id); + out << identityToString(_rec.id); if(traceLevels->subscriber > 1) { out << " endpoints: " << IceStormInternal::describeEndpoints(_rec.obj); diff --git a/cpp/src/IceStorm/TopicI.cpp b/cpp/src/IceStorm/TopicI.cpp index acea59e5c15..3a9c3d65a79 100644 --- a/cpp/src/IceStorm/TopicI.cpp +++ b/cpp/src/IceStorm/TopicI.cpp @@ -399,7 +399,7 @@ TopicImpl::TopicImpl( if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << " recreate " << _instance->communicator()->identityToString(id); + out << _name << " recreate " << identityToString(id); if(traceLevels->topic > 1) { out << " endpoints: " << IceStormInternal::describeEndpoints(p->obj); @@ -418,7 +418,7 @@ TopicImpl::TopicImpl( catch(const Ice::Exception& ex) { Ice::Warning out(traceLevels->logger); - out << _name << " recreate " << _instance->communicator()->identityToString(id); + out << _name << " recreate " << identityToString(id); if(traceLevels->topic > 1) { out << " endpoints: " << IceStormInternal::describeEndpoints(p->obj); @@ -491,7 +491,7 @@ trace(Ice::Trace& out, const PersistentInstancePtr& instance, const vector<Subsc { out << ","; } - out << instance->communicator()->identityToString((*p)->id()); + out << identityToString((*p)->id()); } out << "]"; } @@ -516,7 +516,7 @@ TopicImpl::subscribeAndGetPublisher(const QoS& qos, const Ice::ObjectPrx& obj) if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": subscribeAndGetPublisher: " << _instance->communicator()->identityToString(id); + out << _name << ": subscribeAndGetPublisher: " << identityToString(id); if(traceLevels->topic > 1) { @@ -600,7 +600,7 @@ TopicImpl::unsubscribe(const Ice::ObjectPrx& subscriber) if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": unsubscribe: " << _instance->communicator()->identityToString(id); + out << _name << ": unsubscribe: " << identityToString(id); if(traceLevels->topic > 1) { @@ -637,7 +637,7 @@ TopicImpl::link(const TopicPrx& topic, Ice::Int cost) if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": link " << _instance->communicator()->identityToString(topic->ice_getIdentity()) + out << _name << ": link " << identityToString(topic->ice_getIdentity()) << " cost " << cost; } @@ -722,7 +722,7 @@ TopicImpl::unlink(const TopicPrx& topic) if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << " unlink " << _instance->communicator()->identityToString(id); + out << _name << " unlink " << identityToString(id); } Ice::IdentitySeq ids; @@ -746,7 +746,7 @@ TopicImpl::reap(const Ice::IdentitySeq& ids) { out << ","; } - out << _instance->communicator()->identityToString(*p); + out << identityToString(*p); } } @@ -1045,7 +1045,7 @@ TopicImpl::observerAddSubscriber(const LogUpdate& llu, const SubscriberRecord& r if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": add replica observer: " << _instance->communicator()->identityToString(record.id); + out << _name << ": add replica observer: " << identityToString(record.id); if(traceLevels->topic > 1) { @@ -1072,7 +1072,7 @@ TopicImpl::observerAddSubscriber(const LogUpdate& llu, const SubscriberRecord& r if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _instance->communicator()->identityToString(record.id) << ": already subscribed"; + out << identityToString(record.id) << ": already subscribed"; } return; } @@ -1116,7 +1116,7 @@ TopicImpl::observerRemoveSubscriber(const LogUpdate& llu, const Ice::IdentitySeq { out << ","; } - out << _instance->communicator()->identityToString(*id); + out << identityToString(*id); } out << " llu: " << llu.generation << "/" << llu.iteration; } diff --git a/cpp/src/IceStorm/TopicManagerI.cpp b/cpp/src/IceStorm/TopicManagerI.cpp index 5c4ad1c6cbc..15696d70abc 100644 --- a/cpp/src/IceStorm/TopicManagerI.cpp +++ b/cpp/src/IceStorm/TopicManagerI.cpp @@ -421,14 +421,14 @@ TopicManagerImpl::observerInit(const LogUpdate& llu, const TopicContentSeq& cont out << "init"; for(TopicContentSeq::const_iterator p = content.begin(); p != content.end(); ++p) { - out << " topic: " << _instance->communicator()->identityToString(p->id) << " subscribers: "; + out << " topic: " << identityToString(p->id) << " subscribers: "; for(SubscriberRecordSeq::const_iterator q = p->records.begin(); q != p->records.end(); ++q) { if(q != p->records.begin()) { out << ","; } - out << _instance->communicator()->identityToString(q->id); + out << identityToString(q->id); if(traceLevels->topicMgr > 1) { out << " endpoints: " << IceStormInternal::describeEndpoints(q->obj); @@ -803,7 +803,7 @@ TopicManagerImpl::installTopic(const string& name, const Ice::Identity& id, bool if(create) { out << "creating new topic \"" << name << "\". id: " - << _instance->communicator()->identityToString(id) + << identityToString(id) << " subscribers: "; for(SubscriberRecordSeq::const_iterator q = subscribers.begin(); q != subscribers.end(); ++q) { @@ -813,7 +813,7 @@ TopicManagerImpl::installTopic(const string& name, const Ice::Identity& id, bool } if(traceLevels->topicMgr > 1) { - out << _instance->communicator()->identityToString(q->id) + out << identityToString(q->id) << " endpoints: " << IceStormInternal::describeEndpoints(q->obj); } } @@ -821,7 +821,7 @@ TopicManagerImpl::installTopic(const string& name, const Ice::Identity& id, bool else { out << "loading topic \"" << name << "\" from database. id: " - << _instance->communicator()->identityToString(id) + << identityToString(id) << " subscribers: "; for(SubscriberRecordSeq::const_iterator q = subscribers.begin(); q != subscribers.end(); ++q) { @@ -831,7 +831,7 @@ TopicManagerImpl::installTopic(const string& name, const Ice::Identity& id, bool } if(traceLevels->topicMgr > 1) { - out << _instance->communicator()->identityToString(q->id) + out << identityToString(q->id) << " endpoints: " << IceStormInternal::describeEndpoints(q->obj); } } diff --git a/cpp/src/IceStorm/TransientTopicI.cpp b/cpp/src/IceStorm/TransientTopicI.cpp index 062db7014fb..f11688d1a10 100644 --- a/cpp/src/IceStorm/TransientTopicI.cpp +++ b/cpp/src/IceStorm/TransientTopicI.cpp @@ -178,7 +178,7 @@ TransientTopicImpl::subscribe(const QoS& origQoS, const Ice::ObjectPrx& obj, con if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": subscribe: " << _instance->communicator()->identityToString(id); + out << _name << ": subscribe: " << identityToString(id); if(traceLevels->topic > 1) { @@ -280,7 +280,7 @@ TransientTopicImpl::subscribeAndGetPublisher(const QoS& qos, const Ice::ObjectPr if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": subscribeAndGetPublisher: " << _instance->communicator()->identityToString(id); + out << _name << ": subscribeAndGetPublisher: " << identityToString(id); if(traceLevels->topic > 1) { @@ -338,7 +338,7 @@ TransientTopicImpl::unsubscribe(const Ice::ObjectPrx& subscriber, const Ice::Cur if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": unsubscribe: " << _instance->communicator()->identityToString(id); + out << _name << ": unsubscribe: " << identityToString(id); if(traceLevels->topic > 1) { out << " endpoints: " << IceStormInternal::describeEndpoints(subscriber); @@ -374,7 +374,7 @@ TransientTopicImpl::link(const TopicPrx& topic, Ice::Int cost, const Ice::Curren if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << ": link " << _instance->communicator()->identityToString(topic->ice_getIdentity()) + out << _name << ": link " << identityToString(topic->ice_getIdentity()) << " cost " << cost; } @@ -434,7 +434,7 @@ TransientTopicImpl::unlink(const TopicPrx& topic, const Ice::Current&) if(traceLevels->topic > 0) { Ice::Trace out(traceLevels->logger, traceLevels->topicCat); - out << _name << " unlink " << _instance->communicator()->identityToString(id); + out << _name << " unlink " << identityToString(id); } // Remove the subscriber from the subscribers list. Note diff --git a/cpp/src/IceStorm/TransientTopicManagerI.cpp b/cpp/src/IceStorm/TransientTopicManagerI.cpp index 8c45a471f19..5bd8449fd66 100644 --- a/cpp/src/IceStorm/TransientTopicManagerI.cpp +++ b/cpp/src/IceStorm/TransientTopicManagerI.cpp @@ -55,7 +55,7 @@ TransientTopicManagerImpl::create(const string& name, const Ice::Current&) { Ice::Trace out(traceLevels->logger, traceLevels->topicMgrCat); out << "creating new topic \"" << name << "\". id: " - << _instance->communicator()->identityToString(id); + << identityToString(id); } // diff --git a/cpp/src/icegriddb/IceGridDB.cpp b/cpp/src/icegriddb/IceGridDB.cpp index 8426d773d63..42b61f1ab92 100644 --- a/cpp/src/icegriddb/IceGridDB.cpp +++ b/cpp/src/icegriddb/IceGridDB.cpp @@ -372,7 +372,7 @@ Client::run(int argc, char* argv[]) { if(debug) { - cout << " NAME = " << communicator()->identityToString(p->proxy->ice_getIdentity()) << endl; + cout << " NAME = " << identityToString(p->proxy->ice_getIdentity()) << endl; } objs.put(txn, p->proxy->ice_getIdentity(), *p); } @@ -390,7 +390,7 @@ Client::run(int argc, char* argv[]) { if(debug) { - cout << " NAME = " << communicator()->identityToString(p->proxy->ice_getIdentity()) << endl; + cout << " NAME = " << identityToString(p->proxy->ice_getIdentity()) << endl; } internalObjs.put(txn, p->proxy->ice_getIdentity(), *p); } @@ -483,7 +483,7 @@ Client::run(int argc, char* argv[]) { if(debug) { - cout << " IDENTITY = " << communicator()->identityToString(id) << endl; + cout << " IDENTITY = " << identityToString(id) << endl; } data.objects.push_back(object); } @@ -503,7 +503,7 @@ Client::run(int argc, char* argv[]) { if(debug) { - cout << " IDENTITY = " << communicator()->identityToString(id) << endl; + cout << " IDENTITY = " << identityToString(id) << endl; } data.internalObjects.push_back(object); } |