From: jfa Date: Wed, 9 Jan 2008 12:40:28 +0000 (+0000) Subject: NPAL18505: shutdownServers() function don't work if we have distributed containers. X-Git-Tag: for_M2008_07022008~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=061f337037893cb22bd5e1250cb0d518179298c1;p=modules%2Fgui.git NPAL18505: shutdownServers() function don't work if we have distributed containers. --- diff --git a/src/Session/SALOME_Session.hxx b/src/Session/SALOME_Session.hxx index 78c89d6d3..a52f3896f 100755 --- a/src/Session/SALOME_Session.hxx +++ b/src/Session/SALOME_Session.hxx @@ -44,4 +44,4 @@ #define SESSION_EXPORT #endif -#endif \ No newline at end of file +#endif diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index c94505e0e..e6b7b6474 100755 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -322,34 +322,40 @@ void shutdownServers( SALOME_NamingService* theNS ) session->ping(); string hostname = GetHostname(); - string containerName = "/Containers/" + hostname; + //string containerName = "/Containers/" + hostname; // 1) SuperVisionContainer - string containerNameSV = containerName + "/SuperVisionContainer"; - CORBA::Object_var objSV = theNS->Resolve(containerNameSV.c_str()); - Engines::Container_var SVcontainer = Engines::Container::_narrow(objSV) ; - if ( !CORBA::is_nil(SVcontainer) && ( session->getPID() != SVcontainer->getPID() ) ) - SVcontainer->Shutdown(); + //string containerNameSV = containerName + "/SuperVisionContainer"; + //CORBA::Object_var objSV = theNS->Resolve(containerNameSV.c_str()); + //Engines::Container_var SVcontainer = Engines::Container::_narrow(objSV) ; + //if ( !CORBA::is_nil(SVcontainer) && ( session->getPID() != SVcontainer->getPID() ) ) + // SVcontainer->Shutdown(); // 2) FactoryServerPy - string containerNameFSP = containerName + "/FactoryServerPy"; - CORBA::Object_var objFSP = theNS->Resolve(containerNameFSP.c_str()); - Engines::Container_var FSPcontainer = Engines::Container::_narrow(objFSP) ; - if ( !CORBA::is_nil(FSPcontainer) && ( session->getPID() != FSPcontainer->getPID() ) ) - FSPcontainer->Shutdown(); + //string containerNameFSP = containerName + "/FactoryServerPy"; + //CORBA::Object_var objFSP = theNS->Resolve(containerNameFSP.c_str()); + //Engines::Container_var FSPcontainer = Engines::Container::_narrow(objFSP) ; + //if ( !CORBA::is_nil(FSPcontainer) && ( session->getPID() != FSPcontainer->getPID() ) ) + // FSPcontainer->Shutdown(); // 3) FactoryServer - string containerNameFS = containerName + "/FactoryServer"; - CORBA::Object_var objFS = theNS->Resolve(containerNameFS.c_str()); - Engines::Container_var FScontainer = Engines::Container::_narrow(objFS) ; - if ( !CORBA::is_nil(FScontainer) && ( session->getPID() != FScontainer->getPID() ) ) - FScontainer->Shutdown(); + //string containerNameFS = containerName + "/FactoryServer"; + //CORBA::Object_var objFS = theNS->Resolve(containerNameFS.c_str()); + //Engines::Container_var FScontainer = Engines::Container::_narrow(objFS) ; + //if ( !CORBA::is_nil(FScontainer) && ( session->getPID() != FScontainer->getPID() ) ) + // FScontainer->Shutdown(); // 4) ContainerManager - CORBA::Object_var objCM=theNS->Resolve("/ContainerManager"); - Engines::ContainerManager_var contMan=Engines::ContainerManager::_narrow(objCM); - if ( !CORBA::is_nil(contMan) && ( session->getPID() != contMan->getPID() ) ) - contMan->ShutdownWithExit(); + //CORBA::Object_var objCM=theNS->Resolve("/ContainerManager"); + //Engines::ContainerManager_var contMan=Engines::ContainerManager::_narrow(objCM); + //if ( !CORBA::is_nil(contMan) && ( session->getPID() != contMan->getPID() ) ) + // contMan->ShutdownWithExit(); + + // 4) SalomeLauncher + CORBA::Object_var objSL = theNS->Resolve("/SalomeLauncher"); + Engines::SalomeLauncher_var launcher = Engines::SalomeLauncher::_narrow(objSL); + if (!CORBA::is_nil(launcher) && (session->getPID() != launcher->getPID())) + launcher->Shutdown(); // 5) ConnectionManager CORBA::Object_var objCnM=theNS->Resolve("/ConnectionManager");