]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
naming_service is available in salome module in SSL mode
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 17 Aug 2021 09:16:05 +0000 (11:16 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 17 Aug 2021 09:16:05 +0000 (11:16 +0200)
src/KERNEL_PY/__init__.py
src/NamingService/NamingService.i

index 7b99a03e48498fa6999ea83e2b4205de950c0d64..5c0900e62689a9a8faecc18f3c7453475faacbfa 100644 (file)
@@ -204,7 +204,7 @@ class StandAloneLifecyle:
       return self._rm
 
 def salome_init_without_session():
-    global lcc,myStudy,orb,modulcat,sg,cm
+    global lcc,naming_service,myStudy,orb,modulcat,sg,cm
     import KernelBasis
     KernelBasis.setSSLMode(True)
     import KernelDS
@@ -216,6 +216,7 @@ def salome_init_without_session():
     from salome_kernel import list_of_catalogs_regarding_environement
     modulcat = KernelModuleCatalog.myModuleCatalog( list_of_catalogs_regarding_environement() )
     import KernelLauncher
+    from NamingService import NamingService
     cm = KernelLauncher.myContainerManager()
     lcc = StandAloneLifecyle(cm, KernelLauncher.myResourcesManager())
     # activate poaManager to accept co-localized CORBA calls.
@@ -224,6 +225,7 @@ def salome_init_without_session():
     poaManager.activate()
     sg = SalomeOutsideGUI()
     salome_study_init_without_session()
+    naming_service = NamingService()
 
 def salome_init_with_session(path=None, embedded=False):
     """
index 08b58d9967bb02af0f1a00b7612a76ff5b94ee63..a6497c6a0b8553aa7d29292bb5eeaebdd6cc849d 100644 (file)
@@ -68,6 +68,8 @@ public:
   std::vector< std::string > repr();
   static std::string GetLogContainersFile();
   static void FlushLogContainersFile();
+  void Destroy_Name(const char* Path);
+  void Destroy_FullDirectory(const char* Path);
   %extend {
     static void SetLogContainersFileInternal(const std::string& logFileName)
     {
@@ -86,6 +88,13 @@ public:
       CORBA::Object_var obj = orb->string_to_object(ior);
       self->Register(obj,Path);
     }
+    std::string _Resolve_DirInternal(const char *Path)
+    {
+      CORBA::ORB_ptr orb = KERNEL::getORB();
+      CORBA::Object_var ret = self->Resolve(Path);
+      CORBA::String_var ior = orb->object_to_string(ret);
+      return std::string(ior.in());
+    }
     static std::string IOROfNS()
     {
       CORBA::ORB_ptr orb = KERNEL::getORB();
@@ -106,8 +115,14 @@ def NamingService_Register(self,obj,Path):
   import CORBA
   orb=CORBA.ORB_init([''])
   self._RegisterInternal( orb.object_to_string(obj) , Path)
+def NamingService_Resolve_Dir(self,Path):
+  ret = self._Resolve_DirInternal( Path )
+  import CORBA
+  orb=CORBA.ORB_init([''])
+  return orb.string_to_object(ret)
 NamingService.Resolve = NamingService_Resolve
 NamingService.Register = NamingService_Register
+NamingService.Resolve_Dir = NamingService_Resolve_Dir
 def NamingService_SetLogContainersFile(cls,logFileName = None):
   if logFileName is None:
     import tempfile