-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2019 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
// (in SALOMEDS for an example)
// not enough: set a current directory in naming service is not thread safe
// if naming service instance is shared among several threads...
- // ==> allways use absolute path and dot rely on current directory!
+ // ==> always use absolute path and don't rely on current directory!
CORBA::Object_var obj =
_NS->Resolve(SALOME_ContainerManager::_ContainerManagerNameInNS);
*
* \param params container parameters like type or name...
* \param componentName the name of component class
- * \param studyId default = 0 : multistudy instance
* \return a CORBA reference of the component instance, or _nil if not found
*/
//=============================================================================
Engines::EngineComponent_ptr
SALOME_LifeCycleCORBA::FindComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName)
{
if (! isKnownComponentClass(componentName))
return Engines::EngineComponent::_nil();
Engines::EngineComponent_var compo = _FindComponent(new_params,
componentName,
- studyId,
listOfResources);
return compo._retn();
*
* \param params container parameters like type or name...
* \param componentName the name of component class
- * \param studyId default = 0 : multistudy instance
* \return a CORBA reference of the component instance, or _nil if problem
*/
//=============================================================================
Engines::EngineComponent_ptr
SALOME_LifeCycleCORBA::LoadComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName)
{
// --- Check if Component Name is known in ModuleCatalog
new_params.resource_params.resList = listOfResources;
Engines::EngineComponent_var compo = _LoadComponent(new_params,
- componentName,
- studyId);
+ componentName);
return compo._retn();
}
*
* \param params container parameters like type or name...
* \param componentName the name of component class
- * \param studyId default = 0 : multistudy instance
* \return a CORBA reference of the component instance, or _nil if problem
*/
//=============================================================================
Engines::EngineComponent_ptr
SALOME_LifeCycleCORBA::
FindOrLoad_Component(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName)
{
// --- Check if Component Name is known in ModuleCatalog
}
Engines::EngineComponent_var compo = _FindComponent(new_params,
- componentName,
- studyId,
- listOfResources);
+ componentName,
+ listOfResources);
if(CORBA::is_nil(compo))
{
new_params.resource_params.resList = listOfResources;
compo = _LoadComponent(new_params,
- componentName,
- studyId);
+ componentName);
}
return compo._retn();
// 2) SALOMEDS
try
{
- CORBA::Object_var objSDS = _NS->Resolve("/myStudyManager");
- SALOMEDS::StudyManager_var studyManager = SALOMEDS::StudyManager::_narrow(objSDS) ;
- if ( !CORBA::is_nil(studyManager) && ( pid != studyManager->getPID() ) )
- studyManager->Shutdown();
+ CORBA::Object_var objSDS = _NS->Resolve("/Study");
+ SALOMEDS::Study_var study = SALOMEDS::Study::_narrow(objSDS) ;
+ if ( !CORBA::is_nil(study) && ( pid != study->getPID() ) )
+ study->Shutdown();
}
catch(const CORBA::Exception& e)
{
std::string portNumber (::getenv ("NSPORT") );
std::string python_exe;
- python_exe = std::string("python");
-#ifdef WIN32
- #ifdef _DEBUG_
- python_exe += std::string("_d");
- #endif
-#endif
+ python_exe = std::string("python3");
if ( !portNumber.empty() )
{
system( cmd.c_str() );
}
-#ifdef WITH_PORTMANAGER
// shutdown portmanager
if ( !portNumber.empty() )
{
MESSAGE(cmd);
system( cmd.c_str() );
}
-#endif
}
//=============================================================================
*
* \param params machine parameters like type or name...
* \param componentName the name of component class
- * \param studyId default = 0 : multistudy instance
* \param listOfMachines list of machine address
* \return a CORBA reference of the component instance, or _nil if not found
*/
SALOME_LifeCycleCORBA::
_FindComponent(const Engines::ContainerParameters& params,
const char *componentName,
- int studyId,
const Engines::ResourceList& listOfResources)
{
// --- build the list of machines on which the component is already running
*
* \param params machine parameters like type or name...
* \param componentName the name of component class
- * \param studyId default = 0 : multistudy instance
* \return a CORBA reference of the component instance, or _nil if problem
*/
//=============================================================================
Engines::EngineComponent_ptr
SALOME_LifeCycleCORBA::
_LoadComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName)
{
MESSAGE("_LoadComponent, required " << params.container_name <<
" " << componentName << " " << NbProc(params));
CORBA::string_free(reason);
Engines::EngineComponent_var myInstance =
- cont->create_component_instance(componentName, studyId);
+ cont->create_component_instance(componentName);
return myInstance._retn();
}
*
* \param params machine parameters like type or name...
* \param componentName the name of component class
- * \param studyId default = 0 : multistudy instance
* \return a CORBA reference of the parallel component instance, or _nil if problem
*/
//=============================================================================
Engines::EngineComponent_ptr
SALOME_LifeCycleCORBA::Load_ParallelComponent(const Engines::ContainerParameters& params,
- const char *componentName,
- int studyId)
+ const char *componentName)
{
MESSAGE("Entering LoadParallelComponent");
// @PARALLEL@ permits to identify that the component requested
// is a parallel component.
std::string name = std::string(componentName);
- Engines::EngineComponent_var myInstance = cont->create_component_instance(name.c_str(), studyId);
+ Engines::EngineComponent_var myInstance = cont->create_component_instance(name.c_str());
if (CORBA::is_nil(myInstance))
INFOS("create_component_instance returns a NULL component !");
return myInstance._retn();