diff options
author | Benoit Foucher <benoit@zeroc.com> | 2007-11-28 14:46:24 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2007-11-28 14:46:24 +0100 |
commit | 01b54353a0cabb7715a36fcbe703b41099e1aa17 (patch) | |
tree | 1c299c67a64ca768fdee7a71d5a52926cc49ae91 /cpp/src/IceGrid/ServerI.cpp | |
parent | VC6 compilation error fixes (diff) | |
download | ice-01b54353a0cabb7715a36fcbe703b41099e1aa17.tar.bz2 ice-01b54353a0cabb7715a36fcbe703b41099e1aa17.tar.xz ice-01b54353a0cabb7715a36fcbe703b41099e1aa17.zip |
Changed IceGrid node to consider a server active only once its process proxy is registered
Diffstat (limited to 'cpp/src/IceGrid/ServerI.cpp')
-rw-r--r-- | cpp/src/IceGrid/ServerI.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/cpp/src/IceGrid/ServerI.cpp b/cpp/src/IceGrid/ServerI.cpp index 507867753d8..f6806884fb5 100644 --- a/cpp/src/IceGrid/ServerI.cpp +++ b/cpp/src/IceGrid/ServerI.cpp @@ -833,18 +833,31 @@ void ServerI::setProcess_async(const AMD_Server_setProcessPtr& amdCB, const Ice::ProcessPrx& process, const Ice::Current&) { bool deact = false; + ServerCommandPtr command; { Lock sync(*this); checkDestroyed(); _process = process; - deact = _state == DeactivatingWaitForProcess; - notifyAll(); + if(_state == DeactivatingWaitForProcess) + { + deact = true; + } + else + { + checkActivation(); + command = nextCommand(); + } } amdCB->ice_response(); + if(deact) { deactivate(); } + else if(command) + { + command->execute(); + } } Ice::Long @@ -2282,7 +2295,12 @@ ServerI::checkActivation() //assert(locked()); if(_state == ServerI::WaitForActivation || _state == ServerI::ActivationTimeout) { - if(includes(_activatedAdapters.begin(), _activatedAdapters.end(), + // + // Mark the server as active if the server process proxy is registered (or it's not expecting + // one to be registered) and if all the server lifetime adapters have been activated. + // + if((!_desc->processRegistered || _process) && + includes(_activatedAdapters.begin(), _activatedAdapters.end(), _serverLifetimeAdapters.begin(), _serverLifetimeAdapters.end())) { setStateNoSync(ServerI::Active); |