diff options
author | Mark Spruiell <mes@zeroc.com> | 2004-02-29 20:42:15 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2004-02-29 20:42:15 +0000 |
commit | a475885faf424df5a1b5a1c32db87e98fb8cb2fe (patch) | |
tree | 1e79c93d560dcd4fa983a45346602343fa71d696 /cpp/src/IcePack/ServerI.cpp | |
parent | fix (diff) | |
download | ice-a475885faf424df5a1b5a1c32db87e98fb8cb2fe.tar.bz2 ice-a475885faf424df5a1b5a1c32db87e98fb8cb2fe.tar.xz ice-a475885faf424df5a1b5a1c32db87e98fb8cb2fe.zip |
adding Ice::Process for graceful shutdown of IcePack servers
Diffstat (limited to 'cpp/src/IcePack/ServerI.cpp')
-rw-r--r-- | cpp/src/IcePack/ServerI.cpp | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/cpp/src/IcePack/ServerI.cpp b/cpp/src/IcePack/ServerI.cpp index 218c8d5bd88..2ca63d59532 100644 --- a/cpp/src/IcePack/ServerI.cpp +++ b/cpp/src/IcePack/ServerI.cpp @@ -93,7 +93,7 @@ IcePack::ServerI::start(ServerActivation act, const Ice::Current& current) try { - bool active = _activator->activate(this); + bool active = _activator->activate(this); setState(active ? Active : Inactive); return active; } @@ -352,6 +352,20 @@ IcePack::ServerI::getActivationMode(const ::Ice::Current&) } void +IcePack::ServerI::setProcess(const ::Ice::ProcessPrx& proc, const ::Ice::Current&) +{ + IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); + _process = proc; +} + +Ice::ProcessPrx +IcePack::ServerI::getProcess(const ::Ice::Current&) +{ + IceUtil::Monitor< ::IceUtil::Mutex>::Lock sync(*this); + return _process; +} + +void IcePack::ServerI::stopInternal() { // @@ -399,22 +413,22 @@ IcePack::ServerI::stopInternal() if(deactivate) { - // - // Deactivate the server by sending a SIGTERM. - // - try - { - _activator->deactivate(this); - } - catch(const Ice::SyscallException& ex) - { - Ice::Warning out(_traceLevels->logger); - out << "deactivation failed for server `" << description.name << "':\n"; - out << ex; - - setState(Active); - return; - } + // + // Deactivate the server. + // + try + { + _activator->deactivate(this); + } + catch(const Ice::Exception& ex) + { + Ice::Warning out(_traceLevels->logger); + out << "deactivation failed for server `" << description.name << "':\n"; + out << ex; + + setState(Active); + return; + } } // |