示例#1
0
void 
AdapterObserverTopic::initObserver(const Ice::ObjectPrx& obsv)
{
    AdapterObserverPrx observer = AdapterObserverPrx::uncheckedCast(obsv);
    AdapterInfoSeq adapters;
    for(map<string, AdapterInfo>::const_iterator p = _adapters.begin(); p != _adapters.end(); ++p)
    {
        adapters.push_back(p->second);
    }   
    observer->adapterInit(adapters, getContext(_serial, _dbSerial));
}
示例#2
0
AdapterInfoSeq
ServerAdapterEntry::getAdapterInfo() const
{
    AdapterInfo info;
    info.id = _id;
    info.replicaGroupId = _replicaGroupId;
    try
    {
        info.proxy = _server->getAdapter(_id, true)->getDirectProxy();
    }
    catch(const SynchronizationException&)
    {
    }
    catch(const Ice::Exception&)
    {
    }
    AdapterInfoSeq infos;
    infos.push_back(info);
    return infos;
}
示例#3
0
AdapterInfoSeq
ReplicaGroupEntry::getAdapterInfo() const
{
    //
    // This method is called with the database locked so we're sure
    // that no new adapters will be added or removed concurrently.
    //
    vector<ServerAdapterEntryPtr> replicas;
    {
        Lock sync(*this);
        replicas = _replicas;
    }

    AdapterInfoSeq infos;
    for(vector<ServerAdapterEntryPtr>::const_iterator p = replicas.begin(); p != replicas.end(); ++p)
    {
        AdapterInfoSeq infs = (*p)->getAdapterInfo();
        assert(infs.size() == 1);
        infos.push_back(infs[0]);
    }
    return infos;
}