ServerEntryPtr ServerCache::postUpdate(const ServerInfo& info, bool noRestart) { Lock sync(*this); ServerEntryPtr entry = getImpl(info.descriptor->id); assert(entry); ServerInfo oldInfo = entry->getInfo(); entry->update(info, noRestart); if(!noRestart) { _nodeCache.get(info.node, true)->addServer(entry); forEachCommunicator(AddCommunicator(*this, entry, info.application))(oldInfo.descriptor, info.descriptor); } if(_traceLevels && _traceLevels->server > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->serverCat); out << "updated server `" << info.descriptor->id << "' (`" << info.uuid << "', `" << info.revision << "')"; } return entry; }
ServerEntryPtr ServerCache::add(const ServerInfo& info) { Lock sync(*this); ServerEntryPtr entry = getImpl(info.descriptor->id); if(!entry) { entry = new ServerEntry(*this, info.descriptor->id); addImpl(info.descriptor->id, entry); } entry->update(info, false); _nodeCache.get(info.node, true)->addServer(entry); forEachCommunicator(AddCommunicator(*this, entry, info.application))(info.descriptor); if(_traceLevels && _traceLevels->server > 0) { Ice::Trace out(_traceLevels->logger, _traceLevels->serverCat); out << "added server `" << info.descriptor->id << "' (`" << info.uuid << "', `" << info.revision << "')"; } return entry; }