C++ implementation of Engines::Container interface for parallel container implemented with PaCO++. More...
#include <SALOME_ParallelContainer_i.hxx>

Public Member Functions | |
| Engines_Parallel_Container_i (CORBA::ORB_ptr orb, char *ior, int rank, PortableServer::POA_ptr poa, std::string containerName, bool isServantAloneInProcess=true) | |
| Constructor. More... | |
| virtual | ~Engines_Parallel_Container_i () |
| Destructor. More... | |
| virtual bool | load_component_Library (const char *componentName, CORBA::String_out reason) |
| load a new component class More... | |
| virtual Engines::EngineComponent_ptr | create_component_instance (const char *componentName) |
| Create a new component instance. More... | |
| virtual Engines::EngineComponent_ptr | create_component_instance_env (const char *componentName, const Engines::FieldsDict &env, CORBA::String_out reason) |
| Create a new component instance. More... | |
| virtual char * | create_python_service_instance (const char *CompName, CORBA::String_out reason) |
| Engines::EngineComponent_ptr | find_component_instance (const char *registeredName) |
| Find an existing (in the container) component instance. More... | |
| Engines::EngineComponent_ptr | load_impl (const char *nameToRegister, const char *componentName) |
| Find or create a new component instance. More... | |
| void | create_paco_component_node_instance (const char *componentName, const char *proxy_containerName) |
| void | updateInstanceNumber () |
| void | remove_impl (Engines::EngineComponent_ptr component_i) |
| Remove the component instance from container. More... | |
| void | finalize_removal () |
| Unload component libraries from the container. More... | |
| virtual void | ping () |
| Ping the servant to check it is still alive. More... | |
| char * | name () |
| Get container name. More... | |
| char * | workingdir () |
| Get container working directory. More... | |
| char * | logfilename () |
| Get container log file name. More... | |
| void | logfilename (const char *name) |
| Set container log file name. More... | |
| virtual void | Shutdown () |
| Shutdown the container. More... | |
| char * | getHostName () |
| Get container host name. More... | |
| CORBA::Long | getPID () |
| Get container PID. More... | |
| bool | Kill_impl () |
| Kill current container. More... | |
| Engines::EngineComponent_ptr | find_or_create_instance (std::string genericRegisterName) |
| Finds an already existing component instance or create a new instance. More... | |
| Engines::EngineComponent_ptr | createCPPInstance (std::string genericRegisterName, void *handle) |
| Create a new CPP component instance. More... | |
| Engines::EngineComponent_ptr | createPythonInstance (std::string genericRegisterName) |
| Create a new Python component instance. More... | |
| void | set_id (PortableServer::ObjectId *id) |
| Engines::fileRef_ptr | createFileRef (const char *origFileName) |
| Get or create a file reference object associated to a local file (to transfer it) More... | |
| Engines::fileTransfer_ptr | getFileTransfer () |
| CORBA method: More... | |
| virtual Engines::Salome_file_ptr | createSalome_file (const char *origFileName) |
| void | copyFile (Engines::Container_ptr container, const char *remoteFile, const char *localFile) |
| copy a file from a remote host (container) to the local host More... | |
| Engines::PyNode_ptr | createPyNode (const char *nodeName, const char *code) |
| create a PyNode object to execute remote python code More... | |
| Engines::PyNode_ptr | getDefaultPyNode (const char *nodeName) |
| Engines::PyScriptNode_ptr | createPyScriptNode (const char *nodeName, const char *code) |
| Engines::PyScriptNode_ptr | getDefaultPyScriptNode (const char *nodeName) |
Static Public Member Functions | |
| static bool | isPythonContainer (const char *ContainerName) |
| Indicate if container is a python one. More... | |
| static void | decInstanceCnt (std::string genericRegisterName) |
| Decrement component instance reference count. More... | |
Protected Types | |
| typedef std::map< std::string, Engines::EngineComponent_var > | _listInstances_map_t |
| typedef std::map< std::string, Engines::fileRef_var > | _fileRef_map_t |
| typedef std::map< std::string, Engines::Salome_file_var > | _Salome_file_map_t |
| typedef PortableServer::ObjectId *(* | FACTORY_FUNCTION) (CORBA::ORB_ptr, char *, int, PortableServer::POA_ptr, PortableServer::ObjectId *, const char *, const char *) |
Protected Attributes | |
| SALOME_NamingService * | _NS |
| std::string | _hostname |
| std::string | _library_path |
| std::string | _containerName |
| std::string | _logfilename |
| CORBA::ORB_var | _orb |
| PortableServer::POA_var | _poa |
| PortableServer::ObjectId * | _id |
| int | _numInstance |
| CORBA::Long | _pid |
| bool | _isServantAloneInProcess |
| Engines::fileTransfer_var | _fileTransfer |
| _listInstances_map_t | _listInstances_map |
| _fileRef_map_t | _fileRef_map |
| _Salome_file_map_t | _Salome_file_map |
| std::map< std::string, PortableServer::ObjectId * > | _par_obj_inst_map |
Static Protected Attributes | |
| static std::map< std::string, int > | _cntInstances_map |
| static std::map< std::string, void * > | _library_map |
| static std::map< std::string, void * > | _toRemove_map |
| static omni_mutex | _numInstanceMutex |
C++ implementation of Engines::Container interface for parallel container implemented with PaCO++.
|
protected |
|
protected |
|
protected |
|
protected |
| Engines_Parallel_Container_i::Engines_Parallel_Container_i | ( | CORBA::ORB_ptr | orb, |
| char * | ior, | ||
| int | rank, | ||
| PortableServer::POA_ptr | poa, | ||
| std::string | containerName, | ||
| bool | isServantAloneInProcess = true |
||
| ) |
|
virtual |
| void Engines_Parallel_Container_i::copyFile | ( | Engines::Container_ptr | container, |
| const char * | remoteFile, | ||
| const char * | localFile | ||
| ) |
copy a file from a remote host (container) to the local host
| container | the remote container |
| remoteFile | the file to copy locally from the remote host into localFile |
| localFile | the local file |
References TestComponentPy::container, MESSAGE, and SALOME_utilities::SCRUTE().
|
virtual |
Create a new component instance.
CORBA method: Creates a new servant instance of a component. The servant registers itself to naming service and Registry.
| genericRegisterName | Name of the component instance to register in Registry & Name Service (without _inst_n suffix) |
References create_component_instance_env().
Referenced by SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance_env(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_python_service_instance(), and find_or_create_instance().
|
virtual |
Create a new component instance.
CORBA method: Creates a new servant instance of a component. The servant registers itself to naming service and Registry.
| genericRegisterName | Name of the component instance to register in Registry & Name Service (without _inst_n suffix) |
| env | dict of environment variables |
References ParallelGlobalProcessVar_i::_library_map, _numInstance, ParallelGlobalProcessVar_i::_numInstanceMutex, createCPPInstance(), createPythonInstance(), and MESSAGE.
Referenced by create_component_instance().
| void Engines_Parallel_Container_i::create_paco_component_node_instance | ( | const char * | componentName, |
| const char * | proxy_containerName | ||
| ) |
References _containerName, _id, ParallelGlobalProcessVar_i::_library_map, _NS, _numInstance, ParallelGlobalProcessVar_i::_numInstanceMutex, _orb, _par_obj_inst_map, _poa, SALOME::INTERNAL_ERROR, MESSAGE, KERNEL_PY.batchmode_salome::obj, SALOME_NamingService::Register(), SALOME_NamingService::Resolve(), SALOME::ExceptionStruct::text, and SALOME::ExceptionStruct::type.
|
virtual |
| Engines::EngineComponent_ptr Engines_Parallel_Container_i::createCPPInstance | ( | std::string | genericRegisterName, |
| void * | handle | ||
| ) |
Create a new CPP component instance.
C++ method: create a servant instance of a component.
| genericRegisterName | Name of the component instance to register in Registry & Name Service, (without _inst_n suffix, like "COMPONENT") |
| handle | loaded library handle |
example with names: aGenRegisterName = COMPONENT (= first argument) _containerName = /Containers/cli76ce/FactoryServer factoryName = COMPONENTEngine_factory component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT instanceName = COMPONENT_inst_1 component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
References ParallelGlobalProcessVar_i::_cntInstances_map, _containerName, _id, _listInstances_map, _NS, _numInstance, _orb, _poa, MESSAGE, KERNEL_PY.batchmode_salome::obj, and SALOME_NamingService::Register().
Referenced by create_component_instance_env().
| Engines::fileRef_ptr Engines_Parallel_Container_i::createFileRef | ( | const char * | origFileName | ) |
Get or create a file reference object associated to a local file (to transfer it)
CORBA method: get or create a fileRef object associated to a local file (a file on the computer on which runs the container server), which stores a list of (machine, localFileName) corresponding to copies already done.
| origFileName | absolute path for a local file to copy on other computers |
References _fileRef_map, _id, ParallelGlobalProcessVar_i::_numInstanceMutex, _poa, and KERNEL_PY.batchmode_salome::obj.
| Engines::PyNode_ptr Engines_Parallel_Container_i::createPyNode | ( | const char * | nodeName, |
| const char * | code | ||
| ) |
create a PyNode object to execute remote python code
| nodeName | the name of the node |
| code | the python code to load |
| Engines::PyScriptNode_ptr Engines_Parallel_Container_i::createPyScriptNode | ( | const char * | nodeName, |
| const char * | code | ||
| ) |
| Engines::EngineComponent_ptr Engines_Parallel_Container_i::createPythonInstance | ( | std::string | genericRegisterName | ) |
Create a new Python component instance.
C++ method: create a servant instance of a component.
| genericRegisterName | Name of the component instance to register in Registry & Name Service, (without _inst_n suffix, like "COMPONENT") |
| handle | loaded library handle |
example with names: aGenRegisterName = COMPONENT (= first argument) _containerName = /Containers/cli76ce/FactoryServer factoryName = COMPONENTEngine_factory component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT instanceName = COMPONENT_inst_1 component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
References _containerName, _listInstances_map, _numInstance, _orb, IDLparser::error(), and KERNEL_PY.batchmode_salome::obj.
Referenced by create_component_instance_env().
|
virtual |
|
static |
Decrement component instance reference count.
References ParallelGlobalProcessVar_i::_cntInstances_map, ParallelGlobalProcessVar_i::_library_map, ParallelGlobalProcessVar_i::_numInstanceMutex, ParallelGlobalProcessVar_i::_toRemove_map, Engines_Component_i::GetDynLibraryName(), MESSAGE, and SALOME_utilities::SCRUTE().
Referenced by Engines_Parallel_Component_i::~Engines_Parallel_Component_i().
| void Engines_Parallel_Container_i::finalize_removal | ( | ) |
Unload component libraries from the container.
CORBA method: Discharges unused libraries from the container.
References ParallelGlobalProcessVar_i::_numInstanceMutex, ParallelGlobalProcessVar_i::_toRemove_map, and MESSAGE.
| Engines::EngineComponent_ptr Engines_Parallel_Container_i::find_component_instance | ( | const char * | registeredName | ) |
Find an existing (in the container) component instance.
CORBA method: Finds a servant instance of a component
| registeredName | Name of the component in Registry or Name Service, without instance suffix number |
References _listInstances_map, and SALOME_utilities::SCRUTE().
| Engines::EngineComponent_ptr Engines_Parallel_Container_i::find_or_create_instance | ( | std::string | genericRegisterName | ) |
Finds an already existing component instance or create a new instance.
C++ method: Finds an already existing servant instance of a component, or create an instance. -— USE ONLY FOR MULTISTUDY INSTANCES ! -----—
| genericRegisterName | Name of the component instance to register in Registry & Name Service, (without _inst_n suffix, like "COMPONENT") |
example with names: aGenRegisterName = COMPONENT (= first argument) impl_name = libCOMPONENTEngine.so (= second argument) _containerName = /Containers/cli76ce/FactoryServer factoryName = COMPONENTEngine_factory component_registerBase = /Containers/cli76ce/FactoryServer/COMPONENT
instanceName = COMPONENT_inst_1 component_registerName = /Containers/cli76ce/FactoryServer/COMPONENT_inst_1
References _containerName, _NS, create_component_instance(), KERNEL_PY.batchmode_salome::obj, and SALOME_NamingService::ResolveFirst().
Referenced by load_impl().
| Engines::PyNode_ptr Engines_Parallel_Container_i::getDefaultPyNode | ( | const char * | nodeName | ) |
| Engines::PyScriptNode_ptr Engines_Parallel_Container_i::getDefaultPyScriptNode | ( | const char * | nodeName | ) |
| Engines::fileTransfer_ptr Engines_Parallel_Container_i::getFileTransfer | ( | ) |
| char * Engines_Parallel_Container_i::getHostName | ( | ) |
| CORBA::Long Engines_Parallel_Container_i::getPID | ( | ) |
|
static |
Indicate if container is a python one.
Retrieves only with container naming convention if it is a python container
References TestKernelHelpers::ret.
| bool Engines_Parallel_Container_i::Kill_impl | ( | ) |
Kill current container.
Kill the container.
CORBA method: Kill the container process with exit(0). To remove : never returns !
References _containerName, _hostname, _pid, and MESSAGE.
|
virtual |
load a new component class
CORBA method: load a new component class (Python or C++ implementation)
| componentName | like COMPONENT try to make a Python import of COMPONENT, then a lib open of libCOMPONENTEngine.so |
References ParallelGlobalProcessVar_i::_library_map, ParallelGlobalProcessVar_i::_numInstanceMutex, ParallelGlobalProcessVar_i::_toRemove_map, MESSAGE, and TestKernelHelpers::ret.
Referenced by load_impl().
| Engines::EngineComponent_ptr Engines_Parallel_Container_i::load_impl | ( | const char * | genericRegisterName, |
| const char * | componentName | ||
| ) |
Find or create a new component instance.
CORBA method: find or create an instance of the component (servant), load a new component class (dynamic library) if required, -— FOR COMPATIBILITY WITH 2.2 -— -— USE ONLY FOR MULTISTUDY INSTANCES ! -----— The servant registers itself to naming service and Registry.
| genericRegisterName | Name of the component to register in Registry & Name Service |
| componentName | Name of the constructed library of the component |
References find_or_create_instance(), and load_component_Library().
| char * Engines_Parallel_Container_i::logfilename | ( | ) |
| void Engines_Parallel_Container_i::logfilename | ( | const char * | name | ) |
Set container log file name.
References _logfilename, and name().
| char * Engines_Parallel_Container_i::name | ( | ) |
Get container name.
CORBA attribute: Container name (see constructor)
References _containerName.
Referenced by IDLparser.Tree::__repr__(), IDLparser.Tree::getNode(), logfilename(), and IDLparser.Tree::output_xml().
|
virtual |
| void Engines_Parallel_Container_i::remove_impl | ( | Engines::EngineComponent_ptr | component_i | ) |
Remove the component instance from container.
CORBA method: Stops the component servant, and deletes all related objects
| component_i | Component to be removed |
References _listInstances_map, _NS, ParallelGlobalProcessVar_i::_numInstanceMutex, SALOME_NamingService::Destroy_Name(), and MESSAGE.
| void Engines_Parallel_Container_i::set_id | ( | PortableServer::ObjectId * | id | ) |
|
virtual |
Shutdown the container.
CORBA method, oneway: Server shutdown.
References _containerName, _isServantAloneInProcess, _listInstances_map, _NS, _orb, _par_obj_inst_map, _poa, SALOME_NamingService::Destroy_FullDirectory(), SALOME_NamingService::Destroy_Name(), and MESSAGE.
| void Engines_Parallel_Container_i::updateInstanceNumber | ( | ) |
References _numInstance, and ParallelGlobalProcessVar_i::_numInstanceMutex.
| char * Engines_Parallel_Container_i::workingdir | ( | ) |
Get container working directory.
CORBA attribute: Container working directory
|
staticprotectedinherited |
|
protected |
Referenced by SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::_get_name(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), SALOME_Container.SALOME_Container_Abstract_i::create_component_instance(), create_paco_component_node_instance(), createCPPInstance(), createPythonInstance(), Engines_Parallel_Container_i(), find_or_create_instance(), Kill_impl(), name(), SALOME_Container.SALOME_Container_Abstract_i::setLogFileName(), Shutdown(), and SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::Shutdown().
|
protected |
Referenced by createFileRef().
|
protected |
Referenced by Engines_Parallel_Container_i(), and getFileTransfer().
|
protected |
|
protected |
|
protected |
Referenced by Shutdown().
|
staticprotectedinherited |
|
protected |
|
protected |
Referenced by SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), createCPPInstance(), createPythonInstance(), find_component_instance(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::find_component_instance(), remove_impl(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::remove_impl(), and Shutdown().
|
protected |
Referenced by SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::_get_logfilename(), and logfilename().
|
protected |
|
protected |
Referenced by SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), create_component_instance_env(), create_paco_component_node_instance(), createCPPInstance(), createPythonInstance(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::load_component_Library(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::load_impl(), and updateInstanceNumber().
|
staticprotectedinherited |
Referenced by create_component_instance_env(), Container_proxy_impl_final::create_component_instance_env(), create_paco_component_node_instance(), createFileRef(), createSalome_file(), decInstanceCnt(), finalize_removal(), load_component_Library(), Container_proxy_impl_final::load_component_Library(), remove_impl(), and updateInstanceNumber().
|
protected |
Referenced by SALOME_Container.SALOME_Container_Abstract_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_i::__init__(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::__init__(), SALOME_NamingServicePy.SALOME_NamingServicePy_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), SALOME_Container.SALOME_Container_Abstract_i::create_component_instance(), create_paco_component_node_instance(), SALOME_Container.SALOME_Container_Abstract_i::create_pynode(), SALOME_Container.SALOME_Container_Abstract_i::create_pyscriptnode(), createCPPInstance(), createPythonInstance(), Engines_Parallel_Container_i(), SALOME_Embedded_NamingService_ClientPy.SALOME_Embedded_NamingService_ClientPy::Register(), SALOME_Embedded_NamingService_ClientPy.SALOME_Embedded_NamingService_ClientPy::Resolve(), Shutdown(), and SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::Shutdown().
|
protected |
Referenced by create_paco_component_node_instance(), and Shutdown().
|
protected |
Referenced by Engines_Parallel_Container_i(), getPID(), Kill_impl(), SALOME_PyNode.MonitoringInfo::pid(), and ping().
|
protected |
Referenced by SALOME_Container.SALOME_Container_Abstract_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::__init__(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::__init__(), SALOME_ContainerPy.SALOME_ContainerPy_Gen_i::create_component_instance(), SALOME_Container.SALOME_Container_Abstract_i::create_component_instance(), create_paco_component_node_instance(), SALOME_Container.SALOME_Container_Abstract_i::create_pynode(), SALOME_Container.SALOME_Container_Abstract_i::create_pyscriptnode(), createCPPInstance(), createFileRef(), SALOME_ComponentPy.SALOME_ComponentPy_Gen_i::destroy(), Engines_Parallel_Container_i(), SALOME_PyNode.ContextExchanger_i::getInputContext(), SALOME_PyNode.ContextExchanger_i::getPOA(), and Shutdown().
|
protected |
Referenced by createSalome_file().
|
staticprotectedinherited |
Referenced by decInstanceCnt(), finalize_removal(), and load_component_Library().