From a5fdbf7412b96cecd45314f9d9eb37aaf77a2bf1 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Mon, 24 Apr 2006 09:46:12 +0000 Subject: Added first cut of the allocation mechanism. --- cpp/src/IceGrid/ObjectCache.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'cpp/src/IceGrid/ObjectCache.cpp') diff --git a/cpp/src/IceGrid/ObjectCache.cpp b/cpp/src/IceGrid/ObjectCache.cpp index a14e2b46928..d8d89d8583f 100644 --- a/cpp/src/IceGrid/ObjectCache.cpp +++ b/cpp/src/IceGrid/ObjectCache.cpp @@ -33,6 +33,7 @@ ObjectCache::add(const string& app, const string& adapterId, const string& endpo ObjectInfo info; info.type = desc.type; + info.allocatable = desc.allocatable; if(adapterId.empty()) { info.proxy = _communicator->stringToProxy(Ice::identityToString(desc.id) + ":" + endpoints); @@ -106,7 +107,11 @@ ObjectCache::getObjectsByType(const string& type) } for(set::const_iterator q = p->second.begin(); q != p->second.end(); ++q) { - proxies.push_back(getImpl(*q)->getProxy()); + ObjectEntryPtr entry = getImpl(*q); + if(!entry->allocatable()) + { + proxies.push_back(entry->getProxy()); + } } return proxies; } @@ -126,7 +131,8 @@ ObjectCache::getAll(const string& expression) return infos; } -ObjectEntry::ObjectEntry(Cache&, const Ice::Identity&) +ObjectEntry::ObjectEntry(Cache&, const Ice::Identity&) : + Allocatable(false) { } @@ -135,6 +141,7 @@ ObjectEntry::set(const string& app, const ObjectInfo& info) { _application = app; _info = info; + _allocatable = info.allocatable; } Ice::ObjectPrx -- cgit v1.2.3