From 00c0f5a0058cc9b48cad369c7e4231471a5de86f Mon Sep 17 00:00:00 2001 From: ageay Date: Mon, 17 Jan 2005 16:36:14 +0000 Subject: [PATCH] *** empty log message *** --- bin/runSalome.py | 36 +- idl/Makefile.in | 2 +- idl/SALOME_Component.idl | 2 +- idl/SALOME_ContainerManager.idl | 8 +- src/Container/Container_i.cxx | 266 ++++++++------- src/Container/Makefile.in | 6 +- src/Container/SALOME_Container.cxx | 13 +- src/Container/SALOME_ContainerManager.cxx | 66 +++- src/Container/SALOME_ContainerManager.hxx | 13 +- .../SALOME_ContainerManagerServer.cxx | 4 +- src/Container/SALOME_Container_i.hxx | 6 +- src/LifeCycleCORBA/LifeCycleCORBA.py | 314 +++++++++++------- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx | 38 +-- src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx | 13 +- src/MPIContainer/MPIContainer_i.cxx | 2 +- src/NamingService/SALOME_NamingService.cxx | 73 +++- src/NamingService/SALOME_NamingService.hxx | 8 + src/ResourcesManager/Makefile.in | 6 +- .../SALOME_LoadRateManager.cxx | 2 +- .../SALOME_LoadRateManager.hxx | 2 +- .../SALOME_ResourcesCatalog_Handler.cxx | 12 +- .../SALOME_ResourcesManager.cxx | 55 ++- .../SALOME_ResourcesManager.hxx | 6 +- src/SALOMEDS/Makefile.in | 4 +- src/SALOMEGUI/Makefile.in | 1 + src/SALOME_PY/Makefile.in | 1 + src/SALOME_PYQT/Makefile.in | 2 +- src/SUPERVGraph/Makefile.in | 1 + src/Session/Makefile.in | 4 +- src/Session/Session_ServerLauncher.cxx | 13 +- src/Session/Session_ServerThread.cxx | 51 ++- src/Session/Session_ServerThread.hxx | 2 + src/TOOLSGUI/Makefile.in | 2 +- src/TestContainer/Makefile.in | 2 +- src/VTKViewer/Makefile.in | 1 + 35 files changed, 671 insertions(+), 366 deletions(-) diff --git a/bin/runSalome.py b/bin/runSalome.py index 9cb2cfc67..501ab8317 100755 --- a/bin/runSalome.py +++ b/bin/runSalome.py @@ -250,7 +250,6 @@ class Server: pid = os.spawnvp(os.P_NOWAIT, command[0], command) process_id[pid]=self.CMD -# --- class CatalogServer(Server): def __init__(self,args): @@ -447,6 +446,8 @@ def startSalome(args, modules_list, modules_root_dir): # Notify Server launch # + print "Notify Server to launch" + myServer=NotifyServer(args,modules_root_dir) myServer.run() @@ -464,6 +465,9 @@ def startSalome(args, modules_list, modules_root_dir): # Lancement Catalog Server, # attente de la disponibilité du Catalog Server dans le Naming Service # + + print "LAUNCHING Modeule Catalog ......." + if 'moduleCatalog' not in args['embedded']: cataServer=CatalogServer(args) @@ -503,10 +507,14 @@ def startSalome(args, modules_list, modules_root_dir): # Lancement Session Server # + print "LAUNCHING Session Server ......." + mySessionServ = SessionServer(args) mySessionServ.setpath(modules_list,modules_root_dir) mySessionServ.run() + print "LAUNCHING Session Server ....... end" + #macomm2=['ddd'] #pid = os.spawnvp(os.P_NOWAIT, macomm2[0], macomm2) # @@ -525,16 +533,16 @@ def startSalome(args, modules_list, modules_root_dir): os.environ["HOSTNAME"]=os.getenv("HOST") theComputer = getShortHostName() - + # # Lancement Container C++ local, # attente de la disponibilité du Container C++ local dans le Naming Service # - if 'cppContainer' in args['standalone']: - myServer=ContainerCPPServer(args) - myServer.run() - clt.waitNS("/Containers/" + theComputer + "/FactoryServer") +## if 'cppContainer' in args['standalone']: +## myServer=ContainerCPPServer(args) +## myServer.run() +## clt.waitNS("/Containers/" + theComputer + "/FactoryServer") # # Lancement Container Python local, @@ -542,10 +550,10 @@ def startSalome(args, modules_list, modules_root_dir): # dans le Naming Service # - if 'pyContainer' in args['standalone']: - myServer=ContainerPYServer(args) - myServer.run() - clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy") +## if 'pyContainer' in args['standalone']: +## myServer=ContainerPYServer(args) +## myServer.run() +## clt.waitNS("/Containers/" + theComputer + "/FactoryServerPy") # # Lancement Container Supervision local, @@ -553,10 +561,10 @@ def startSalome(args, modules_list, modules_root_dir): # dans le Naming Service # - if 'supervContainer' in args['standalone']: - myServer=ContainerSUPERVServer(args) - myServer.run() - clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer") +## if 'supervContainer' in args['standalone']: +## myServer=ContainerSUPERVServer(args) +## myServer.run() +## clt.waitNS("/Containers/" + theComputer + "/SuperVisionContainer") end_time = os.times() print diff --git a/idl/Makefile.in b/idl/Makefile.in index a2ff1794e..40542236a 100644 --- a/idl/Makefile.in +++ b/idl/Makefile.in @@ -19,8 +19,8 @@ IDL_FILES = \ SALOMEDS.idl \ SALOMEDS_Attributes.idl \ SALOME_Session.idl \ - SALOME_ContainerManager.idl \ SALOME_Component.idl \ + SALOME_ContainerManager.idl \ SALOME_TestComponent.idl \ SALOME_Registry.idl \ SALOME_MPIObject.idl \ diff --git a/idl/SALOME_Component.idl b/idl/SALOME_Component.idl index 8112ecedd..8760ae9df 100644 --- a/idl/SALOME_Component.idl +++ b/idl/SALOME_Component.idl @@ -91,7 +91,7 @@ module Engines /*! Shutdown the Container process. */ - void Shutdown(); + oneway void Shutdown(); /*! Returns the hostname of the container */ diff --git a/idl/SALOME_ContainerManager.idl b/idl/SALOME_ContainerManager.idl index 1b9b97828..d8a57247e 100644 --- a/idl/SALOME_ContainerManager.idl +++ b/idl/SALOME_ContainerManager.idl @@ -3,6 +3,9 @@ #include "SALOME_Component.idl" +module Engines +{ + /*! Type to describe properties of wanted resource. */ @@ -21,8 +24,6 @@ struct MachineParameters { */ typedef sequence MachineList; -module Engines -{ /*! \brief Interface of the %containerManager This interface is used for interaction with the unique instance of ContainerManager */ @@ -30,7 +31,8 @@ module Engines { Container FindOrStartContainer( in string containerName, in MachineList possibleComputers); string FindBest(in MachineList possibleComputers); - MachineList GetResourcesFitting( in MachineParameters params, in string componentName ); + MachineList GetFittingResources( in MachineParameters params, in string componentName ); + void Shutdown(); void ShutdownContainers(); } ; }; diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index f2dba5906..05ebef448 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -30,7 +30,7 @@ #include CORBA_SERVER_HEADER(SALOME_Component) #include "SALOME_Container_i.hxx" #include "SALOME_NamingService.hxx" -#include "Utils_SINGLETON.hxx" +//#include "Utils_SINGLETON.hxx" #include "OpUtil.hxx" #include #include @@ -64,13 +64,12 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, char *containerName , int argc , char* argv[], - bool regist, - bool activ ) : + bool activAndRegist ) : _numInstance(0) { _pid = (long)getpid(); - if(regist) + if(activAndRegist) ActSigIntHandler() ; _ArgC = argc ; @@ -105,21 +104,16 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, _orb = CORBA::ORB::_duplicate(orb) ; _poa = PortableServer::POA::_duplicate(poa) ; - // Pour les containers paralleles: il ne faut pas activer le container generique, mais le container specialise - if(activ){ - MESSAGE("activate object"); - _id = _poa->activate_object(this); - } - - // Pour les containers paralleles: il ne faut pas enregistrer le container generique, mais le container specialise - if(regist){ - // _NS = new SALOME_NamingService(_orb); - _NS = SINGLETON_::Instance() ; - ASSERT(SINGLETON_::IsAlreadyExisting()) ; - _NS->init_orb( orb ) ; - Engines::Container_ptr pCont - = Engines::Container::_narrow(_this()); + // Pour les containers paralleles: il ne faut pas enregistrer et activer le container generique, mais le container specialise + if(activAndRegist){ + _id = _poa->activate_object(this); + _NS = new SALOME_NamingService();//SINGLETON_::Instance() ; + //ASSERT(SINGLETON_::IsAlreadyExisting()) ; + _NS->init_orb( CORBA::ORB::_duplicate(_orb) ) ; + CORBA::Object_var obj=_poa->id_to_reference(*_id); + Engines::Container_var pCont + = Engines::Container::_narrow(obj); SCRUTE(_containerName); _NS->Register(pCont, _containerName.c_str()); } @@ -128,6 +122,8 @@ Engines_Container_i::Engines_Container_i (CORBA::ORB_ptr orb, Engines_Container_i::~Engines_Container_i() { MESSAGE("Container_i::~Container_i()"); + delete _id; + cout << "Engines_Container_i ~~~~~~~~~~~~~~" << endl; } char* Engines_Container_i::name() @@ -151,6 +147,9 @@ void Engines_Container_i::ping() void Engines_Container_i::Shutdown() { MESSAGE("Engines_Container_i::Shutdown()"); + _NS->Destroy_Name(_containerName.c_str()); + //_remove_ref(); + //_poa->deactivate_object(*_id); _orb->shutdown(0); } @@ -162,126 +161,123 @@ bool Engines_Container_i::Kill_impl() { exit( 0 ) ; } -//! Launch a new container from the current container -Engines::Container_ptr Engines_Container_i::start_impl( - const char* ContainerName ) { - MESSAGE("start_impl argc " << _argc << " ContainerName " << ContainerName - << hex << this << dec) ; - _numInstanceMutex.lock() ; // lock on the instance number - - CORBA::Object_var obj = Engines::Container::_nil() ; - bool nilvar = true ; - try { - string cont("/Containers/"); - cont += machineName() ; - cont += "/" ; - cont += ContainerName; - INFOS(machineName() << " start_impl unknown container " << cont.c_str() - << " try to Resolve" ); - obj = _NS->Resolve( cont.c_str() ); - nilvar = CORBA::is_nil( obj ) ; - if ( nilvar ) { - INFOS(machineName() << " start_impl unknown container " - << ContainerName); - } - } - catch (ServiceUnreachable&) { - INFOS(machineName() << "Caught exception: Naming Service Unreachable"); - } - catch (...) { - INFOS(machineName() << "Caught unknown exception."); - } - if ( !nilvar ) { - _numInstanceMutex.unlock() ; - MESSAGE("start_impl container found without new launch") ; - return Engines::Container::_narrow(obj); - } - int i = 0 ; - while ( _argv[ i ] ) { - MESSAGE(" argv" << i << " " << _argv[ i ]) ; - i++ ; - } - string shstr = string(getenv("KERNEL_ROOT_DIR")) + "/bin/salome/SALOME_Container "; -// string shstr( "./runSession SALOME_Container " ) ; - shstr += ContainerName ; - if ( _argc == 4 ) { - shstr += " " ; - shstr += _argv[ 2 ] ; - shstr += " " ; - shstr += _argv[ 3 ] ; - } - shstr += " > /tmp/" ; - shstr += ContainerName ; - shstr += ".log 2>&1 &" ; - MESSAGE("system(" << shstr << ")") ; - int status = system( shstr.c_str() ) ; - if (status == -1) { - INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status -1)") ; - } - else if (status == 217) { - INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status 217)") ; - } - INFOS(machineName() << " Engines_Container_i::start_impl SALOME_Container launch done"); - -// pid_t pid = fork() ; -// if ( pid == 0 ) { -// string anExe( _argv[ 0 ] ) ; -// anExe += "runSession" ; -// char * args[ 6 ] ; -// args[ 0 ] = "runSession" ; -// args[ 1 ] = "SALOME_Container" ; -// args[ 2 ] = strdup( ContainerName ) ; -// args[ 3 ] = strdup( _argv[ 2 ] ) ; -// args[ 4 ] = strdup( _argv[ 3 ] ) ; -// args[ 5 ] = NULL ; -// MESSAGE("execl(" << anExe.c_str() << " , " << args[ 0 ] << " , " -// << args[ 1 ] << " , " << args[ 2 ] << " , " << args[ 3 ] -// << " , " << args[ 4 ] << ")") ; -// int status = execv( anExe.c_str() , args ) ; -// if (status == -1) { -// INFOS("Engines_Container_i::start_impl execl failed (system command status -1)") ; -// perror( "Engines_Container_i::start_impl execl error ") ; +// //! Launch a new container from the current container +// Engines::Container_ptr Engines_Container_i::start_impl( +// const char* ContainerName ) { +// MESSAGE("start_impl argc " << _argc << " ContainerName " << ContainerName +// << hex << this << dec) ; +// _numInstanceMutex.lock() ; // lock on the instance number + +// CORBA::Object_var obj = Engines::Container::_nil() ; +// bool nilvar = true ; +// try { +// string cont=BuildContainerNameForNS(machineName(),ContainerName); +// INFOS(machineName() << " start_impl unknown container " << cont.c_str() +// << " try to Resolve" ); +// obj = _NS->Resolve( cont.c_str() ); +// nilvar = CORBA::is_nil( obj ) ; +// if ( nilvar ) { +// INFOS(machineName() << " start_impl unknown container " +// << ContainerName); +// } +// } +// catch (ServiceUnreachable&) { +// INFOS(machineName() << "Caught exception: Naming Service Unreachable"); +// } +// catch (...) { +// INFOS(machineName() << "Caught unknown exception."); +// } +// if ( !nilvar ) { +// _numInstanceMutex.unlock() ; +// MESSAGE("start_impl container found without new launch") ; +// return Engines::Container::_narrow(obj); +// } +// int i = 0 ; +// while ( _argv[ i ] ) { +// MESSAGE(" argv" << i << " " << _argv[ i ]) ; +// i++ ; +// } +// string shstr = string(getenv("KERNEL_ROOT_DIR")) + "/bin/salome/SALOME_Container "; +// // string shstr( "./runSession SALOME_Container " ) ; +// shstr += ContainerName ; +// if ( _argc == 4 ) { +// shstr += " " ; +// shstr += _argv[ 2 ] ; +// shstr += " " ; +// shstr += _argv[ 3 ] ; +// } +// shstr += " > /tmp/" ; +// shstr += ContainerName ; +// shstr += ".log 2>&1 &" ; +// MESSAGE("system(" << shstr << ")") ; +// int status = system( shstr.c_str() ) ; +// if (status == -1) { +// INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status -1)") ; +// } +// else if (status == 217) { +// INFOS("Engines_Container_i::start_impl SALOME_Container failed (system command status 217)") ; +// } +// INFOS(machineName() << " Engines_Container_i::start_impl SALOME_Container launch done"); + +// // pid_t pid = fork() ; +// // if ( pid == 0 ) { +// // string anExe( _argv[ 0 ] ) ; +// // anExe += "runSession" ; +// // char * args[ 6 ] ; +// // args[ 0 ] = "runSession" ; +// // args[ 1 ] = "SALOME_Container" ; +// // args[ 2 ] = strdup( ContainerName ) ; +// // args[ 3 ] = strdup( _argv[ 2 ] ) ; +// // args[ 4 ] = strdup( _argv[ 3 ] ) ; +// // args[ 5 ] = NULL ; +// // MESSAGE("execl(" << anExe.c_str() << " , " << args[ 0 ] << " , " +// // << args[ 1 ] << " , " << args[ 2 ] << " , " << args[ 3 ] +// // << " , " << args[ 4 ] << ")") ; +// // int status = execv( anExe.c_str() , args ) ; +// // if (status == -1) { +// // INFOS("Engines_Container_i::start_impl execl failed (system command status -1)") ; +// // perror( "Engines_Container_i::start_impl execl error ") ; +// // } +// // else { +// // INFOS(machineName() << " Engines_Container_i::start_impl execl done"); +// // } +// // exit(0) ; +// // } + +// obj = Engines::Container::_nil() ; +// try { +// string cont("/Containers/"); +// cont += machineName() ; +// cont += "/" ; +// cont += ContainerName; +// nilvar = true ; +// int count = 20 ; +// while ( nilvar && count >= 0) { +// sleep( 1 ) ; +// obj = _NS->Resolve(cont.c_str()); +// nilvar = CORBA::is_nil( obj ) ; +// if ( nilvar ) { +// INFOS(count << ". " << machineName() +// << " start_impl unknown container " << cont.c_str()); +// count -= 1 ; +// } // } -// else { -// INFOS(machineName() << " Engines_Container_i::start_impl execl done"); +// _numInstanceMutex.unlock() ; +// if ( !nilvar ) { +// MESSAGE("start_impl container found after new launch of SALOME_Container") ; // } -// exit(0) ; +// return Engines::Container::_narrow(obj); // } - - obj = Engines::Container::_nil() ; - try { - string cont("/Containers/"); - cont += machineName() ; - cont += "/" ; - cont += ContainerName; - nilvar = true ; - int count = 20 ; - while ( nilvar && count >= 0) { - sleep( 1 ) ; - obj = _NS->Resolve(cont.c_str()); - nilvar = CORBA::is_nil( obj ) ; - if ( nilvar ) { - INFOS(count << ". " << machineName() - << " start_impl unknown container " << cont.c_str()); - count -= 1 ; - } - } - _numInstanceMutex.unlock() ; - if ( !nilvar ) { - MESSAGE("start_impl container found after new launch of SALOME_Container") ; - } - return Engines::Container::_narrow(obj); - } - catch (ServiceUnreachable&) { - INFOS(machineName() << "Caught exception: Naming Service Unreachable"); - } - catch (...) { - INFOS(machineName() << "Caught unknown exception."); - } - _numInstanceMutex.unlock() ; - MESSAGE("start_impl container not found after new launch of SALOME_Container") ; - return Engines::Container::_nil() ; -} +// catch (ServiceUnreachable&) { +// INFOS(machineName() << "Caught exception: Naming Service Unreachable"); +// } +// catch (...) { +// INFOS(machineName() << "Caught unknown exception."); +// } +// _numInstanceMutex.unlock() ; +// MESSAGE("start_impl container not found after new launch of SALOME_Container") ; +// return Engines::Container::_nil() ; +// } Engines::Component_ptr Engines_Container_i::load_impl( const char* nameToRegister, const char* componentName ) { diff --git a/src/Container/Makefile.in b/src/Container/Makefile.in index 96c370046..45f671bf6 100644 --- a/src/Container/Makefile.in +++ b/src/Container/Makefile.in @@ -45,11 +45,11 @@ EXPORT_HEADERS = \ LIB = libSalomeContainer.la LIB_SRC = Component_i.cxx Container_i.cxx SALOME_ContainerManager.cxx -LIB_SERVER_IDL = SALOME_Registry.idl SALOME_Component.idl -LIB_CLIENT_IDL = SALOME_ContainerManager.idl +LIB_SERVER_IDL = SALOME_Registry.idl SALOME_Component.idl SALOME_ContainerManager.idl +LIB_CLIENT_IDL = # Executables targets -BIN = SALOME_Container SALOME_ContainerManagerServer +BIN = SALOME_Container BIN_SRC = SALOME_Container_SignalsHandler.cxx BIN_SERVER_IDL = SALOME_Component.idl SALOME_ContainerManager.idl diff --git a/src/Container/SALOME_Container.cxx b/src/Container/SALOME_Container.cxx index 02b2acce4..ae31b29a6 100644 --- a/src/Container/SALOME_Container.cxx +++ b/src/Container/SALOME_Container.cxx @@ -30,8 +30,9 @@ #include #include -#include "Utils_ORB_INIT.hxx" -#include "Utils_SINGLETON.hxx" +//#include "Utils_ORB_INIT.hxx" +//#include "Utils_SINGLETON.hxx" +#include #include "SALOME_NamingService.hxx" #include "SALOME_Container_i.hxx" #include "utilities.h" @@ -59,8 +60,8 @@ int main(int argc, char* argv[]) MPI_Init(&argc,&argv); #endif // Initialise the ORB. - ORB_INIT &init = *SINGLETON_::Instance() ; - CORBA::ORB_var &orb = init( argc , argv ) ; + //ORB_INIT &init = *SINGLETON_::Instance() ; + CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ; LocalTraceCollector *myThreadTrace = LocalTraceCollector::instance(orb); INFOS_COMPILATION; BEGIN_OF(argv[0]); @@ -87,7 +88,7 @@ int main(int argc, char* argv[]) CORBA::Object_var theObj; CORBA::Object_var obj; CORBA::Object_var object; - SALOME_NamingService &naming = *SINGLETON_::Instance() ; + //SALOME_NamingService &naming = *SINGLETON_::Instance() ; int CONTAINER=0; const char * Env = getenv("USE_LOGGER"); int EnvL =0; @@ -191,8 +192,6 @@ int main(int argc, char* argv[]) #endif HandleServerSideSignals(orb); - - orb->destroy(); }catch(CORBA::SystemException&){ INFOS("Caught CORBA::SystemException."); }catch(PortableServer::POA::WrongPolicy&){ diff --git a/src/Container/SALOME_ContainerManager.cxx b/src/Container/SALOME_ContainerManager.cxx index 66d2e2eee..367380e35 100644 --- a/src/Container/SALOME_ContainerManager.cxx +++ b/src/Container/SALOME_ContainerManager.cxx @@ -3,19 +3,55 @@ #include "OpUtil.hxx" #include #include +#include + #define TIME_OUT_TO_LAUNCH_CONT 21 using namespace std; const char *SALOME_ContainerManager::_ContainerManagerNameInNS="ContainerManager"; -SALOME_ContainerManager::SALOME_ContainerManager(SALOME_NamingService *ns):_NS(ns) +SALOME_ContainerManager::SALOME_ContainerManager(CORBA::ORB_ptr orb) +{ + _NS=new SALOME_NamingService(orb); + PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa(); + PortableServer::ObjectId_var id=root_poa->activate_object(this); + CORBA::Object_var obj=root_poa->id_to_reference(id); + Engines::ContainerManager_var refContMan = Engines::ContainerManager::_narrow(obj); + cout << "SALOME_ContainerManager constructor ***** " << endl; + _NS->Register(refContMan,_ContainerManagerNameInNS); +} + +SALOME_ContainerManager::~SALOME_ContainerManager() +{ + delete _NS; +} + +void SALOME_ContainerManager::Shutdown() { + ShutdownContainers(); + PortableServer::ObjectId_var oid = _default_POA()->servant_to_id(this); + _default_POA()->deactivate_object(oid); + _remove_ref(); + } -Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const char *containerName, const MachineList& possibleComputers) +void SALOME_ContainerManager::ShutdownContainers() { - Engines::Container_ptr ret=DoesExistContainer(containerName,possibleComputers); + _NS->Change_Directory("/Containers"); + vector vec=_NS->list_directory_recurs(); + for(vector::iterator iter=vec.begin();iter!=vec.end();iter++) + { + CORBA::Object_var obj=_NS->Resolve((*iter).c_str()); + Engines::Container_var cont=Engines::Container::_narrow(obj); + if(!CORBA::is_nil(cont)) + cont->Shutdown(); + } +} + +Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const char *containerName, const Engines::MachineList& possibleComputers) +{ + Engines::Container_ptr ret=FindContainer(containerName,possibleComputers); if(!CORBA::is_nil(ret)) return ret; // Container doesn't exist try to launch it ... @@ -25,7 +61,11 @@ Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const char if(theMachine==GetHostname()) command=_ResManager.BuildCommandToLaunchLocalContainer(containerName); else - command=_ResManager.BuildTempFileToLaunchRemoteContainer(theMachine,containerName); + { + cout << "SALOME_ContainerManager::FindOrStartContainer -- Building file ..." << endl; + command=_ResManager.BuildTempFileToLaunchRemoteContainer(theMachine,containerName); + cout << "SALOME_ContainerManager::FindOrStartContainer -- Building file done !!! ..." << endl; + } _ResManager.RmTmpFile(); int status=system(command.c_str()); if (status == -1) { @@ -54,28 +94,28 @@ Engines::Container_ptr SALOME_ContainerManager::FindOrStartContainer(const char } } -MachineList *SALOME_ContainerManager::GetResourcesFitting(const MachineParameters& params, const char *componentName) +Engines::MachineList *SALOME_ContainerManager::GetFittingResources(const Engines::MachineParameters& params, const char *componentName) { - vector vec=_ResManager.GetResourcesFitting(params,componentName); - MachineList *ret=new MachineList; + cout << "*********SALOME_ContainerManager::GetFittingResources" << endl; + vector vec=_ResManager.GetFittingResources(params,componentName); + Engines::MachineList *ret=new Engines::MachineList; ret->length(vec.size()); + cout << "*********SALOME_ContainerManager::GetFittingResources 2" << endl; for(unsigned int i=0;i -#include class SALOME_NamingService; @@ -19,15 +18,17 @@ private: SALOME_LoadRateManager _LoadManager; SALOME_NamingService *_NS; public: - SALOME_ContainerManager(SALOME_NamingService *ns); - Engines::Container_ptr FindOrStartContainer(const char *containerName, const MachineList& possibleComputer); - MachineList *GetResourcesFitting(const MachineParameters& params, const char *componentName); - char* FindBest(const MachineList& possibleComputers); + SALOME_ContainerManager(CORBA::ORB_ptr orb); + ~SALOME_ContainerManager(); + Engines::Container_ptr FindOrStartContainer(const char *containerName, const Engines::MachineList& possibleComputer); + Engines::MachineList *GetFittingResources(const Engines::MachineParameters& params, const char *componentName); + char* FindBest(const Engines::MachineList& possibleComputers); + void Shutdown(); void ShutdownContainers(); static const char *_ContainerManagerNameInNS; private: - Engines::Container_ptr DoesExistContainer(const char *containerName,const MachineList& possibleComputers); + Engines::Container_ptr FindContainer(const char *containerName,const Engines::MachineList& possibleComputers); Engines::Container_ptr FindContainer(const char *containerName,const char *theMachine); std::string BuildContainerNameInNS(const char *containerName,const char *machineName); }; diff --git a/src/Container/SALOME_ContainerManagerServer.cxx b/src/Container/SALOME_ContainerManagerServer.cxx index d1a5a0766..d48768f57 100644 --- a/src/Container/SALOME_ContainerManagerServer.cxx +++ b/src/Container/SALOME_ContainerManagerServer.cxx @@ -16,8 +16,8 @@ int main(int argc, char *argv[]) try { SALOME_NamingService *ns=new SALOME_NamingService(orb); SALOME_ContainerManager *contManager=new SALOME_ContainerManager(ns); - Engines::ContainerManager_ptr contManagerServant=contManager->_this(); - ns->Register(contManagerServant,SALOME_ContainerManager::_ContainerManagerNameInNS); + //Engines::ContainerManager_ptr contManagerServant=contManager->_this(); + //ns->Register(contManagerServant,SALOME_ContainerManager::_ContainerManagerNameInNS); CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); PortableServer::POA_var root_poa = PortableServer::POA::_narrow(obj); PortableServer::POAManager_var pman = root_poa->the_POAManager(); diff --git a/src/Container/SALOME_Container_i.hxx b/src/Container/SALOME_Container_i.hxx index 90c3d1d81..249f80657 100644 --- a/src/Container/SALOME_Container_i.hxx +++ b/src/Container/SALOME_Container_i.hxx @@ -52,14 +52,10 @@ public: PortableServer::POA_ptr poa, char * containerName , int argc, char* argv[], - bool regist = true, - bool activ = true); + bool activAndRegist = true); virtual ~Engines_Container_i(); - //! Launch a new container from the current container - Engines::Container_ptr start_impl(const char* ContainerName); - //! Load component in current container Engines::Component_ptr load_impl(const char* nameToRegister, const char* componentName); diff --git a/src/LifeCycleCORBA/LifeCycleCORBA.py b/src/LifeCycleCORBA/LifeCycleCORBA.py index 273916dd4..97e8155ae 100644 --- a/src/LifeCycleCORBA/LifeCycleCORBA.py +++ b/src/LifeCycleCORBA/LifeCycleCORBA.py @@ -78,6 +78,15 @@ class LifeCycleCORBA: if self._catalog is None: MESSAGE( "/Kernel.dir/ModulCatalog.object exists but is not a ModulCatalog" ) + name = [CosNaming.NameComponent("ContainerManager","object")] + try: + obj = self._rootContext.resolve(name) + except CosNaming.NamingContext.NotFound, ex: + MESSAGE( "ContainerManager.object not found in Naming Service" ) + self._contManager = obj._narrow(Engines.ContainerManager) + if self._contManager is None: + MESSAGE( "ContainerManager.object exists but is not a ContainerManager") + #------------------------------------------------------------------------- def ContainerName(self, containerName): @@ -130,120 +139,203 @@ class LifeCycleCORBA: #------------------------------------------------------------------------- - def FindOrStartContainer(self, theComputer , theContainer ): - MESSAGE( "FindOrStartContainer" + theComputer + theContainer ) - aContainer = self.FindContainer( theComputer + "/" + theContainer ) - if aContainer is None : - if (theContainer == "FactoryServer") | (theContainer == "FactoryServerPy") : - myMachine=getShortHostName() - if theComputer == myMachine : - rshstr = "" - else : - rshstr = "rsh -n " + theComputer + " " - path = self.ComputerPath( theComputer ) -## if path != "" : -## rshstr = rshstr + path + "/../bin/" -## else : -## rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/" - if theContainer == "FactoryServer" : - rshstr = rshstr + path + "SALOME_Container " - else : - rshstr = rshstr + path + "SALOME_ContainerPy.py '" - rshstr = rshstr + theContainer + " -" - omniORBcfg = os.getenv( "OMNIORB_CONFIG" ) - file = os.open( omniORBcfg , os.O_RDONLY ) - ORBInitRef = os.read(file,132) - if ORBInitRef[len(ORBInitRef)-1] == '\n' : - ORBInitRef,bsn = ORBInitRef.split('\n') - os.close( file ) - rshstr = rshstr + ORBInitRef - if theContainer == "FactoryServerPy" : - rshstr = rshstr + "'" - rshstr = rshstr + " > /tmp/" + theContainer + "_" - rshstr = rshstr + theComputer - rshstr = rshstr + ".log 2>&1 &" - os.system( rshstr ) - MESSAGE( "FindOrStartContainer" + rshstr + " done" ) - else : - if theContainer.find('Py') == -1 : - aContainer = self.FindContainer( theComputer + "/" + "FactoryServer" ) - else : - aContainer = self.FindContainer( theComputer + "/" + "FactoryServerPy" ) - aContainer = aContainer.start_impl( theContainer ) - - count = 21 - while aContainer is None : - time.sleep(1) - count = count - 1 - MESSAGE( str(count) + ". Waiting for " + theComputer + "/" + theContainer ) - aContainer = self.FindContainer( theComputer + "/" + theContainer ) - if count == 0 : - return aContainer - - return aContainer - #os.system("rsh -n dm2s0017 /export/home/KERNEL_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515") + def FindComponent(self,containerName,componentName,listOfMachines): + if containerName!="": + machinesOK=[] + for i in range(len(listOfMachines)): + currentMachine=listOfMachines[i] + componentNameForNS= [CosNaming.NameComponent(currentMachine,"dir"), + CosNaming.NameComponent(containerName,"dir"), + CosNaming.NameComponent(componentName,"object")] + obj=None + try: + obj = self._containerRootContext.resolve(componentNameForNS) + except CosNaming.NamingContext.NotFound, ex: + MESSAGE( "component " + componentName + " not found on machine " + currentMachine + " , trying to load" ) + pass + if obj is not None: + machinesOK.append(currentMachine) + pass + pass + print "Finding best ..........",len(machinesOK) + if len(machinesOK)!=0: + print "Finding best .........." + bestMachine=self._contManager.FindBest(machinesOK) + print "Finding best done .........." + componentNameForNS= [CosNaming.NameComponent(bestMachine,"dir"), + CosNaming.NameComponent(containerName,"dir"), + CosNaming.NameComponent(componentName,"object")] + obj=None + try: + obj = self._containerRootContext.resolve(componentNameForNS) + except: + pass + if obj is not None: + return obj._narrow(Engines.Component) + else: + MESSAGE( "Big problem !!!") + return None + else: + return None + else: + bestMachine=self._contManager.FindBest(listOfMachines) + MESSAGE("Not implemented yet ...") + return None + pass #------------------------------------------------------------------------- - def FindOrLoadComponent(self, containerName, componentName): - - theComputer,theContainer = self.ContainerName( containerName ) - name = [CosNaming.NameComponent(theComputer,"dir"), - CosNaming.NameComponent(theContainer,"dir"), - CosNaming.NameComponent(componentName,"object")] + def LoadComponent(self,containerName,componentName,listOfMachine): + container=self._contManager.FindOrStartContainer(containerName,listOfMachine) + implementation="lib"+componentName+"Engine.so" try: - obj = self._containerRootContext.resolve(name) - except CosNaming.NamingContext.NotFound, ex: - MESSAGE( "component " + componentName + " not found, trying to load" ) - container = self.FindContainer(theComputer + "/" + theContainer) - if container is None: - MESSAGE( "container " + theComputer + "/" + theContainer + " not found in Naming Service, trying to start" ) - if (theContainer != "FactoryServer") & (theContainer != "FactoryServerPy") : - if theContainer.find('Py') == -1 : - theFactorycontainer = "FactoryServer" - else : - theFactorycontainer = "FactoryServerPy" - Factorycontainer = self.FindContainer(theComputer + "/" + theFactorycontainer) - if Factorycontainer is None: - MESSAGE( "container " + theComputer + "/" + theFactorycontainer + " not found in Naming Service, trying to start" ) - Factorycontainer = self.FindOrStartContainer(theComputer,theFactorycontainer) - else: - Factorycontainer = self.FindOrStartContainer(theComputer,theContainer) - if Factorycontainer != None : - container = self.FindOrStartContainer(theComputer,theContainer) - - if container != None: - compoinfo = self._catalog.GetComponent(componentName) - if compoinfo is None: - MESSAGE( "component " + componentName + " not found in Module Catalog" ) - else: - try: - machineName = theComputer - path = compoinfo.GetPathPrefix(machineName) + "/" - except SALOME_ModuleCatalog.NotFound, ex: - MESSAGE( "machine " + machineName + " not found in Module Catalog" ) - MESSAGE( "trying localhost" ) - try: - path = compoinfo.GetPathPrefix("localhost") + "/" - except SALOME_ModuleCatalog.NotFound, ex: - path = "" - implementation = path + "lib" + componentName + "Engine.so" - MESSAGE( "Trying to load " + implementation ) - try: - component = container.load_impl(componentName, implementation) - MESSAGE( "component " + component._get_instanceName() + " launched !" ) - return component - except: - MESSAGE( "component " + componentName + " NOT launched !" ) + component = container.load_impl(componentName, implementation) + MESSAGE( "component " + component._get_instanceName() + " launched !" ) + return component + except: + MESSAGE( "component " + componentName + " NOT launched !" ) + return None + #------------------------------------------------------------------------- + + + def FindOrLoadComponent(self, containerName, componentName): + sp=containerName.split("/") + if len(sp)==1: + listOfMachine=[] + listOfMachine.append(getShortHostName()) + comp=self.FindComponent(containerName,componentName,listOfMachine) + if comp is None: + return self.LoadComponent(containerName,componentName,listOfMachine) + else: + return comp + pass else: - try: - component = obj._narrow(Engines.Component) - if component is None: - MESSAGE( componentName + " is not a component !" ) - else: - MESSAGE( "component " + component._get_instanceName() + " found !" ) - return component - except: - MESSAGE( componentName + " failure" ) - return None + params= Engines.MachineParameters(sp[1],sp[0],"LINUX",0,0,0,0) + listOfMachine=self._contManager.GetFittingResources(params,componentName) + ret=self.FindComponent(sp[1],componentName,listOfMachine); + if ret is None: + return self.LoadComponent(sp[1],componentName,listOfMachine) + else: + return ret + pass + + + +## def FindOrStartContainer(self, theComputer , theContainer ): +## MESSAGE( "FindOrStartContainer" + theComputer + theContainer ) +## aContainer = self.FindContainer( theComputer + "/" + theContainer ) +## if aContainer is None : +## if (theContainer == "FactoryServer") | (theContainer == "FactoryServerPy") : +## myMachine=getShortHostName() +## if theComputer == myMachine : +## rshstr = "" +## else : +## rshstr = "rsh -n " + theComputer + " " +## path = self.ComputerPath( theComputer ) +#### if path != "" : +#### rshstr = rshstr + path + "/../bin/" +#### else : +#### rshstr = rshstr + os.getenv( "KERNEL_ROOT_DIR" ) + "/bin/" +## if theContainer == "FactoryServer" : +## rshstr = rshstr + path + "SALOME_Container " +## else : +## rshstr = rshstr + path + "SALOME_ContainerPy.py '" +## rshstr = rshstr + theContainer + " -" +## omniORBcfg = os.getenv( "OMNIORB_CONFIG" ) +## file = os.open( omniORBcfg , os.O_RDONLY ) +## ORBInitRef = os.read(file,132) +## if ORBInitRef[len(ORBInitRef)-1] == '\n' : +## ORBInitRef,bsn = ORBInitRef.split('\n') +## os.close( file ) +## rshstr = rshstr + ORBInitRef +## if theContainer == "FactoryServerPy" : +## rshstr = rshstr + "'" +## rshstr = rshstr + " > /tmp/" + theContainer + "_" +## rshstr = rshstr + theComputer +## rshstr = rshstr + ".log 2>&1 &" +## os.system( rshstr ) +## MESSAGE( "FindOrStartContainer" + rshstr + " done" ) +## else : +## if theContainer.find('Py') == -1 : +## aContainer = self.FindContainer( theComputer + "/" + "FactoryServer" ) +## else : +## aContainer = self.FindContainer( theComputer + "/" + "FactoryServerPy" ) +## aContainer = aContainer.start_impl( theContainer ) + +## count = 21 +## while aContainer is None : +## time.sleep(1) +## count = count - 1 +## MESSAGE( str(count) + ". Waiting for " + theComputer + "/" + theContainer ) +## aContainer = self.FindContainer( theComputer + "/" + theContainer ) +## if count == 0 : +## return aContainer + +## return aContainer +## #os.system("rsh -n dm2s0017 /export/home/KERNEL_ROOT/bin/runSession SALOME_Container -ORBInitRef NameService=corbaname::dm2s0017:1515") + +## #------------------------------------------------------------------------- + +## def FindOrLoadComponent(self, containerName, componentName): + +## theComputer,theContainer = self.ContainerName( containerName ) +## name = [CosNaming.NameComponent(theComputer,"dir"), +## CosNaming.NameComponent(theContainer,"dir"), +## CosNaming.NameComponent(componentName,"object")] +## try: +## obj = self._containerRootContext.resolve(name) +## except CosNaming.NamingContext.NotFound, ex: +## MESSAGE( "component " + componentName + " not found, trying to load" ) +## container = self.FindContainer(theComputer + "/" + theContainer) +## if container is None: +## MESSAGE( "container " + theComputer + "/" + theContainer + " not found in Naming Service, trying to start" ) +## if (theContainer != "FactoryServer") & (theContainer != "FactoryServerPy") : +## if theContainer.find('Py') == -1 : +## theFactorycontainer = "FactoryServer" +## else : +## theFactorycontainer = "FactoryServerPy" +## Factorycontainer = self.FindContainer(theComputer + "/" + theFactorycontainer) +## if Factorycontainer is None: +## MESSAGE( "container " + theComputer + "/" + theFactorycontainer + " not found in Naming Service, trying to start" ) +## Factorycontainer = self.FindOrStartContainer(theComputer,theFactorycontainer) +## else: +## Factorycontainer = self.FindOrStartContainer(theComputer,theContainer) +## if Factorycontainer != None : +## container = self.FindOrStartContainer(theComputer,theContainer) + +## if container != None: +## compoinfo = self._catalog.GetComponent(componentName) +## if compoinfo is None: +## MESSAGE( "component " + componentName + " not found in Module Catalog" ) +## else: +## try: +## machineName = theComputer +## path = compoinfo.GetPathPrefix(machineName) + "/" +## except SALOME_ModuleCatalog.NotFound, ex: +## MESSAGE( "machine " + machineName + " not found in Module Catalog" ) +## MESSAGE( "trying localhost" ) +## try: +## path = compoinfo.GetPathPrefix("localhost") + "/" +## except SALOME_ModuleCatalog.NotFound, ex: +## path = "" +## implementation = path + "lib" + componentName + "Engine.so" +## MESSAGE( "Trying to load " + implementation ) +## try: +## component = container.load_impl(componentName, implementation) +## MESSAGE( "component " + component._get_instanceName() + " launched !" ) +## return component +## except: +## MESSAGE( "component " + componentName + " NOT launched !" ) + +## else: +## try: +## component = obj._narrow(Engines.Component) +## if component is None: +## MESSAGE( componentName + " is not a component !" ) +## else: +## MESSAGE( "component " + component._get_instanceName() + " found !" ) +## return component +## except: +## MESSAGE( componentName + " failure" ) +## return None diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index c7bbd10dd..f5c43f744 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -109,42 +109,35 @@ Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component (const char *containerName, const char *componentName) { - MachineList_var listOfMachine=new MachineList; + cout << "FindOrLoad_Component C++" << endl; + Engines::MachineList_var listOfMachine=new Engines::MachineList; listOfMachine->length(1); listOfMachine[0]=CORBA::string_dup(GetHostname().c_str()); - Engines::Component_ptr ret=DoesExistComponent(componentName,containerName,listOfMachine.in()); + Engines::Component_ptr ret=FindComponent(containerName,componentName,listOfMachine.in()); if(CORBA::is_nil(ret)) - { - Engines::Container_var cont=_ContManager->FindOrStartContainer(containerName,listOfMachine); - string implementation=Engines_Component_i::GetDynLibraryName(componentName); - return cont->load_impl(componentName, implementation.c_str()); - } + return LoadComponent(containerName,componentName,listOfMachine); else return ret; } -Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const MachineParameters& params, +Engines::Component_ptr SALOME_LifeCycleCORBA::FindOrLoad_Component(const Engines::MachineParameters& params, const char *componentName) { - MachineList_var listOfMachine=_ContManager->GetResourcesFitting(params,componentName); - Engines::Component_ptr ret=DoesExistComponent(componentName,params.container_name,listOfMachine); + Engines::MachineList_var listOfMachine=_ContManager->GetFittingResources(params,componentName); + Engines::Component_ptr ret=FindComponent(params.container_name,componentName,listOfMachine); if(CORBA::is_nil(ret)) - { - Engines::Container_var cont=_ContManager->FindOrStartContainer(params.container_name,listOfMachine); - string implementation=Engines_Component_i::GetDynLibraryName(componentName); - return cont->load_impl(componentName, implementation.c_str()); - } + return LoadComponent(params.container_name,componentName,listOfMachine); else return ret; } -Engines::Component_ptr SALOME_LifeCycleCORBA::DoesExistComponent(const char *componentName, - const char *containerName, - const MachineList& listOfMachines) +Engines::Component_ptr SALOME_LifeCycleCORBA::FindComponent(const char *containerName, + const char *componentName, + const Engines::MachineList& listOfMachines) { if(containerName[0]!='\0') { - MachineList_var machinesOK=new MachineList; + Engines::MachineList_var machinesOK=new Engines::MachineList; unsigned int lghtOfmachinesOK=0; machinesOK->length(listOfMachines.length()); for(unsigned int i=0;iFindOrStartContainer(containerName,listOfMachines); + string implementation=Engines_Component_i::GetDynLibraryName(componentName); + return cont->load_impl(componentName, implementation.c_str()); +} diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx index a94035136..ed5c78c25 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx @@ -44,14 +44,19 @@ class SALOME_LifeCycleCORBA public: SALOME_LifeCycleCORBA(SALOME_NamingService *ns); virtual ~SALOME_LifeCycleCORBA(); - Engines::Component_ptr FindOrLoad_Component(const MachineParameters& params, + Engines::Component_ptr FindOrLoad_Component(const Engines::MachineParameters& params, const char *componentName); Engines::Component_ptr FindOrLoad_Component(const char *containerName, const char *componentName); protected: - Engines::Component_ptr DoesExistComponent(const char *componentName, - const char *containerName, - const MachineList& listOfMachines); + //! Establish if a component called "componentName" in a container called "containerName" exists among the list of resources + //! in "listOfMachines". This method uses Naming Service to find the component. + Engines::Component_ptr FindComponent(const char *containerName, + const char *componentName, + const Engines::MachineList& listOfMachines); + + Engines::Component_ptr LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines); + SALOME_NamingService *_NS; Engines::ContainerManager_var _ContManager; diff --git a/src/MPIContainer/MPIContainer_i.cxx b/src/MPIContainer/MPIContainer_i.cxx index ad729c45a..73e9ffaa0 100644 --- a/src/MPIContainer/MPIContainer_i.cxx +++ b/src/MPIContainer/MPIContainer_i.cxx @@ -40,7 +40,7 @@ Engines_MPIContainer_i::Engines_MPIContainer_i(int nbproc, int numproc, PortableServer::POA_ptr poa, char * containerName, int argc, char *argv[]) - : Engines_Container_i(orb,poa,containerName,argc,argv,false,false), MPIObject_i(nbproc,numproc) + : Engines_Container_i(orb,poa,containerName,argc,argv,false), MPIObject_i(nbproc,numproc) { MESSAGE("[" << numproc << "] activate object"); _id = _poa->activate_object(this); diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index 07b0e9342..2db7a59b5 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -645,7 +645,7 @@ char* SALOME_NamingService::Current_Directory() // the directories length_path = length_path + strlen(result_path[k]) + 1; } - char* return_Path = new char[length_path +1]; + char* return_Path = new char[length_path +2]; return_Path[0] = '/' ; return_Path[1] = '\0' ; for (int k = 0 ; k SALOME_NamingService::list_directory() return _list; } +//---------------------------------------------------------------------- +/*! Function : list_directory_recurs + * Purpose : method to get all the contexts contained in the current + * directory + * Get only objects and is recursive + * If the NamingService is out, the exception ServiceUnreachable is thrown + */ +//---------------------------------------------------------------------- +vector SALOME_NamingService::list_directory_recurs() + throw(ServiceUnreachable) +{ + vector _list ; + char *currentDir=Current_Directory(); + _list_directory_recurs(_list,0,currentDir); + delete [] currentDir; + return _list; +} //---------------------------------------------------------------------- /*! Function : Destroy_Name @@ -1310,4 +1327,58 @@ SALOME_NamingService::_current_directory(char** result_path, // We go to the last directory where an occurence was found _current_context = _ref_context ; } + + +//---------------------------------------------------------------------- +/*! Function :_list_directory_recurs. + * Purpose : method to list recursively all the objects contained in the tree of absCurDirectory/relativeSubDir. + * \param myList The list that will be filled. + * \param relativeSubDir The directory from absCurDirectory in which the objects are found. + * \param absCurDirectory The directory in ABSOLUTE form. + * _current_context must refer to absCurDirectory. + */ +//---------------------------------------------------------------------- +void SALOME_NamingService::_list_directory_recurs(vector& myList, const char *relativeSubDir,const char *absCurDirectory) +{ + CosNaming::BindingList_var _binding_list; + CosNaming::BindingIterator_var _binding_iterator; + unsigned long nb=0 ; // for using only the BindingIterator to access the bindings + CosNaming::Binding_var _binding ; + char *absDir; + + CosNaming::NamingContext_var _ref_context = _current_context; + if(relativeSubDir) + { + Change_Directory(relativeSubDir); + absDir=new char[strlen(absCurDirectory)+2+strlen(relativeSubDir)]; + strcpy(absDir,absCurDirectory); + strcat(absDir,relativeSubDir); + strcat(absDir,"/"); + } + else + absDir=(char *)absCurDirectory; + _current_context->list(nb, _binding_list, _binding_iterator) ; + + while (_binding_iterator->next_one(_binding)) { + CosNaming::Name _bindingName = _binding->binding_name; + if (_binding->binding_type == CosNaming::ncontext) { + _list_directory_recurs(myList,_bindingName[0].id,absDir); + } + else if (_binding->binding_type == CosNaming::nobject) { + char *elt=new char[strlen(absDir)+2+strlen(_bindingName[0].id)]; + strcpy(elt,absDir); + strcat(elt,_bindingName[0].id); + myList.push_back(elt); + delete [] elt; + } + } + if(relativeSubDir) + { + _current_context = _ref_context ; + delete [] absDir; + } + + _binding_iterator->destroy(); +} + //---------------------------------------------------------------------- diff --git a/src/NamingService/SALOME_NamingService.hxx b/src/NamingService/SALOME_NamingService.hxx index 4504e6ec7..e6ee89213 100644 --- a/src/NamingService/SALOME_NamingService.hxx +++ b/src/NamingService/SALOME_NamingService.hxx @@ -84,6 +84,10 @@ public: // Get only objects, isn't iterative std::vector list_directory() throw(ServiceUnreachable); + + //!methods that lists all objects RECUSIVELY in the current directory + std::vector list_directory_recurs() + throw(ServiceUnreachable); //! method to destroy an association Path-Object Reference void Destroy_Name(const char* Path) @@ -120,6 +124,10 @@ protected: int& length_result, CosNaming::NamingContext_var context_to_found, CORBA::Boolean& _continue); + + //! internal method to list all (recursively) the objects contains in absCurDirectory/relativeSubDir. + void _list_directory_recurs(std::vector& myList, const char *relativeSubDir,const char *absCurDirectory); + }; #endif // SALOME_NAMINGSERVICE_H diff --git a/src/ResourcesManager/Makefile.in b/src/ResourcesManager/Makefile.in index 9712b5217..1a597558c 100755 --- a/src/ResourcesManager/Makefile.in +++ b/src/ResourcesManager/Makefile.in @@ -51,13 +51,13 @@ LIB_SRC = \ # Executables targets # trouble we have client and serveur and build don't known about this with rule # in fact client is a test ! So it may go away BIN ! -#BIN = test_rc +#BIN = test_rc2 #SALOME_RessourcesCatalog_Server SALOME_RessourcesCatalog_Client test LIB_CLIENT_IDL = SALOME_ContainerManager.idl SALOME_Component.idl BIN_SRC = -BIN_SERVER_IDL = SALOME_ResourcesManager.idl +BIN_SERVER_IDL = SALOME_ContainerManager.idl -CPPFLAGS+= $(QT_MT_INCLUDES) +CPPFLAGS+= $(QT_MT_INCLUDES) -I$(srcdir)/../Container CXXFLAGS+= LDFLAGS+= $(QT_MT_LIBS) $(OGL_LIBS) -lSalomeNS -lOpUtil -lSALOMELocalTrace diff --git a/src/ResourcesManager/SALOME_LoadRateManager.cxx b/src/ResourcesManager/SALOME_LoadRateManager.cxx index 2d583c2bc..ab5aa4d88 100644 --- a/src/ResourcesManager/SALOME_LoadRateManager.cxx +++ b/src/ResourcesManager/SALOME_LoadRateManager.cxx @@ -2,7 +2,7 @@ using namespace std; -string SALOME_LoadRateManager::FindBest(const MachineList& hosts) +string SALOME_LoadRateManager::FindBest(const Engines::MachineList& hosts) { // for the moment then "maui" will be used for dynamic selection ... return string(hosts[0]); diff --git a/src/ResourcesManager/SALOME_LoadRateManager.hxx b/src/ResourcesManager/SALOME_LoadRateManager.hxx index b076bf934..9a5d98441 100644 --- a/src/ResourcesManager/SALOME_LoadRateManager.hxx +++ b/src/ResourcesManager/SALOME_LoadRateManager.hxx @@ -8,7 +8,7 @@ class SALOME_LoadRateManager { public: - std::string FindBest(const MachineList& hosts); + std::string FindBest(const Engines::MachineList& hosts); }; #endif diff --git a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx index ab289af1c..2dc349b2d 100755 --- a/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx +++ b/src/ResourcesManager/SALOME_ResourcesCatalog_Handler.cxx @@ -252,24 +252,24 @@ void SALOME_ResourcesCatalog_Handler::PrepareDocToXmlFile(QDomDocument& doc) switch((*iter).second.Protocol) { case rsh: - eltRoot.setAttribute((char *)test_protocol,"r"); + eltRoot.setAttribute((char *)test_protocol,"rsh"); break; case ssh: - eltRoot.setAttribute((char *)test_protocol,"s"); + eltRoot.setAttribute((char *)test_protocol,"ssh"); break; default: - eltRoot.setAttribute((char *)test_protocol,"r"); + eltRoot.setAttribute((char *)test_protocol,"rsh"); } switch((*iter).second.Mode) { case interactive: - eltRoot.setAttribute((char *)test_mode,"i"); + eltRoot.setAttribute((char *)test_mode,"interactive"); break; case batch: - eltRoot.setAttribute((char *)test_mode,"b"); + eltRoot.setAttribute((char *)test_mode,"batch"); break; default: - eltRoot.setAttribute((char *)test_mode,"i"); + eltRoot.setAttribute((char *)test_mode,"interactive"); } eltRoot.setAttribute((char *)test_user_name,(*iter).second.UserName.c_str()); for(map::const_iterator iter2=(*iter).second.ModulesPath.begin();iter2!=(*iter).second.ModulesPath.end();iter2++) diff --git a/src/ResourcesManager/SALOME_ResourcesManager.cxx b/src/ResourcesManager/SALOME_ResourcesManager.cxx index 74363b7f2..468be76c6 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.cxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.cxx @@ -11,6 +11,9 @@ #include #include +#include +#include + #define MAX_SIZE_FOR_HOSTNAME 256; using namespace std; @@ -31,7 +34,7 @@ SALOME_ResourcesManager::~SALOME_ResourcesManager() { } -vector SALOME_ResourcesManager::GetResourcesFitting(const MachineParameters& params,const char *moduleName) throw(SALOME_Exception) +vector SALOME_ResourcesManager::GetFittingResources(const Engines::MachineParameters& params,const char *moduleName) throw(SALOME_Exception) { vector ret; //To be sure that we search in a correct list. @@ -77,7 +80,7 @@ vector SALOME_ResourcesManager::GetResourcesFitting(const MachineParamet return ret; } -int SALOME_ResourcesManager::AddResourceInCatalog(const MachineParameters& paramsOfNewResources, const map& modulesOnNewResources, +int SALOME_ResourcesManager::AddResourceInCatalog(const Engines::MachineParameters& paramsOfNewResources, const map& modulesOnNewResources, const char *environPathOfPrerequired, const char *alias, const char *userName, AccessModeType mode, AccessProtocolType prot) throw(SALOME_Exception) { @@ -179,7 +182,7 @@ const MapOfParserResourcesType& SALOME_ResourcesManager::GetList() const return _resourcesList; } -string SALOME_ResourcesManager::FindBest(const MachineList& listOfMachines) +string SALOME_ResourcesManager::FindBest(const Engines::MachineList& listOfMachines) { return _dynamicResourcesSelecter.FindBest(listOfMachines); } @@ -187,18 +190,23 @@ string SALOME_ResourcesManager::FindBest(const MachineList& listOfMachines) string SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer(const string& machine,const char *containerName) { _TmpFileName=BuildTemporaryFileName(); - ofstream tempOutputFile(_TmpFileName.c_str()); + ofstream tempOutputFile; + tempOutputFile.open(_TmpFileName.c_str(),ofstream::out ); const ParserResourcesType& resInfo=_resourcesList[machine]; + cout << "SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer 11 - " << _TmpFileName << endl; tempOutputFile << "/bin/sh <::const_iterator iter=resInfo.ModulesPath.begin();iter!=resInfo.ModulesPath.end();iter++) { string curModulePath((*iter).second); - tempOutputFile << "export " << (*iter).first << "_ROOT_DIR="<< curModulePath << endl; - tempOutputFile << "export LD_LIBRARY_PATH=" << curModulePath << "/lib/salome" << ":${LD_LIBRARY_PATH}" << endl; - tempOutputFile << "export PYTHONPATH=" << curModulePath << "/bin/salome:" << curModulePath << "/lib/python2.2/site-packages/salome:"; + tempOutputFile << (*iter).first << "_ROOT_DIR="<< curModulePath << endl; + tempOutputFile << "export " << (*iter).first << "_ROOT_DIR" << endl; + tempOutputFile << "LD_LIBRARY_PATH=" << curModulePath << "/lib/salome" << ":${LD_LIBRARY_PATH}" << endl; + tempOutputFile << "PYTHONPATH=" << curModulePath << "/bin/salome:" << curModulePath << "/lib/python2.2/site-packages/salome:"; tempOutputFile << curModulePath << "/lib/python2.2/site-packages/salome/shared_modules:${PYTHONPATH}" << endl; } + tempOutputFile << "export LD_LIBRARY_PATH" << endl; + tempOutputFile << "export PYTHONPATH" << endl; tempOutputFile << "source " << resInfo.PreReqFilePath << endl; // ! env vars tempOutputFile << (*(resInfo.ModulesPath.find("KERNEL"))).second << "/bin/salome/"; @@ -210,20 +218,34 @@ string SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer(const strin AddOmninamesParams(tempOutputFile); tempOutputFile << " > /tmp/" << containerName << "_" << machine << ".log 2>&1 &" << endl; tempOutputFile << "EOF" << endl; + cout << "SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer 22" << endl; tempOutputFile.flush(); tempOutputFile.close(); + chmod(_TmpFileName.c_str(),0x1ED); + cout << "SALOME_ResourcesManager::BuildTempFileToLaunchRemoteContainer 33" << endl; //Build command string command; if(resInfo.Protocol==rsh) - command = "rsh -n "; + { + command = "rsh "; + string commandRcp="rcp "; + commandRcp+=_TmpFileName; + commandRcp+=" "; + commandRcp+=machine; + commandRcp+=":"; + commandRcp+=_TmpFileName; + cout << "************ " << commandRcp.c_str() << endl; + system(commandRcp.c_str()); + } else if(resInfo.Protocol==ssh) - command = "ssh -n "; + command = "ssh "; else throw SALOME_Exception("Unknown protocol"); command+=machine; _CommandForRemAccess=command; - command+=" < "; + command+=" ";//" ";//" < "; command+=_TmpFileName; + cout << "Command is ... " << command << endl; return command; } @@ -243,17 +265,18 @@ string SALOME_ResourcesManager::BuildCommandToLaunchLocalContainer(const char *c command += "_"; command += GetHostname(); command += ".log 2>&1 &" ; + cout << "##### " << command << endl << flush; return command; } void SALOME_ResourcesManager::RmTmpFile() { - if(_TmpFileName!="") - { - string command="rm "; - command+=_TmpFileName; - system(command.c_str()); - } +// if(_TmpFileName!="") +// { +// string command="rm "; +// command+=_TmpFileName; +// system(command.c_str()); +// } } string SALOME_ResourcesManager::BuildCommand(const string& machine,const char *containerName) diff --git a/src/ResourcesManager/SALOME_ResourcesManager.hxx b/src/ResourcesManager/SALOME_ResourcesManager.hxx index 5c4070990..c0b6ef385 100644 --- a/src/ResourcesManager/SALOME_ResourcesManager.hxx +++ b/src/ResourcesManager/SALOME_ResourcesManager.hxx @@ -27,10 +27,10 @@ public: ~SALOME_ResourcesManager(); //! method to get the list of name of ressources fitting for the specified module. - std::vector GetResourcesFitting(const MachineParameters& params,const char *moduleName) throw(SALOME_Exception); + std::vector GetFittingResources(const Engines::MachineParameters& params,const char *moduleName) throw(SALOME_Exception); //! method to dynamically obtain the best machines - std::string FindBest(const MachineList& listOfMachines); + std::string FindBest(const Engines::MachineList& listOfMachines); //! method that builds in a temporary file the script to be launched std::string BuildTempFileToLaunchRemoteContainer(const std::string& machine,const char *containerName); @@ -45,7 +45,7 @@ public: std::string BuildCommand(const std::string& machine,const char *containerName); //! add an entry in the ressources catalog xml file. Return 1 if OK. Return 0 if the ressource with the same hostname already exists. - int AddResourceInCatalog(const MachineParameters& paramsOfNewResources, const std::map& modulesOnNewResources, + int AddResourceInCatalog(const Engines::MachineParameters& paramsOfNewResources, const std::map& modulesOnNewResources, const char *environPathOfPrerequired, const char *alias, const char *userName, AccessModeType mode, AccessProtocolType prot) throw(SALOME_Exception); diff --git a/src/SALOMEDS/Makefile.in b/src/SALOMEDS/Makefile.in index 41c222733..a105b2951 100644 --- a/src/SALOMEDS/Makefile.in +++ b/src/SALOMEDS/Makefile.in @@ -113,14 +113,14 @@ LIB_SRC = \ # Executables targets BIN = SALOMEDS_Server SALOMEDS_Client BIN_SRC = -LIB_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl +LIB_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl SALOME_ContainerManager.idl BIN_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl BIN_CLIENT_IDL = LIB_CLIENT_IDL = SALOME_Component.idl SALOME_GenericObj.idl CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) CXXFLAGS+=$(OCC_CXXFLAGS) -LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace $(CAS_LDPATH) -lTKCAF -lTKBO -lTKStdSchema -lSalomeGenericObj -lSalomeLifeCycleCORBA +LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace $(CAS_LDPATH) -lTKCAF -lTKBO -lTKStdSchema -lSalomeGenericObj -lSalomeLifeCycleCORBA -lSalomeContainer -lSalomeResourcesManager # _CS_gbo_090604 Ajout Spécifique Calibre 3, pour l'utilisation de la version 5.12 de la bibliothèque OCC. # La bibliothèque OCC5.12 a été compilée sur Calibre 3 avec l'extention Xmu (impossible de compiler sans). diff --git a/src/SALOMEGUI/Makefile.in b/src/SALOMEGUI/Makefile.in index f3d426d18..d3acbc362 100644 --- a/src/SALOMEGUI/Makefile.in +++ b/src/SALOMEGUI/Makefile.in @@ -218,6 +218,7 @@ LIB_CLIENT_IDL = SALOMEDS.idl \ SALOMEDS_Attributes.idl \ SALOME_ModuleCatalog.idl \ SALOME_Component.idl \ + SALOME_ContainerManager.idl \ SALOME_Exception.idl CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(OCC_INCLUDES) diff --git a/src/SALOME_PY/Makefile.in b/src/SALOME_PY/Makefile.in index f99d2e4ed..9b8cf7e33 100644 --- a/src/SALOME_PY/Makefile.in +++ b/src/SALOME_PY/Makefile.in @@ -41,6 +41,7 @@ LIB_SRC = SalomePy.cxx LIB_CLIENT_IDL = SALOMEDS.idl \ SALOMEDS_Attributes.idl \ + SALOME_ContainerManager.idl \ SALOME_Exception.idl CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) $(OCC_INCLUDES) -DHAVE_CONFIG_H diff --git a/src/SALOME_PYQT/Makefile.in b/src/SALOME_PYQT/Makefile.in index 7c1de51a1..6797d4dbf 100644 --- a/src/SALOME_PYQT/Makefile.in +++ b/src/SALOME_PYQT/Makefile.in @@ -47,7 +47,7 @@ LIB_MOC = SALOME_PYQT_GUI.h EXPORT_SHAREDPYSCRIPTS = SalomePyQt.py -LIB_CLIENT_IDL = SALOME_Exception.idl +LIB_CLIENT_IDL = SALOME_Exception.idl SALOME_ContainerManager.idl CPPFLAGS+=$(QT_INCLUDES) $(PYTHON_INCLUDES) $(SIP_INCLUDES) $(OCC_INCLUDES) $(VTK_INCLUDES) $(OGL_INCLUDES) LIBS+= $(PYTHON_LIBS) $(SIP_LIBS) $(PYQT_LIBS) $(VTK_LIBS) $(OGL_LIBS) diff --git a/src/SUPERVGraph/Makefile.in b/src/SUPERVGraph/Makefile.in index 3edb511e4..b108204d7 100644 --- a/src/SUPERVGraph/Makefile.in +++ b/src/SUPERVGraph/Makefile.in @@ -22,6 +22,7 @@ LIB_MOC = SUPERVGraph_moc.cxx \ LIB_CLIENT_IDL = SALOMEDS.idl \ SALOME_ModuleCatalog.idl \ SALOME_Component.idl \ + SALOME_ContainerManager.idl \ SALOME_Exception.idl diff --git a/src/Session/Makefile.in b/src/Session/Makefile.in index 01c587221..f88c87f52 100644 --- a/src/Session/Makefile.in +++ b/src/Session/Makefile.in @@ -49,11 +49,11 @@ LIB_SRC=\ BIN = SALOME_Session_Server BIN_SRC = BIN_SERVER_IDL = SALOME_Session.idl -BIN_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_Registry.idl SALOME_ModuleCatalog.idl SALOME_Exception.idl +BIN_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_ContainerManager.idl SALOME_Registry.idl SALOME_ModuleCatalog.idl SALOME_Exception.idl CPPFLAGS+=$(QT_MT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES) CXXFLAGS+=$(OCC_CXXFLAGS) -LDFLAGS+=$(QT_MT_LIBS) $(HDF5_LIBS) -lSalomeHDFPersist -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lOpUtil -lPlot2d -lSalomeVTKFilter -lSALOMELocalTrace -lSalomeContainer -lRegistry -lSalomeNotification -lSalomeDS -lTOOLSDS -lSalomeGenericObj -lSalomeCatalog -lEvent -lSalomePrs $(CAS_LDPATH) -lTKBO -lCASCatch +LDFLAGS+=$(QT_MT_LIBS) $(HDF5_LIBS) -lSalomeHDFPersist -lSalomeNS -lSalomeGUI -lSalomeObject -lSalomeLifeCycleCORBA -lqsplitterP -lOpUtil -lPlot2d -lSalomeVTKFilter -lSALOMELocalTrace -lSalomeContainer -lRegistry -lSalomeNotification -lSalomeDS -lTOOLSDS -lSalomeGenericObj -lSalomeCatalog -lEvent -lSalomePrs $(CAS_LDPATH) -lTKBO -lCASCatch -lSalomeResourcesManager @CONCLUDE@ diff --git a/src/Session/Session_ServerLauncher.cxx b/src/Session/Session_ServerLauncher.cxx index 82a8c6733..6b9f4b92e 100644 --- a/src/Session/Session_ServerLauncher.cxx +++ b/src/Session/Session_ServerLauncher.cxx @@ -181,6 +181,17 @@ void Session_ServerLauncher::CheckArgs() void Session_ServerLauncher::ActivateAll() { + + // Always launch ContainerManager + + char** argv = new char* [1]; + argv[0] = "ContainerManager"; + Session_SessionThread* aServerThread2 + = new Session_SessionThread(1, argv, _orb,_root_poa,_GUIMutex,_ServerLaunch); + _serverThreads.push_front(aServerThread2); + + aServerThread2->Init(); + list::iterator itServ; for (itServ = _argServToLaunch.begin(); itServ !=_argServToLaunch.end(); itServ++) { @@ -205,7 +216,7 @@ void Session_ServerLauncher::ActivateAll() // Always launch Session Server int argc=1; - char** argv = new char*[argc]; + argv = new char*[argc]; argv[0] = "Session"; Session_SessionThread* aServerThread = new Session_SessionThread(argc, argv, _orb,_root_poa,_GUIMutex,_ServerLaunch); diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index 886aef9b9..2b699fe69 100644 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -33,6 +33,7 @@ #include "Session_ServerThread.hxx" #include "SALOME_Container_i.hxx" +#include "SALOME_ContainerManager.hxx" #include "SALOMEDS_StudyManager_i.hxx" #include "SALOME_ModuleCatalog_impl.hxx" #include "RegistryService.hxx" @@ -50,12 +51,13 @@ using namespace std; -const int Session_ServerThread::NB_SRV_TYP = 5; +const int Session_ServerThread::NB_SRV_TYP = 6; const char* Session_ServerThread::_serverTypes[NB_SRV_TYP] = {"Container", "ModuleCatalog", "Registry", "SALOMEDS", - "Session"}; + "Session", + "ContainerManager"}; //============================================================================= /*! @@ -124,6 +126,7 @@ void Session_ServerThread::Init() case 0: // Container { NamingService_WaitForServerReadiness(_NS,"/Registry"); + NamingService_WaitForServerReadiness(_NS,"/ContainerManager"); ActivateContainer(_argc, _argv); break; } @@ -155,6 +158,12 @@ void Session_ServerThread::Init() ActivateSession(_argc, _argv); break; } + case 5: // Container Manager + { + NamingService_WaitForServerReadiness(_NS,""); + ActivateContainerManager(_argc, _argv); + break; + } default: { ASSERT(0); @@ -324,6 +333,44 @@ void Session_ServerThread::ActivateRegistry(int argc, */ //============================================================================= +void Session_ServerThread::ActivateContainerManager(int argc, + char ** argv) +{ + try + { + PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa(); + cout << "ActivateContainerManager ......!!!! " << endl; + SALOME_ContainerManager * myContainer + = new SALOME_ContainerManager(_orb); + } + 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."); + } +} + +//============================================================================= +/*! + * + */ +//============================================================================= + void Session_ServerThread::ActivateContainer(int argc, char ** argv) { diff --git a/src/Session/Session_ServerThread.hxx b/src/Session/Session_ServerThread.hxx index e67ee7fe8..9293cd4d2 100644 --- a/src/Session/Session_ServerThread.hxx +++ b/src/Session/Session_ServerThread.hxx @@ -58,6 +58,8 @@ protected: char ** argv); void ActivateContainer(int argc, char ** argv); + void ActivateContainerManager(int argc, + char ** argv); virtual void ActivateSession(int argc, char ** argv); diff --git a/src/TOOLSGUI/Makefile.in b/src/TOOLSGUI/Makefile.in index 73a914c7f..d41cb3724 100644 --- a/src/TOOLSGUI/Makefile.in +++ b/src/TOOLSGUI/Makefile.in @@ -51,7 +51,7 @@ LIB_SRC = ToolsGUI.cxx \ LIB_MOC = ToolsGUI_CatalogGeneratorDlg_moc.cxx LIB_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl \ - SALOME_Component.idl SALOME_Exception.idl + SALOME_Component.idl SALOME_ContainerManager.idl SALOME_Exception.idl # additionnal information to compil and link file diff --git a/src/TestContainer/Makefile.in b/src/TestContainer/Makefile.in index 8ee409d99..7684a2dd5 100644 --- a/src/TestContainer/Makefile.in +++ b/src/TestContainer/Makefile.in @@ -45,7 +45,7 @@ LIB_CLIENT_IDL = SALOME_Component.idl SALOME_TestComponent.idl BIN = TestContainer TestLogger BIN_SRC = -LDFLAGS+= -lSalomeNotification -lSalomeNS -lSalomeContainer -lRegistry -lOpUtil -lSALOMELocalTrace +LDFLAGS+= -lSalomeNotification -lSalomeNS -lSalomeContainer -lRegistry -lOpUtil -lSALOMELocalTrace -lSalomeResourcesManager @CONCLUDE@ diff --git a/src/VTKViewer/Makefile.in b/src/VTKViewer/Makefile.in index 43786ab25..ccbfd1658 100644 --- a/src/VTKViewer/Makefile.in +++ b/src/VTKViewer/Makefile.in @@ -69,6 +69,7 @@ LIB_MOC = \ LIB_CLIENT_IDL = SALOMEDS.idl \ SALOME_ModuleCatalog.idl \ SALOME_Component.idl \ + SALOME_ContainerManager.idl \ SALOME_Exception.idl CPPFLAGS+=$(QT_INCLUDES) $(OGL_INCLUDES) $(VTK_INCLUDES) $(OCC_INCLUDES) -- 2.39.2