else:
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
- builder_name = moduleName + "_SalomeSessionless"
- moduleObj = importlib.import_module(builder_name)
- result, orb = moduleObj.buildInstance(orb)
- 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_common(path=None, embedded=False):
from ORBConfigFile import writeORBConfigFileSSL
OMNIORB_USER_PATH = "OMNIORB_USER_PATH"
global lcc,cm,dsm,esm
import KernelLauncher
cm = KernelLauncher.myContainerManager()
- lcc = StandAloneLifecyle(cm, KernelLauncher.myResourcesManager())
+ from LifeCycleCORBA import LifeCycleCORBASSL
+ lcc = LifeCycleCORBASSL()
# create a FactoryServer Container servant
import KernelContainer
KernelContainer.myContainer()
rm = orb.string_to_object( nsAbroad.Resolve(RM_NAME_IN_NS).decode() )
naming_service.Register(rm,RM_NAME_IN_NS)
#
+ from LifeCycleCORBA import LifeCycleCORBASSL
+ lcc = LifeCycleCORBASSL()
DSM_NAME_IN_NS = "/DataServerManager"
- lcc = StandAloneLifecyle(cm,rm)
dsm = orb.string_to_object( nsAbroad.Resolve(DSM_NAME_IN_NS).decode() )
naming_service.Register(dsm,DSM_NAME_IN_NS)
#
// in a Python module
CORBA::ORB_var orb = KERNEL::GetRefToORB();
// LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
- _NSnew=0;
+ _NSnew = nullptr;
if (!ns)
{
_NS = new SALOME_NamingService(orb);
THROW_SALOME_EXCEPTION("SALOME_LifeCycleCORBA::orb : not a CORBA SALOME_NamingService ");
return NSC->orb();
}
+
+#include "SALOME_Fake_NamingService.hxx"
+
+SALOME_LifeCycleCORBASSL::SALOME_LifeCycleCORBASSL():SALOME_LifeCycleCORBA(new SALOME_Fake_NamingService)
+{
+ _NSnew = _NS;//give to SALOME_LifeCycleCORBA owenership of _NS
+}
import Engines
from libSALOME_LifeCycleCORBA import *
-class LifeCycleCORBA (SALOME_LifeCycleCORBA):
+class LifeCycleCORBA(SALOME_LifeCycleCORBA):
def __init__(self, orb = None):
SALOME_LifeCycleCORBA.__init__(self)
def FindOrLoadComponent(self, containerName, componentName):
- return SALOME_LifeCycleCORBA.FindOrLoad_Component(self,
- containerName,
- componentName)
+ return SALOME_LifeCycleCORBA.FindOrLoad_Component(self,containerName,componentName)
+
+class LifeCycleCORBASSL(SALOME_LifeCycleCORBASSL):
+ def __init__(self):
+ SALOME_LifeCycleCORBASSL.__init__(self)
+ def FindOrLoadComponent(self, containerName, componentName):
+ return SALOME_LifeCycleCORBA.FindOrLoad_Component(self,containerName,componentName)
class ContainerParameters (Engines.ContainerParameters):
def __init__(self, container_name='', mode='start', workingdir='', nb_proc=0, isMPI=False, parallelLib='',resource_params=None):