Salome HOME
projects
/
modules
/
yacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PortManager] Separate ports according to their owner (this or other application)
[modules/yacs.git]
/
src
/
LifeCycleCORBA
/
SALOME_LifeCycleCORBA.cxx
diff --git
a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
old mode 100755
(executable)
new mode 100644
(file)
index
41e294e
..
75bf0dd
--- a/
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
+++ b/
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
4
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-42,14
+42,19
@@
#include <ServiceUnreachable.hxx>
#include "SALOME_LifeCycleCORBA.hxx"
#include <ServiceUnreachable.hxx>
#include "SALOME_LifeCycleCORBA.hxx"
+#include "SALOME_ResourcesManager.hxx"
+#include "SALOMESDS_DataServerManager.hxx"
+
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
#include CORBA_CLIENT_HEADER(SALOME_Session)
#include CORBA_CLIENT_HEADER(DSC_Engines)
#include CORBA_CLIENT_HEADER(SALOME_Registry)
#include CORBA_CLIENT_HEADER(SALOMEDS)
#include CORBA_CLIENT_HEADER(SALOME_ModuleCatalog)
#include CORBA_CLIENT_HEADER(SALOME_Session)
#include CORBA_CLIENT_HEADER(DSC_Engines)
#include CORBA_CLIENT_HEADER(SALOME_Registry)
#include CORBA_CLIENT_HEADER(SALOMEDS)
+#include CORBA_CLIENT_HEADER(SALOME_SDS)
#include CORBA_CLIENT_HEADER(Logger)
#include CORBA_CLIENT_HEADER(SALOME_Launcher)
#include CORBA_CLIENT_HEADER(Logger)
#include CORBA_CLIENT_HEADER(SALOME_Launcher)
+#include "SALOME_ResourcesManager.hxx"
#include "SALOME_ContainerManager.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
#include "SALOME_ContainerManager.hxx"
#include "SALOME_Component_i.hxx"
#include "SALOME_NamingService.hxx"
@@
-502,8
+507,20
@@
void SALOME_LifeCycleCORBA::shutdownServers()
#ifndef WIN32
nanosleep(&ts_req,0);
#endif
#ifndef WIN32
nanosleep(&ts_req,0);
#endif
+ // 4 ) Remote ScopeServer (the DataServer is hosted by SalomeLauncher shutdown right after)
+ try
+ {
+ CORBA::Object_var objDSM(_NS->Resolve(SALOMESDS::DataServerManager::NAME_IN_NS));
+ SALOME::DataServerManager_var dsm(SALOME::DataServerManager::_narrow(objDSM));
+ if ( !CORBA::is_nil(dsm) )
+ dsm->shutdownScopes();
+ }
+ catch(const CORBA::Exception& e)
+ {
+ // ignore and continue
+ }
- //
4
) SalomeLauncher
+ //
5
) SalomeLauncher
try
{
CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher");
try
{
CORBA::Object_var objSL = _NS->Resolve("/SalomeLauncher");
@@
-521,7
+538,7
@@
void SALOME_LifeCycleCORBA::shutdownServers()
nanosleep(&ts_req,0);
#endif
nanosleep(&ts_req,0);
#endif
- //
5
) Registry
+ //
6
) Registry
try
{
CORBA::Object_var objR = _NS->Resolve("/Registry");
try
{
CORBA::Object_var objR = _NS->Resolve("/Registry");
@@
-534,20
+551,6
@@
void SALOME_LifeCycleCORBA::shutdownServers()
// ignore and continue
}
// ignore and continue
}
- /*
- // 6) Session
- if ( !CORBA::is_nil( session ) ) {
- try
- {
- session->Shutdown();
- }
- catch(const CORBA::Exception& e)
- {
- // ignore and continue
- }
- }
- */
-
// 7) Logger
int argc = 0;
char *xargv = (char*)"";
// 7) Logger
int argc = 0;
char *xargv = (char*)"";
@@
-594,54
+597,38
@@
void SALOME_LifeCycleCORBA::shutdownServers()
void SALOME_LifeCycleCORBA::killOmniNames()
{
std::string portNumber (::getenv ("NSPORT") );
void SALOME_LifeCycleCORBA::killOmniNames()
{
std::string portNumber (::getenv ("NSPORT") );
- if ( !portNumber.empty() )
- {
-#ifdef WIN32
-#else
- std::string cmd ;
- cmd = std::string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*")
- + portNumber
- + std::string("\" | awk '{cmd=sprintf(\"kill -9 %s\",$1); system(cmd)}'" );
- MESSAGE(cmd);
- try {
- system ( cmd.c_str() );
- }
- catch ( ... ) {
- }
-#endif
- }
-
std::string python_exe;
python_exe = std::string("python");
std::string python_exe;
python_exe = std::string("python");
-#ifdef WIN32
- #ifdef _DEBUG_
- python_exe += std::string("_d");
- #endif
-#endif
if ( !portNumber.empty() )
{
if ( !portNumber.empty() )
{
- std::string cmd = ("from killSalomeWithPort import cleanApplication; ");
+ std::string cmd;
+
+ cmd = std::string("from salome_utils import killOmniNames; ");
+ cmd += std::string("killOmniNames(") + portNumber + "); ";
+ cmd = python_exe + std::string(" -c \"") + cmd +"\"";
+ MESSAGE(cmd);
+ system( cmd.c_str() );
+
+ cmd = std::string("from killSalomeWithPort import cleanApplication; ");
cmd += std::string("cleanApplication(") + portNumber + "); ";
cmd += std::string("cleanApplication(") + portNumber + "); ";
- //cmd = python_exe + std::string(" -c \"") + cmd +"\" > /dev/null 2> /dev/null";
cmd = python_exe + std::string(" -c \"") + cmd +"\"";
MESSAGE(cmd);
system( cmd.c_str() );
}
cmd = python_exe + std::string(" -c \"") + cmd +"\"";
MESSAGE(cmd);
system( cmd.c_str() );
}
-#ifdef WITH_PORTMANAGER
// shutdown portmanager
if ( !portNumber.empty() )
{
// shutdown portmanager
if ( !portNumber.empty() )
{
- std::string cmd = ("from PortManager import releasePort; ");
+ std::string cmd;
+
+ cmd = std::string("from PortManager import releasePort; ");
cmd += std::string("releasePort(") + portNumber + "); ";
cmd += std::string("releasePort(") + portNumber + "); ";
- //cmd = python_exe + std::string(" -c \"") + cmd +"\" > /dev/null 2> /dev/null";
cmd = python_exe + std::string(" -c \"") + cmd +"\"";
MESSAGE(cmd);
system( cmd.c_str() );
}
cmd = python_exe + std::string(" -c \"") + cmd +"\"";
MESSAGE(cmd);
system( cmd.c_str() );
}
-#endif
}
//=============================================================================
}
//=============================================================================