]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
ResourcesManager in sessionless mode.
authorOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 12 Jul 2021 12:36:50 +0000 (14:36 +0200)
committerOvidiu Mircescu <ovidiu.mircescu@edf.fr>
Mon, 12 Jul 2021 12:36:50 +0000 (14:36 +0200)
src/KERNEL_PY/__init__.py
src/Launcher/KernelLauncher.cxx
src/Launcher/KernelLauncher.hxx
src/Launcher/KernelLauncher.i

index cbe51e8e04e3cb8bf575c08e0ddd21ac21a9ef50..8a62c4a4226623f12ee4854d1be856fd5168a743 100644 (file)
@@ -184,6 +184,10 @@ def salome_init(path=None, embedded=False):
             salome_init_with_session(path, embedded)
 
 class StandAloneLifecyle:
+    def __init__(self, containerManager, resourcesManager):
+        self._cm = containerManager
+        self._rm = resourcesManager
+
     def FindOrLoadComponent(self,contName,moduleName):
         global orb
         import importlib
@@ -193,9 +197,14 @@ class StandAloneLifecyle:
         return result
         #raise RuntimeError("Undealed situation cont = {} module = {}".format(contName,moduleName))
 
+    def getContainerManager(self):
+      return self._cm
+
+    def getResourcesManager(self):
+      return self._rm
+
 def salome_init_without_session():
     global lcc,myStudy,orb,modulcat,sg,cm
-    lcc = StandAloneLifecyle()
     import KernelBasis
     KernelBasis.setSSLMode(True)
     import KernelDS
@@ -208,6 +217,7 @@ def salome_init_without_session():
     modulcat = KernelModuleCatalog.myModuleCatalog( list_of_catalogs_regarding_environement() )
     import KernelLauncher
     cm = KernelLauncher.myContainerManager()
+    lcc = StandAloneLifecyle(cm, KernelLauncher.myResourcesManager())
     # activate poaManager to accept co-localized CORBA calls.
     poa = orb.resolve_initial_references("RootPOA")
     poaManager = poa._get_the_POAManager()
index 05213a8844a73bdcb4745699fa4b9d1b3908be2e..5eaaae9f9942cf932a17c641ff4792372296a373 100644 (file)
@@ -23,6 +23,7 @@
 #include "SALOME_ContainerManager.hxx"
 #include "SALOME_Fake_NamingService.hxx"
 #include "SALOME_KernelServices.hxx"
+#include "SALOME_ResourcesManager.hxx"
 
 #include <cstring>
 
@@ -35,3 +36,13 @@ std::string GetContainerManagerInstance()
   CORBA::String_var ior = orb->object_to_string(cm);
   return std::string(ior.in());
 }
+
+std::string GetResourcesManagerInstance()
+{
+  SALOME_Launcher *launcher = KERNEL::getLauncherSA();
+  SALOME_Fake_NamingService ns;
+  CORBA::Object_var cm = ns.Resolve(SALOME_ResourcesManager::_ResourcesManagerNameInNS);
+  CORBA::ORB_ptr orb = KERNEL::getORB();
+  CORBA::String_var ior = orb->object_to_string(cm);
+  return std::string(ior.in());
+}
index 378843b99ac9f36d7276bea77911d2dd956f2e54..567f5e581758f9f0310999e23783189d75042640 100644 (file)
@@ -22,3 +22,4 @@
 #include <string>
 
 std::string GetContainerManagerInstance();
+std::string GetResourcesManagerInstance();
index 013758ca5d7620f38e9080d427fe6f914c198af9..d67ef54f542e51713d54b32eb8e4ebf09aff1d89 100644 (file)
@@ -28,6 +28,7 @@
 %inline
 {
   std::string GetContainerManagerInstance();
+  std::string GetResourcesManagerInstance();
 }
 
 %pythoncode %{
@@ -36,4 +37,10 @@ def myContainerManager():
   import CORBA
   orb=CORBA.ORB_init([''])
   return orb.string_to_object(GetContainerManagerInstance())
+
+def myResourcesManager():
+  import Engines
+  import CORBA
+  orb=CORBA.ORB_init([''])
+  return orb.string_to_object(GetResourcesManagerInstance())
 %}