diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-05-29 09:51:28 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-05-29 09:51:28 +0000 |
commit | a6cb3af17287c96cb1ed307b42fe9633d1905630 (patch) | |
tree | 93dd4bfa368f581998fbcf20802e84fb3f22ef8e /cpp/src/IceGrid/AdapterCache.cpp | |
parent | More changes for inconsistent ice_* proxy methods (diff) | |
download | ice-a6cb3af17287c96cb1ed307b42fe9633d1905630.tar.bz2 ice-a6cb3af17287c96cb1ed307b42fe9633d1905630.tar.xz ice-a6cb3af17287c96cb1ed307b42fe9633d1905630.zip |
Property set bug fixes, locator tracing.
Diffstat (limited to 'cpp/src/IceGrid/AdapterCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/AdapterCache.cpp | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp index 7371cfcb0f9..74e71a95a33 100644 --- a/cpp/src/IceGrid/AdapterCache.cpp +++ b/cpp/src/IceGrid/AdapterCache.cpp @@ -200,17 +200,12 @@ ServerAdapterEntry::ServerAdapterEntry(AdapterCache& cache, } vector<pair<string, AdapterPrx> > -ServerAdapterEntry::getProxies(int& nReplicas) +ServerAdapterEntry::getProxies(int& nReplicas, bool& replicaGroup) { vector<pair<string, AdapterPrx> > adapters; - try - { - nReplicas = 1; - adapters.push_back(make_pair(_id, getProxy())); - } - catch(const NodeUnreachableException&) - { - } + nReplicas = 1; + replicaGroup = false; + adapters.push_back(make_pair(_id, getProxy(""))); return adapters; } @@ -234,13 +229,7 @@ ServerAdapterEntry::getAdapterInfo() const info.replicaGroupId = _replicaGroupId; try { - info.proxy = getProxy()->getDirectProxy(); - } - catch(const NodeUnreachableException&) - { - } - catch(const AdapterNotExistException&) - { + info.proxy = getProxy("")->getDirectProxy(); } catch(const Ice::Exception&) { @@ -345,13 +334,15 @@ ReplicaGroupEntry::update(const LoadBalancingPolicyPtr& policy) } vector<pair<string, AdapterPrx> > -ReplicaGroupEntry::getProxies(int& nReplicas) +ReplicaGroupEntry::getProxies(int& nReplicas, bool& replicaGroup) { ReplicaSeq replicas; bool adaptive = false; LoadSample loadSample = LoadSample1; { Lock sync(*this); + replicaGroup = true; + if(_replicas.empty()) { return vector<pair<string, AdapterPrx> >(); @@ -405,19 +396,33 @@ ReplicaGroupEntry::getProxies(int& nReplicas) // reachable. // vector<pair<string, AdapterPrx> > adapters; + auto_ptr<Ice::Exception> exception; for(ReplicaSeq::const_iterator p = replicas.begin(); p != replicas.end(); ++p) { try { - adapters.push_back(make_pair(p->first, p->second->getProxy())); + adapters.push_back(make_pair(p->first, p->second->getProxy(_id))); } - catch(AdapterNotExistException&) + catch(const AdapterNotExistException&) { } - catch(const NodeUnreachableException&) + catch(const Ice::InvalidReplicaGroupIdException&) { } + catch(const Ice::Exception& ex) + { + if(!exception.get()) + { + exception.reset(ex.ice_clone()); + } + } } + + if(exception.get()) + { + exception->ice_throw(); + } + return adapters; } |