diff options
author | Jose <jose@zeroc.com> | 2012-08-16 21:54:10 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-08-16 21:54:10 +0200 |
commit | 0333544ca90a99baa6e9dc7373eba744d4404970 (patch) | |
tree | b8d204864002edf7d0bbe903a8bf1fc8c917c8ee /cpp/src/IceGrid/Activator.cpp | |
parent | minor fixes (diff) | |
parent | IceGridGUI updates to use latest jgoodies packages (diff) | |
download | ice-0333544ca90a99baa6e9dc7373eba744d4404970.tar.bz2 ice-0333544ca90a99baa6e9dc7373eba744d4404970.tar.xz ice-0333544ca90a99baa6e9dc7373eba744d4404970.zip |
Merge remote-tracking branch 'origin/encoding11' into mx
Conflicts:
cpp/config/Make.rules.Darwin
cpp/src/Ice/ConnectionFactory.cpp
cpp/src/Ice/ConnectionI.h
Diffstat (limited to 'cpp/src/IceGrid/Activator.cpp')
-rw-r--r-- | cpp/src/IceGrid/Activator.cpp | 76 |
1 files changed, 36 insertions, 40 deletions
diff --git a/cpp/src/IceGrid/Activator.cpp b/cpp/src/IceGrid/Activator.cpp index 628978b6488..10d0f20d66b 100644 --- a/cpp/src/IceGrid/Activator.cpp +++ b/cpp/src/IceGrid/Activator.cpp @@ -786,6 +786,40 @@ Activator::activate(const string& name, #endif } +namespace +{ + +class ShutdownCallback : public IceUtil::Shared +{ +public: + + ShutdownCallback(const ActivatorPtr& activator, const string& name, const TraceLevelsPtr& traceLevels) : + _activator(activator), _name(name), _traceLevels(traceLevels) + { + + } + + virtual void + exception(const Ice::Exception& ex) + { + Ice::Warning out(_traceLevels->logger); + out << "exception occurred while deactivating `" << _name << "' using process proxy:\n" << ex; + + // + // Send a SIGTERM to the process. + // + _activator->sendSignal(_name, SIGTERM); + } + +private: + + const ActivatorPtr _activator; + const string _name; + const TraceLevelsPtr _traceLevels; +}; + +} + void Activator::deactivate(const string& name, const Ice::ProcessPrx& process) { @@ -800,44 +834,6 @@ Activator::deactivate(const string& name, const Ice::ProcessPrx& process) } #endif - class ShutdownCallback : public Ice::AMI_Process_shutdown - { - public: - - ShutdownCallback(const ActivatorPtr& activator, const string& name, const TraceLevelsPtr& traceLevels) : - _activator(activator), _name(name), _traceLevels(traceLevels) - { - - } - - virtual void - ice_response() - { - // - // Nothing to do, server successfully shutdown, the activator will detect it - // once the pipe is closed. - // - } - - virtual void - ice_exception(const Ice::Exception& ex) - { - Ice::Warning out(_traceLevels->logger); - out << "exception occurred while deactivating `" << _name << "' using process proxy:\n" << ex; - - // - // Send a SIGTERM to the process. - // - _activator->sendSignal(_name, SIGTERM); - } - - private: - - const ActivatorPtr _activator; - const string _name; - const TraceLevelsPtr _traceLevels; - }; - // // Try to shut down the server gracefully using the process proxy. // @@ -848,8 +844,8 @@ Activator::deactivate(const string& name, const Ice::ProcessPrx& process) Ice::Trace out(_traceLevels->logger, _traceLevels->activatorCat); out << "deactivating `" << name << "' using process proxy"; } - - process->shutdown_async(new ShutdownCallback(this, name, _traceLevels)); + process->begin_shutdown(Ice::newCallback_Process_shutdown(new ShutdownCallback(this, name, _traceLevels), + &ShutdownCallback::exception)); return; } |