diff options
author | Benoit Foucher <benoit@zeroc.com> | 2017-02-10 18:42:18 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2017-02-10 18:42:18 +0100 |
commit | 3b2960e7be53c931ffcf84a0a2fe3ca1e2b75e11 (patch) | |
tree | 8a2475dda8b95d5b837bdf5415a1a968c57642c1 /cpp/src/IceGrid/ObjectCache.cpp | |
parent | Fix (ICE-7331) - IceGridGUI preference preservation (diff) | |
download | ice-3b2960e7be53c931ffcf84a0a2fe3ca1e2b75e11.tar.bz2 ice-3b2960e7be53c931ffcf84a0a2fe3ca1e2b75e11.tar.xz ice-3b2960e7be53c931ffcf84a0a2fe3ca1e2b75e11.zip |
Fixed ICE-7328 - IceGrid no longer returns proxies from disabled servers for ByType operations
Diffstat (limited to 'cpp/src/IceGrid/ObjectCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/ObjectCache.cpp | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/cpp/src/IceGrid/ObjectCache.cpp b/cpp/src/IceGrid/ObjectCache.cpp index cc76cc2d9b7..8cd6aaedeb2 100644 --- a/cpp/src/IceGrid/ObjectCache.cpp +++ b/cpp/src/IceGrid/ObjectCache.cpp @@ -74,7 +74,7 @@ ObjectCache::ObjectCache(const Ice::CommunicatorPtr& communicator) : _communicat } void -ObjectCache::add(const ObjectInfo& info, const string& application) +ObjectCache::add(const ObjectInfo& info, const string& application, const string& server) { const Ice::Identity& id = info.proxy->ice_getIdentity(); @@ -86,7 +86,7 @@ ObjectCache::add(const ObjectInfo& info, const string& application) return; } - ObjectEntryPtr entry = new ObjectEntry(info, application); + ObjectEntryPtr entry = new ObjectEntry(info, application, server); addImpl(id, entry); map<string, TypeEntry>::iterator p = _types.find(entry->getType()); @@ -142,22 +142,16 @@ ObjectCache::remove(const Ice::Identity& id) } } -Ice::ObjectProxySeq +vector<ObjectEntryPtr> ObjectCache::getObjectsByType(const string& type) { Lock sync(*this); - Ice::ObjectProxySeq proxies; map<string, TypeEntry>::const_iterator p = _types.find(type); if(p == _types.end()) { - return proxies; + return vector<ObjectEntryPtr>(); } - const vector<ObjectEntryPtr>& objects = p->second.getObjects(); - for(vector<ObjectEntryPtr>::const_iterator q = objects.begin(); q != objects.end(); ++q) - { - proxies.push_back((*q)->getProxy()); - } - return proxies; + return p->second.getObjects(); } ObjectInfoSeq @@ -194,9 +188,10 @@ ObjectCache::getAllByType(const string& type) return infos; } -ObjectEntry::ObjectEntry(const ObjectInfo& info, const string& application) : +ObjectEntry::ObjectEntry(const ObjectInfo& info, const string& application, const string& server) : _info(info), - _application(application) + _application(application), + _server(server) { } @@ -218,6 +213,12 @@ ObjectEntry::getApplication() const return _application; } +string +ObjectEntry::getServer() const +{ + return _server; +} + const ObjectInfo& ObjectEntry::getObjectInfo() const { |