X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLifeCycleCORBA%2FSALOME_LifeCycleCORBA.cxx;h=53455360982754f42b8ebcf52db9da14789e35d7;hb=c92c02d464cc393854d280971a4d5eb7e947e8c6;hp=cdc04fde9db39a9d2d95aa5899e5c9821b0816bb;hpb=37af4eda88606505c841280582f86ca297f25a44;p=modules%2Fkernel.git diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index cdc04fde9..534553609 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -85,9 +85,11 @@ SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns) char **argv = &xargv; CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); // LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb); + _NSnew=0; if (!ns) { _NS = new SALOME_NamingService(orb); + _NSnew=_NS; } else _NS = ns; //add try catch @@ -115,6 +117,7 @@ SALOME_LifeCycleCORBA::SALOME_LifeCycleCORBA(SALOME_NamingService *ns) SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA() { + if(_NSnew)delete _NSnew; } //============================================================================= @@ -171,6 +174,9 @@ SALOME_LifeCycleCORBA::LoadComponent(const Engines::MachineParameters& params, parms.componentList.length(1); parms.componentList[0] = componentName; + Engines::MachineList_var listOfMachines = _ResManager->GetFittingResources(parms); + parms.computerList=listOfMachines; + Engines::Component_var compo = _LoadComponent(parms, componentName, studyId); @@ -211,9 +217,12 @@ FindOrLoad_Component(const Engines::MachineParameters& params, listOfMachines); if(CORBA::is_nil(compo)) - compo = _LoadComponent(parms, + { + parms.computerList=listOfMachines; + compo = _LoadComponent(parms, componentName, studyId); + } return compo._retn(); } @@ -268,7 +277,7 @@ SALOME_LifeCycleCORBA::FindOrLoad_Component(const char *containerName, { // containerName doesn't contain "/" => Local container params->container_name=CORBA::string_dup(stContainer); - params->hostname=CORBA::string_dup(Kernel_Utils::GetHostname().c_str()); + params->hostname=""; } else { @@ -528,6 +537,8 @@ void SALOME_LifeCycleCORBA::killOmniNames() string portNumber (::getenv ("NSPORT") ); if ( !portNumber.empty() ) { +#ifdef WNT +#else string cmd ; cmd = string( "ps -eo pid,command | grep -v grep | grep -E \"omniNames.*") + portNumber @@ -538,6 +549,7 @@ void SALOME_LifeCycleCORBA::killOmniNames() } catch ( ... ) { } +#endif } // NPAL 18309 (Kill Notifd) @@ -672,7 +684,7 @@ SALOME_LifeCycleCORBA::Load_ParallelComponent(const Engines::MachineParameters& parms.componentList[0] = componentName; MESSAGE("Starting Parallel Container"); - Engines::Container_var cont = _ContManager->FindOrStartParallelContainer(parms); + Engines::Container_var cont = _ContManager->StartParallelContainer(parms); if (CORBA::is_nil(cont)) { INFOS("FindOrStartParallelContainer() returns a NULL container !"); return Engines::Component::_nil(); @@ -688,7 +700,7 @@ SALOME_LifeCycleCORBA::Load_ParallelComponent(const Engines::MachineParameters& MESSAGE("Creating component instance"); // @PARALLEL@ permits to identify that the component requested // is a parallel component. - string name = string(componentName) + string("@PARALLEL@"); + string name = string(componentName); Engines::Component_var myInstance = cont->create_component_instance(name.c_str(), studyId); if (CORBA::is_nil(myInstance)) INFOS("create_component_instance returns a NULL component !"); @@ -725,3 +737,21 @@ void SALOME_LifeCycleCORBA::copyFile(const char* hostSrc, const char* fileSrc, c containerDest->copyFile(containerSrc,fileSrc,fileDest); } +/*! \brief get the naming service used by the life cycle + * + * \return the naming service + */ +SALOME_NamingService * SALOME_LifeCycleCORBA::namingService() +{ + return _NS; +} + +/*! \brief get the orb used by the life cycle + * + * \return the orb + */ +CORBA::ORB_ptr SALOME_LifeCycleCORBA::orb() +{ + return _NS->orb(); +} +