From fed698d7a15486e1c01ee4e7eafe3da45d7cd803 Mon Sep 17 00:00:00 2001 From: Benoit Foucher Date: Wed, 21 Sep 2005 14:02:52 +0000 Subject: Improved the error message if you try to remove an object or adapter with the admin interface and if that object or adapter was added with a deployment descriptor. Fixed a bug where trying to start a server managed by a node would fail if this server was previously manually activated. Simplified adapter direct proxy update if the adapter is an adapter that wasn't added with a deployment descriptor. Fixes to allow compilation on AIX. --- cpp/src/IceGrid/ServerCache.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'cpp/src/IceGrid/ServerCache.cpp') diff --git a/cpp/src/IceGrid/ServerCache.cpp b/cpp/src/IceGrid/ServerCache.cpp index 0ec5fa310c4..1e90dfa3f2c 100644 --- a/cpp/src/IceGrid/ServerCache.cpp +++ b/cpp/src/IceGrid/ServerCache.cpp @@ -142,6 +142,7 @@ ServerCache::getNodeCache() const void ServerCache::addCommunicator(const CommunicatorDescriptorPtr& comm, const ServerEntryPtr& entry) { + const string application = entry->getApplication(); for(AdapterDescriptorSeq::const_iterator q = comm->adapters.begin() ; q != comm->adapters.end(); ++q) { if(!q->id.empty()) @@ -150,7 +151,8 @@ ServerCache::addCommunicator(const CommunicatorDescriptorPtr& comm, const Server } for(ObjectDescriptorSeq::const_iterator r = q->objects.begin(); r != q->objects.end(); ++r) { - _objectCache.add(q->id, IceGrid::getProperty(comm->properties, q->name + ".Endpoints"), *r); + const string edpts = IceGrid::getProperty(comm->properties, q->name + ".Endpoints"); + _objectCache.add(application, q->id, edpts, *r); } } } @@ -341,6 +343,17 @@ ServerEntry::getNode() const return _proxy ? _cache.getNodeCache().get(_loaded->node) : _cache.getNodeCache().get(_load->node); } +string +ServerEntry::getApplication() const +{ + Lock sync(*this); + if(!_loaded.get() && !_load.get()) + { + throw ServerNotExistException(); + } + return _proxy ? _loaded->application : _load->application; +} + float ServerEntry::getLoad(LoadSample sample) const { -- cgit v1.2.3