From 7e20666a3732ae5411d9df0be0293b8505597257 Mon Sep 17 00:00:00 2001 From: Anthony GEAY Date: Fri, 19 Feb 2021 16:01:05 +0100 Subject: [PATCH] OK for SALOME_Launcher --- src/Session/Session_NS_wrapper.cxx | 30 ++++++++++++++++++++++++++++ src/Session/Session_NS_wrapper.hxx | 2 ++ src/Session/Session_ServerThread.cxx | 21 +------------------ 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/Session/Session_NS_wrapper.cxx b/src/Session/Session_NS_wrapper.cxx index b65708db0..77ffcace5 100644 --- a/src/Session/Session_NS_wrapper.cxx +++ b/src/Session/Session_NS_wrapper.cxx @@ -20,6 +20,7 @@ #include "Session_NS_wrapper.hxx" #include "SALOME_Container_i.hxx" +#include "SALOME_Launcher.hxx" #include "utilities.h" Engines_Container_i *OldStyleNS::activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char **argv) @@ -103,7 +104,36 @@ Engines_Container_i *OldStyleNS::activateContainer(CORBA::ORB_var orb, PortableS return _container; } +void OldStyleNS::activateContainerManager(CORBA::ORB_var orb) +{ + try { + PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa(); + std::cout << "Activate SalomeLauncher ......!!!! " << std::endl; + new SALOME_Launcher(orb,root_poa); + } + catch(CORBA::SystemException&) { + INFOS("Caught CORBA::SystemException."); + } + catch(PortableServer::POA::WrongPolicy&) { + INFOS("Caught CORBA::WrongPolicyException."); + } + catch(PortableServer::POA::ServantAlreadyActive&) { + INFOS("Caught CORBA::ServantAlreadyActiveException"); + } + catch(CORBA::Exception&) { + INFOS("Caught CORBA::Exception."); + } + catch(...) { + INFOS("Caught unknown exception."); + } +} + Engines_Container_i *NewStyleNS::activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char **argv) { return KERNEL::getContainerSA(); } + +void NewStyleNS::activateContainerManager(CORBA::ORB_var orb) +{ + KERNEL::getLauncherSA(); +} diff --git a/src/Session/Session_NS_wrapper.hxx b/src/Session/Session_NS_wrapper.hxx index 44fccdf51..e5a023c64 100644 --- a/src/Session/Session_NS_wrapper.hxx +++ b/src/Session/Session_NS_wrapper.hxx @@ -35,6 +35,7 @@ public: CORBA::Object_ptr Resolve(const char* Path) { return _NS.Resolve(Path); } RealNS *getNS() { return &_NS; } Engines_Container_i *activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char** argv); + void activateContainerManager(CORBA::ORB_var orb); private: RealNS _NS; }; @@ -51,6 +52,7 @@ public: CORBA::Object_ptr Resolve(const char* Path) { return _NS.Resolve(Path); } RealNS *getNS() { return &_NS; } Engines_Container_i *activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char** argv); + void activateContainerManager(CORBA::ORB_var orb); private: RealNS _NS; }; diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index e1effb791..aee8219da 100644 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -303,26 +303,7 @@ void Session_ServerThread::ActivateRegistry(int argc, char ** argv) template void Session_ServerThread::ActivateContainerManager(int /*argc*/, char** /*argv*/) { - try { - PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa(); - std::cout << "Activate SalomeLauncher ......!!!! " << std::endl; - new SALOME_Launcher(_orb,root_poa); - } - catch(CORBA::SystemException&) { - INFOS("Caught CORBA::SystemException."); - } - catch(PortableServer::POA::WrongPolicy&) { - INFOS("Caught CORBA::WrongPolicyException."); - } - catch(PortableServer::POA::ServantAlreadyActive&) { - INFOS("Caught CORBA::ServantAlreadyActiveException"); - } - catch(CORBA::Exception&) { - INFOS("Caught CORBA::Exception."); - } - catch(...) { - INFOS("Caught unknown exception."); - } + this->_NS->activateContainerManager(this->_orb); } template -- 2.39.2