Version: 9.15.0
SALOME_NamingService Class Reference

A class to manage the SALOME naming service. More...

#include <SALOME_NamingService.hxx>

Inheritance diagram for SALOME_NamingService:

Public Member Functions

 SALOME_NamingService ()
 Default Constructor without ORB reference. More...
 
 SALOME_NamingService (CORBA::ORB_ptr orb)
 Standard Constructor, with ORB reference. More...
 
virtual ~SALOME_NamingService ()
 Standard destructor. More...
 
bool IsTrueNS () const override
 
std::vector< std::string > repr () override
 
void init_orb (CORBA::ORB_ptr orb=0) override
 initializes ORB reference and naming service root context. More...
 
void Register (CORBA::Object_ptr ObjRef, const char *Path) override
 Registers a CORBA object reference under a path. More...
 
CORBA::Object_ptr Resolve (const char *Path) override
 get the CORBA object reference associated to a name. More...
 
CORBA::Object_ptr ResolveFirst (const char *Path)
 get the CORBA object reference associated to an incomplete name. More...
 
CORBA::Object_ptr ResolveComponent (const char *hostname, const char *containerName, const char *componentName, const int nbproc=0) override
 find a component instance from hostname, containername, componentName and number of processors. More...
 
int Find (const char *name)
 search a name in current directory. More...
 
bool Create_Directory (const char *Path)
 Creates a directory (context_name) More...
 
bool Change_Directory (const char *Path) override
 change current directory to the given path More...
 
char * Current_Directory ()
 get the current directory path More...
 
void list ()
 list recursively all objects in the current context More...
 
std::vector< std::string > list_directory () override
 list all the objects in the current directory. More...
 
std::vector< std::string > list_subdirs () override
 list all the subdirectories in the current directory. More...
 
std::vector< std::string > list_directory_recurs () override
 list all the objects in the current directory and subdirectories. More...
 
void Destroy_Name (const char *Path) override
 destroy an entry in naming service. More...
 
void Destroy_Directory (const char *Path) override
 Destroy an empty directory. More...
 
void Destroy_FullDirectory (const char *Path) override
 Destroy a directory with its contents. More...
 
char * getIORaddr ()
 return a stringified reference of root context More...
 
CORBA::ORB_ptr orb ()
 get the orb used by the naming service More...
 
SALOME_NamingService_Abstractclone () override
 
SALOME_NamingService_AbstractcloneCoVar ()
 

Static Public Member Functions

static std::string ContainerName (const Engines::ContainerParameters &params)
 build a container name, given a ContainerParameters struct. More...
 
static std::string ContainerName (const char *ContainerName)
 provide a default container name if empty. More...
 
static std::string BuildContainerNameForNS (const char *ContainerName, const char *hostname)
 build a string representing a container in Naming Service. More...
 
static std::string BuildContainerNameForNS (const Engines::ContainerParameters &params, const char *hostname)
 build a string representing a container in Naming Service. More...
 
static std::string BuildComponentName (const char *hostname, const char *containerName, const char *componentName, const int nbproc)
 

Static Public Attributes

static constexpr char SEP = '/'
 

Protected Member Functions

void _initialize_root_context ()
 initialize root context (root directory) More...
 
int _createContextNameDir (std::string path, CosNaming::Name &context_name, std::vector< std::string > &splitPath, bool onlyDir)
 transform a string path in CosNaming structure. More...
 
void _Find (const char *name, CORBA::Long &occurence_number)
 search a name in current directory. More...
 
void _current_directory (std::vector< std::string > &splitPath, int &lengthResult, CosNaming::NamingContext_var contextToFind, bool &notFound)
 find the current directory path. More...
 
void _list_directory_recurs (std::vector< std::string > &myList, std::string relativeSubDir, std::string absCurDirectory)
 list recursively all objects in the given directory and subdirs. More...
 

Protected Attributes

Utils_Mutex _myMutex
 
CORBA::ORB_var _orb
 
CosNaming::NamingContext_var _root_context
 
CosNaming::NamingContext_var _current_context
 

Detailed Description

A class to manage the SALOME naming service.

Constructor & Destructor Documentation

◆ SALOME_NamingService() [1/2]

SALOME_NamingService::SALOME_NamingService ( )

Default Constructor without ORB reference.

After Default Constructor, one needs to initialize ORB.

See also
init_orb(CORBA::ORB_ptr orb), SALOME_NamingService(CORBA::ORB_ptr orb)

References _orb, and _root_context.

Referenced by clone().

◆ SALOME_NamingService() [2/2]

SALOME_NamingService::SALOME_NamingService ( CORBA::ORB_ptr  orb)

Standard Constructor, with ORB reference.

Initializes the naming service root context

Parameters
orbCORBA::ORB_ptr arguments

References _initialize_root_context(), _orb, and orb().

◆ ~SALOME_NamingService()

SALOME_NamingService::~SALOME_NamingService ( )
virtual

Standard destructor.

The standard destructor does nothing special.

Member Function Documentation

◆ _createContextNameDir()

int SALOME_NamingService::_createContextNameDir ( std::string  path,
CosNaming::Name &  context_name,
std::vector< std::string > &  splitPath,
bool  onlyDir 
)
protected

transform a string path in CosNaming structure.

Transform a path given as a string in a CosNaming structure.

Parameters
patha relative or absolute path, with or without an object. An absolute path begins with '/'. A path without an object ends with '/'.
context_nameCosNaming structure to put the path.
splitPatha vector of string with subdirectories and final object, if any.
onlyDirif true, final object (if any) is omitted in context_name. if false, final object (if any) is included in context_name.
Returns
dimension of context_name

References TestLifeCycleCORBA::context_name, and ORBConfigFile::path.

Referenced by Change_Directory(), Destroy_Directory(), Destroy_Name(), Register(), and Resolve().

◆ _current_directory()

void SALOME_NamingService::_current_directory ( std::vector< std::string > &  splitPath,
int &  lengthResult,
CosNaming::NamingContext_var  contextToFind,
bool notFound 
)
protected

find the current directory path.

Parse the naming service tree to find the current context and give the associated directory path (relative to root context).

Parameters
splitPath
lengthResult
contextToFind
notFound

References _current_context, Change_Directory(), lines::nb, and KERNEL_PY.batchmode_salome::obj.

Referenced by Current_Directory().

◆ _Find()

void SALOME_NamingService::_Find ( const char *  name,
CORBA::Long &  occurence_number 
)
protected

search a name in current directory.

Search a name in the current directory. after call, the current directory is changed to the directory containing the last occurrence of name found. If no occurrence found (see return value), current directory remains unchanged. The call is recursive.

Parameters
namethe name to search.
occurence_numbernumber of occurrence already found (incremented)

References _current_context, Change_Directory(), pythfilter::name, lines::nb, and SALOME_utilities::SCRUTE().

Referenced by Find().

◆ _initialize_root_context()

void SALOME_NamingService::_initialize_root_context ( )
protected

initialize root context (root directory)

the root context initialisation must be done when the SALOME_NamingService instance is created and before any other call. See constructors.

References _current_context, _orb, _root_context, and KERNEL_PY.batchmode_salome::obj.

Referenced by init_orb(), and SALOME_NamingService().

◆ _list_directory_recurs()

void SALOME_NamingService::_list_directory_recurs ( std::vector< std::string > &  myList,
std::string  relativeSubDir,
std::string  absCurDirectory 
)
protected

list recursively all objects in the given directory and subdirs.

get a list of all the objects in the current directory, with recursion on the subdirectories. Only the objects are listed, not the directories. If the NamingService is out, the exception ServiceUnreachable is thrown. _current_context must refer to absCurDirectory.

Parameters
myListThe list that will be filled.
relativeSubDirThe directory relative to absCurDirectory in which the objects are found.
absCurDirectoryThe current directory, absolute path

References _current_context, Change_Directory(), lines::nb, and SALOME_utilities::SCRUTE().

Referenced by list_directory_recurs().

◆ BuildComponentName()

std::string SALOME_NamingService_Abstract::BuildComponentName ( const char *  hostname,
const char *  containerName,
const char *  componentName,
const int  nbproc 
)
staticinherited

◆ BuildContainerNameForNS() [1/2]

std::string SALOME_NamingService_Abstract::BuildContainerNameForNS ( const char *  containerName,
const char *  hostname 
)
staticinherited

build a string representing a container in Naming Service.

Build a string representing the absolute pathname of a container in SALOME_NamingService. This form gives a suffixed containerName in case of multi processor machine.

Parameters
containerNamename of the container in which the component is instantiated.
hostnamename of the host of the container, without domain names.
Returns
the path under the form /Containers/hostname/containerName
See also
ContainerName(const Engines::MachineParameters& params)

References SALOME_ContainerPy::containerName, SALOME_NamingService_Abstract::ContainerName(), test::hostname, and TestKernelHelpers::ret.

Referenced by Abstract_Engines_Container_i::Abstract_Engines_Container_i(), Container_proxy_impl_final::Container_proxy_impl_final(), Engines_MPIContainer_i::Engines_MPIContainer_i(), Engines_Parallel_Container_i::Engines_Parallel_Container_i(), SALOME_ContainerManager::FindContainer(), SALOME_ContainerManager::GiveContainer(), main(), NamingServiceTest::testBuildContainerNameForNS(), and NamingServiceTest::testBuildContainerNameForNSParams().

◆ BuildContainerNameForNS() [2/2]

std::string SALOME_NamingService_Abstract::BuildContainerNameForNS ( const Engines::ContainerParameters params,
const char *  hostname 
)
staticinherited

build a string representing a container in Naming Service.

Build a string representing the absolute pathname of a container in SALOME_NamingService.

Parameters
paramsused as it is, or replaced by FactoryServer if empty.
hostnamename of the host of the container, without domain names.
Returns
the path under the form /Containers/hostname/containerName
See also
ContainerName(const char *containerName)

References SALOME_NamingService_Abstract::ContainerName(), test::hostname, and TestKernelHelpers::ret.

◆ Change_Directory()

bool SALOME_NamingService::Change_Directory ( const char *  Path)
overridevirtual

change current directory to the given path

change the current directory to the given path in parameter. Warning: avoid use when the SALOME_NamingService instance is shared by several threads (current context may be modified by another thread). If the path is empty, nothing done return OK. If Path ="/", the current directory changes to the root directory. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters
Paththe new current directory
Returns
true if the change succeeded

Implements SALOME_NamingService_Abstract.

References _createContextNameDir(), _current_context, _myMutex, _root_context, TestLifeCycleCORBA::context_name, SALOMEDS::lock(), MESSAGE, KERNEL_PY.batchmode_salome::obj, and ORBConfigFile::path.

Referenced by _current_directory(), NamingServiceTest::_destroyDirectoryRecurs(), _Find(), _list_directory_recurs(), Destroy_FullDirectory(), list(), main(), ResolveComponent(), ResolveFirst(), NamingServiceTest::testChangeDirectory(), NamingServiceTest::testCreateDirectory(), NamingServiceTest::testCurrentDirectory(), NamingServiceTest::testDestroyDirectory(), NamingServiceTest::testDestroyFullDirectory(), NamingServiceTest::testFind(), NamingServiceTest::testList(), NamingServiceTest::testListDirectory(), NamingServiceTest::testListDirectoryRecurs(), NamingServiceTest::testListSubdirs(), NamingServiceTest::testRegisterResolveRelativeNoPath(), NamingServiceTest::testRegisterResolveRelativeWithPath(), NamingServiceTest::testResolveBadNameRelative(), NamingServiceTest::testResolveFirstRelative(), and NamingServiceTest::testResolveFirstUnknownRelative().

◆ clone()

SALOME_NamingService_Abstract * SALOME_NamingService::clone ( )
overridevirtual

◆ cloneCoVar()

◆ ContainerName() [1/2]

std::string SALOME_NamingService_Abstract::ContainerName ( const char *  containerName)
staticinherited

provide a default container name if empty.

the given container name is returned unchanged, unless it is empty.

Parameters
containerName
Returns
container name, where empty input is replaced by "FactoryServer", without the path.
See also
BuildContainerNameForNS(const char *containerName, const char *hostname)

References SALOME_ContainerPy::containerName, and TestKernelHelpers::ret.

◆ ContainerName() [2/2]

std::string SALOME_NamingService_Abstract::ContainerName ( const Engines::ContainerParameters params)
staticinherited

build a container name, given a ContainerParameters struct.

Build a container name with a ContainerParameters struct. In case of multi processor machine, container name is suffixed with number of processors.

Parameters
paramsstruct from which we get container name (may be empty) and number of processors.
Returns
a container name without the path.
See also
BuildContainerNameForNS(const Engines::ContainerParameters& params, const char *hostname)

References Engines::ContainerParameters::container_name, Engines::ContainerParameters::isMPI, Engines::ContainerParameters::nb_proc, and TestKernelHelpers::ret.

Referenced by SALOME_ContainerManager::BuildCommandToLaunchLocalContainer(), SALOME_ContainerManager::BuildCommandToLaunchRemoteContainer(), SALOME_NamingService_Abstract::BuildContainerNameForNS(), SALOME_ContainerManager::BuildTempFileToLaunchRemoteContainer(), SALOME_ContainerManager::LaunchContainer(), NamingServiceTest::testContainerName(), and NamingServiceTest::testContainerNameParams().

◆ Create_Directory()

bool SALOME_NamingService::Create_Directory ( const char *  Path)

Creates a directory (context_name)

Creates a directory (context_name) relative to the current directory (current context) or relative to the root directory (root context), if the path given begins with a '/'. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters
PathA relative or absolute pathname to store the object reference. If the pathname begins with a '/', pathname is taken as an absolute pathname. Else, pathname is taken as a relative path, to current context. Prefer absolute pathname, relative pathname are not safe, when SALOME_NamingService object is shared or use in multithreaded context.
Returns
true if successful (creation not strictly guaranteed if true, because Register may catch some specific unlikely exception without throw anything — to be corrected —)
See also
RegisterCORBA::Object_ptr ObjRef, const char* Path)

References _current_context, _myMutex, _root_context, SALOMEDS::lock(), ORBConfigFile::path, and Register().

Referenced by NamingServiceTest::testCreateDirectory(), NamingServiceTest::testCurrentDirectory(), NamingServiceTest::testRegisterResolveRelativeNoPath(), NamingServiceTest::testRegisterResolveRelativeWithPath(), NamingServiceTest::testResolveBadNameRelative(), and NamingServiceTest::testResolveFirstUnknownRelative().

◆ Current_Directory()

char * SALOME_NamingService::Current_Directory ( )

get the current directory path

Get the current directory path. If the NamingService is out, the exception ServiceUnreachable is thrown.

Returns
the path of the current_context
See also
_current_directory

< TODO: conversion from size_t to int

References _current_context, _current_directory(), _myMutex, _root_context, SALOMEDS::lock(), ORBConfigFile::path, and SALOME_utilities::SCRUTE().

Referenced by list_directory_recurs(), and NamingServiceTest::testCurrentDirectory().

◆ Destroy_Directory()

void SALOME_NamingService::Destroy_Directory ( const char *  Path)
overridevirtual

Destroy an empty directory.

Destroy an empty directory in Naming Service. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters
Pathdirectory path

Implements SALOME_NamingService_Abstract.

References _createContextNameDir(), _current_context, _myMutex, _root_context, TestLifeCycleCORBA::context_name, SALOMEDS::lock(), KERNEL_PY.batchmode_salome::obj, and ORBConfigFile::path.

Referenced by Destroy_FullDirectory(), and NamingServiceTest::testDestroyDirectory().

◆ Destroy_FullDirectory()

void SALOME_NamingService::Destroy_FullDirectory ( const char *  Path)
overridevirtual

Destroy a directory with its contents.

Destroy the objects associations in a directory, and the directory itself, if there is no subdirectories. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters
Paththe directory path.

Implements SALOME_NamingService_Container_Abstract.

References Change_Directory(), Destroy_Directory(), Destroy_Name(), and list_directory().

Referenced by NamingServiceTest::_destroyDirectoryRecurs(), Engines_Parallel_Container_i::Shutdown(), Container_proxy_impl_final::Shutdown(), and NamingServiceTest::testDestroyFullDirectory().

◆ Destroy_Name()

void SALOME_NamingService::Destroy_Name ( const char *  Path)
overridevirtual

◆ Find()

int SALOME_NamingService::Find ( const char *  name)

search a name in current directory.

Search a name in the current directory. after call, the current directory is changed to the directory containing the last occurrence of name found. If no occurrence found (see return value), current directory remains unchanged.

Parameters
namethe name to search.
Returns
number of occurrences found.
See also
Change_Directory(const char* Path)

References _Find(), _myMutex, SALOMEDS::lock(), and pythfilter::name.

Referenced by NamingServiceTest::testFind().

◆ getIORaddr()

char * SALOME_NamingService::getIORaddr ( )

◆ init_orb()

void SALOME_NamingService::init_orb ( CORBA::ORB_ptr  orb = 0)
overridevirtual

initializes ORB reference and naming service root context.

Initializes ORB reference and naming service root context. For use after default constructor. If param orb is null, the orb is initialized

Parameters
orbCORBA::ORB_ptr arguments

Implements SALOME_NamingService_Container_Abstract.

References _initialize_root_context(), _myMutex, _orb, KERNEL::GetRefToORB(), SALOMEDS::lock(), and orb().

Referenced by Container_proxy_impl_final::Container_proxy_impl_final(), Engines_Parallel_Container_i::Engines_Parallel_Container_i(), Engines_Component_i::getNS(), main(), LifeCycleCORBATest::setUp(), NamingServiceTest::setUp(), and NamingServiceTest::testConstructorDefault().

◆ IsTrueNS()

bool SALOME_NamingService::IsTrueNS ( ) const
overridevirtual

◆ list()

void SALOME_NamingService::list ( )

list recursively all objects in the current context

List and print via trace all directories and objects in the current context. Trace must be activated: compile option DEBUG If the NamingService is out, the exception ServiceUnreachable is thrown

References _current_context, _myMutex, Change_Directory(), SALOMEDS::lock(), MESSAGE, and lines::nb.

Referenced by IDLparser.Catalog::endElement(), IDLparser.Catalog::startDocument(), IDLparser.Catalog::startElement(), and NamingServiceTest::testList().

◆ list_directory()

std::vector< std::string > SALOME_NamingService::list_directory ( )
overridevirtual

list all the objects in the current directory.

get a list of all the objects in the current directory, without recursion on the subdirectories. Only the objects are listed, not the directories. If the NamingService is out, the exception ServiceUnreachable is thrown.

Returns
list of strings with objects found.
See also
vector<string> list_directory_recurs()

Implements SALOME_NamingService_Abstract.

References _current_context, _myMutex, SALOMEDS::lock(), and lines::nb.

Referenced by Destroy_FullDirectory(), ResolveFirst(), and NamingServiceTest::testListDirectory().

◆ list_directory_recurs()

std::vector< std::string > SALOME_NamingService::list_directory_recurs ( )
overridevirtual

list all the objects in the current directory and subdirectories.

get a list of all the objects in the current directory, with recursion on the subdirectories. Only the objects are listed, not the directories. If the NamingService is out, the exception ServiceUnreachable is thrown.

Returns
list of strings with objects found.
See also
vector<string> list_directory()

Implements SALOME_NamingService_Abstract.

References _list_directory_recurs(), _myMutex, Current_Directory(), and SALOMEDS::lock().

Referenced by main(), NamingServiceTest::testDestroyFullDirectory(), and NamingServiceTest::testListDirectoryRecurs().

◆ list_subdirs()

std::vector< std::string > SALOME_NamingService::list_subdirs ( )
overridevirtual

list all the subdirectories in the current directory.

get a list of all the subdirectories in the current directory, without recursion on the subdirectories. Only the subdirectories are listed, not the objects. If the NamingService is out, the exception ServiceUnreachable is thrown.

Returns
list of strings with directories found.
See also
vector<string> list_directory()

Implements SALOME_NamingService_Abstract.

References _current_context, _myMutex, SALOMEDS::lock(), and lines::nb.

Referenced by NamingServiceTest::_destroyDirectoryRecurs(), ResolveComponent(), NamingServiceTest::testDestroyDirectory(), NamingServiceTest::testDestroyFullDirectory(), and NamingServiceTest::testListSubdirs().

◆ orb()

CORBA::ORB_ptr SALOME_NamingService::orb ( )

get the orb used by the naming service

Returns
the orb

References _orb.

Referenced by init_orb(), orbmodule.client::initNS(), runConsole.client::initNS(), SALOME_LifeCycleCORBA::orb(), and SALOME_NamingService().

◆ Register()

void SALOME_NamingService::Register ( CORBA::Object_ptr  ObjRef,
const char *  Path 
)
overridevirtual

Registers a CORBA object reference under a path.

Registers a CORBA object reference under a path. If the path ends with '/', only a directory is created. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters
ObjRefCORBA object reference to associate to the path. To create only a directory, give nil pointer.
PathA relative or absolute pathname to store the object reference. If the pathname begins with a '/', pathname is taken as an absolute pathname. Else, pathname is taken as a relative path, to current context. Prefer absolute pathname, relative pathname are not safe, when SALOME_NamingService object is shared or use in multithreaded context. If the path ends with '/', only a directory is created.
See also
Change_Directory(const char* Path), Create_Directory(const char* Path) CORBA::Object_ptr Resolve(const char* Path)

Implements SALOME_NamingService_Container_Abstract.

References _createContextNameDir(), _current_context, _myMutex, _root_context, TestLifeCycleCORBA::context_name, SALOMEDS::lock(), and KERNEL_PY.batchmode_salome::obj.

Referenced by ConnectionManager_i::ConnectionManager_i(), Container_proxy_impl_final::create_component_instance_env(), Create_Directory(), Engines_Parallel_Container_i::create_paco_component_node_instance(), Engines_Parallel_Container_i::createCPPInstance(), main(), NamingServiceTest::testChangeDirectory(), NamingServiceTest::testCreateDirectory(), NamingServiceTest::testDestroyDirectory(), NamingServiceTest::testDestroyName(), NamingServiceTest::testFind(), NamingServiceTest::testRegisterResolveAbsNoPath(), NamingServiceTest::testRegisterResolveAbsWithPath(), NamingServiceTest::testRegisterResolveRelativeNoPath(), NamingServiceTest::testRegisterResolveRelativeWithPath(), NamingServiceTest::testResolveComponentEmptyComponentName(), NamingServiceTest::testResolveComponentEmptyContainerName(), NamingServiceTest::testResolveComponentEmptyHostname(), NamingServiceTest::testResolveComponentFalseNbproc(), NamingServiceTest::testResolveComponentOK(), NamingServiceTest::testResolveComponentUnknownComponentName(), NamingServiceTest::testResolveComponentUnknownContainerName(), NamingServiceTest::testResolveComponentUnknownHostname(), NamingServiceTest::testResolveFirst(), and NamingServiceTest::testResolveFirstRelative().

◆ repr()

std::vector< std::string > SALOME_NamingService::repr ( )
overridevirtual

◆ Resolve()

CORBA::Object_ptr SALOME_NamingService::Resolve ( const char *  Path)
overridevirtual

get the CORBA object reference associated to a name.

get the CORBA object reference associated to a complete name with a path. If the NamingService is out, the exception ServiceUnreachable is thrown

Parameters
Pathpathname. If the pathname begins with a '/', pathname is taken as an absolute pathname. Else, pathname is taken as a relative path, to current context. Prefer absolute pathname, relative pathname are not safe, when SALOME_NamingService object is shared or use in multithreaded context.
Returns
the object reference if it exists under the pathname, or nil reference in other cases.
See also
Register(CORBA::Object_ptr ObjRef, const char* Path), Change_Directory(const char* Path)

Implements SALOME_NamingService_Container_Abstract.

References _createContextNameDir(), _current_context, _myMutex, _root_context, TestLifeCycleCORBA::context_name, SALOMEDS::lock(), MESSAGE, and KERNEL_PY.batchmode_salome::obj.

Referenced by Engines_Parallel_Container_i::create_paco_component_node_instance(), LifeCycleCORBATest::GetRemoteHost(), main(), NamingService_WaitForServerReadiness(), ResolveFirst(), SALOMEDSTest::setUp(), SALOMEDSTest_Embedded::setUp(), NamingServiceTest::testChangeDirectory(), NamingServiceTest::testCreateDirectory(), NamingServiceTest::testDestroyDirectory(), NamingServiceTest::testDestroyName(), NamingServiceTest::testFind(), NamingServiceTest::testRegisterResolveAbsNoPath(), NamingServiceTest::testRegisterResolveAbsWithPath(), NamingServiceTest::testRegisterResolveRelativeNoPath(), NamingServiceTest::testRegisterResolveRelativeWithPath(), NamingServiceTest::testResolveBadName(), NamingServiceTest::testResolveBadNameRelative(), NamingServiceTest::testResolveComponentEmptyComponentName(), NamingServiceTest::testResolveComponentEmptyContainerName(), NamingServiceTest::testResolveComponentEmptyHostname(), NamingServiceTest::testResolveComponentFalseNbproc(), NamingServiceTest::testResolveComponentOK(), NamingServiceTest::testResolveComponentUnknownComponentName(), NamingServiceTest::testResolveComponentUnknownContainerName(), NamingServiceTest::testResolveComponentUnknownHostname(), NamingServiceTest::testResolveFirst(), NamingServiceTest::testResolveFirstRelative(), orbmodule.client::waitNS(), and orbmodule.client::waitNSPID().

◆ ResolveComponent()

CORBA::Object_ptr SALOME_NamingService::ResolveComponent ( const char *  hostname,
const char *  containerName,
const char *  componentName,
const int  nbproc = 0 
)
overridevirtual

find a component instance from hostname, containername, componentName and number of processors.

find a component instance from hostname, containername, componentName and number of processors. If the NamingService is out, the exception ServiceUnreachable is thrown.

Parameters
hostnamename of the machine on which the component is searched.
containerNamename of the container in which the component is instantiated.
componentNamename of the component we are looking for an existing instance.
nbprocin case of multi processor machine, container name is suffixed with _nbproc.
Returns
the object reference

Implements SALOME_NamingService_Abstract.

References _myMutex, Change_Directory(), SALOME_ContainerPy::containerName, test::hostname, list_subdirs(), SALOMEDS::lock(), pythfilter::name, KERNEL_PY.batchmode_salome::obj, ResolveFirst(), and SALOME_utilities::SCRUTE().

Referenced by NamingServiceTest::testResolveComponentEmptyComponentName(), NamingServiceTest::testResolveComponentEmptyContainerName(), NamingServiceTest::testResolveComponentEmptyHostname(), NamingServiceTest::testResolveComponentFalseNbproc(), NamingServiceTest::testResolveComponentOK(), NamingServiceTest::testResolveComponentUnknownComponentName(), NamingServiceTest::testResolveComponentUnknownContainerName(), and NamingServiceTest::testResolveComponentUnknownHostname().

◆ ResolveFirst()

CORBA::Object_ptr SALOME_NamingService::ResolveFirst ( const char *  Path)
virtual

get the CORBA object reference associated to an incomplete name.

get the CORBA object reference associated to an incomplete name with a path. Look for the first occurrence of name*. If the NamingService is out, the exception ServiceUnreachable is thrown

Parameters
Pathpathname under the form "/path/name" (Absolute reference !) search the fist reference like "/path(.dir)/name*(.kind)"
Returns
the object reference if found, or nil reference.
See also
Resolve(const char* Path)

Implements SALOME_NamingService_Container_Abstract.

References _myMutex, Change_Directory(), list_directory(), SALOMEDS::lock(), pythfilter::name, KERNEL_PY.batchmode_salome::obj, and Resolve().

Referenced by Engines_Parallel_Container_i::find_or_create_instance(), ResolveComponent(), NamingServiceTest::testResolveFirst(), NamingServiceTest::testResolveFirstRelative(), NamingServiceTest::testResolveFirstUnknown(), and NamingServiceTest::testResolveFirstUnknownRelative().

Field Documentation

◆ _current_context

◆ _myMutex

◆ _orb

◆ _root_context

◆ SEP

constexpr char SALOME_NamingService_Container_Abstract::SEP = '/'
staticconstexprinherited