diff options
author | Benoit Foucher <benoit@zeroc.com> | 2006-12-04 19:43:10 +0000 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2006-12-04 19:43:10 +0000 |
commit | 996be326b98f2c5bb776ba68dd2b3d8b2861a12a (patch) | |
tree | 446bb318a97f7e64b35f299407f03868942c7c0f /cpp/src/IceGrid/NodeCache.cpp | |
parent | Removed -single_module, it doesn't seem to be neccessary anymore (diff) | |
download | ice-996be326b98f2c5bb776ba68dd2b3d8b2861a12a.tar.bz2 ice-996be326b98f2c5bb776ba68dd2b3d8b2861a12a.tar.xz ice-996be326b98f2c5bb776ba68dd2b3d8b2861a12a.zip |
More cleanup
Diffstat (limited to 'cpp/src/IceGrid/NodeCache.cpp')
-rw-r--r-- | cpp/src/IceGrid/NodeCache.cpp | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/cpp/src/IceGrid/NodeCache.cpp b/cpp/src/IceGrid/NodeCache.cpp index d0a8e000671..dfd740c97e5 100644 --- a/cpp/src/IceGrid/NodeCache.cpp +++ b/cpp/src/IceGrid/NodeCache.cpp @@ -258,20 +258,37 @@ NodeEntry::setSession(const NodeSessionIPtr& session) { Lock sync(*this); - if(session && _session) + if(session) { - if(_session->isDestroyed()) + while(_session) { - // If the current session has just been destroyed, wait for the setSession(0) call. - assert(session != _session); - while(_session) + if(_session->isDestroyed()) { + // If the current session has just been destroyed, wait for the setSession(0) call. + assert(session != _session); wait(); } - } - else - { - throw NodeActiveException(); + else + { + NodeSessionIPtr session = _session; + sync.release(); + try + { + session->getNode()->ice_ping(); + throw NodeActiveException(); + } + catch(const Ice::LocalException&) + { + try + { + session->destroy(); + } + catch(const Ice::ObjectNotExistException&) + { + } + } + sync.acquire(); + } } } else if(!session && !_session) @@ -281,17 +298,11 @@ NodeEntry::setSession(const NodeSessionIPtr& session) if(!session && _session) { - _cache.getReplicaCache().nodeRemoved(_session->getNode()); } _session = session; notifyAll(); - if(_session) - { - _cache.getReplicaCache().nodeAdded(session->getNode()); - } - // // Clear the saved proxy, the node has established a session // so we won't need anymore to try to register it with this |