summaryrefslogtreecommitdiff
path: root/cpp/src/IceGrid/AdapterCache.cpp
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2006-04-28 16:24:03 +0000
committerBenoit Foucher <benoit@zeroc.com>2006-04-28 16:24:03 +0000
commitbf3729b95ca9928b07babe4f1216883cdc37086b (patch)
tree1a8b2720f3200f4bf705d4d4c12dddcf064be6bf /cpp/src/IceGrid/AdapterCache.cpp
parentAdding warning comments about changing toString() behaviors that may break (diff)
downloadice-bf3729b95ca9928b07babe4f1216883cdc37086b.tar.bz2
ice-bf3729b95ca9928b07babe4f1216883cdc37086b.tar.xz
ice-bf3729b95ca9928b07babe4f1216883cdc37086b.zip
More allocation fixes, removed session based Query interface.
Diffstat (limited to 'cpp/src/IceGrid/AdapterCache.cpp')
-rw-r--r--cpp/src/IceGrid/AdapterCache.cpp28
1 files changed, 24 insertions, 4 deletions
diff --git a/cpp/src/IceGrid/AdapterCache.cpp b/cpp/src/IceGrid/AdapterCache.cpp
index 81ed7bfff4b..884bd397cee 100644
--- a/cpp/src/IceGrid/AdapterCache.cpp
+++ b/cpp/src/IceGrid/AdapterCache.cpp
@@ -157,13 +157,23 @@ ServerAdapterEntry::ServerAdapterEntry(Cache<string, AdapterEntry>& cache, const
}
vector<pair<string, AdapterPrx> >
-ServerAdapterEntry::getProxies(bool, int& nReplicas)
+ServerAdapterEntry::getProxies(bool, int& nReplicas, const SessionIPtr& session)
{
vector<pair<string, AdapterPrx> > adapters;
try
{
nReplicas = 1;
- adapters.push_back(make_pair(_id, getProxy()));
+ if(allocatable())
+ {
+ if(session == getSession())
+ {
+ adapters.push_back(make_pair(_id, getProxy()));
+ }
+ }
+ else
+ {
+ adapters.push_back(make_pair(_id, getProxy()));
+ }
}
catch(const NodeUnreachableException&)
{
@@ -342,7 +352,7 @@ ReplicaGroupEntry::removeReplica(const string& replicaId)
}
vector<pair<string, AdapterPrx> >
-ReplicaGroupEntry::getProxies(bool allRegistered, int& nReplicas)
+ReplicaGroupEntry::getProxies(bool allRegistered, int& nReplicas, const SessionIPtr& session)
{
ReplicaSeq replicas;
bool adaptive = false;
@@ -406,7 +416,17 @@ ReplicaGroupEntry::getProxies(bool allRegistered, int& nReplicas)
{
try
{
- adapters.push_back(make_pair(p->first, p->second->getProxy()));
+ if(p->second->allocatable())
+ {
+ if(session == p->second->getSession())
+ {
+ adapters.push_back(make_pair(p->first, p->second->getProxy()));
+ }
+ }
+ else
+ {
+ adapters.push_back(make_pair(p->first, p->second->getProxy()));
+ }
}
catch(AdapterNotExistException&)
{