Example #1
0
void
ServerCache::addCommunicator(const CommunicatorDescriptorPtr& oldDesc,
                             const CommunicatorDescriptorPtr& newDesc,
                             const ServerEntryPtr& server,
                             const string& application)
{
    if(!newDesc)
    {
        return; // Nothing to add
    }
    for(AdapterDescriptorSeq::const_iterator q = newDesc->adapters.begin() ; q != newDesc->adapters.end(); ++q)
    {
        AdapterDescriptor oldAdpt;
        if(oldDesc)
        {
            for(AdapterDescriptorSeq::const_iterator p = oldDesc->adapters.begin() ; p != oldDesc->adapters.end(); ++p)
            {
                if(p->id == q->id)
                {
                    oldAdpt = *p;
                    break;
                }
            }
        }
        assert(!q->id.empty());
        _adapterCache.addServerAdapter(*q, server, application);

        for(ObjectDescriptorSeq::const_iterator r = q->objects.begin(); r != q->objects.end(); ++r)
        {
            _objectCache.add(toObjectInfo(_communicator, *r, q->id), application, server->getId());
        }
        for(ObjectDescriptorSeq::const_iterator r = q->allocatables.begin(); r != q->allocatables.end(); ++r)
        {
            ObjectDescriptorSeq::const_iterator s;
            for(s = oldAdpt.allocatables.begin(); s != oldAdpt.allocatables.end() && s->id != r->id; ++s);
            if(s == oldAdpt.allocatables.end() || *s != *r) // Only add new or updated allocatables
            {
                _allocatableObjectCache.add(toObjectInfo(_communicator, *r, q->id), server);
            }
        }
    }
}
Example #2
0
void
NodeEntry::removeServer(const ServerEntryPtr& entry)
{
    Lock sync(*this);
    _servers.erase(entry->getId());
}
Example #3
0
 DestroyCB(const TraceLevelsPtr& traceLevels, const ServerEntryPtr& server, const string& node) : 
     _traceLevels(traceLevels), _server(server), _id(server->getId()), _node(node)
 {
 }
Example #4
0
void
NodeEntry::addServer(const ServerEntryPtr& entry)
{
    Lock sync(*this);
    _servers.insert(make_pair(entry->getId(), entry));
}
Example #5
0
 LoadCB(const TraceLevelsPtr& traceLevels, const ServerEntryPtr& server, const string& node, int timeout) : 
     _traceLevels(traceLevels), _server(server), _id(server->getId()), _node(node), _timeout(timeout)
 {
 }