# -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
import Registry
from Utils_Identity import *
from SALOME_NamingServicePy import *
+from SALOME_Embedded_NamingService_ClientPy import SALOME_Embedded_NamingService_ClientPy
from libNOTIFICATION import *
from SALOME_utilities import *
def CpuUsed_impl(self):
if ( self._ThreadId | self._Executed ) :
if self._ThreadId == get_ident() :
- cpu = time.clock()
+ cpu = time.process_time()
self._ThreadCpuUsed = cpu - self._StartUsed
MESSAGE( "SALOME_ComponentPy_i::CpuUsed_impl " + self._serviceName + " " + str( int(cpu) ) + " - " + str( self._StartUsed ) + " = " + str( self._ThreadCpuUsed ) )
return self._ThreadCpuUsed
"""
def __init__ (self, orb, poa, contID, containerName, instanceName, interfaceName, notif=False):
SALOME_ComponentPy_Gen_i.__init__(self, orb, poa, contID, containerName, instanceName, interfaceName, notif)
- naming_service = SALOME_NamingServicePy_i(self._orb)
- Component_path = self._containerName + "/" + self._instanceName
+ emb_ns = self._contId.get_embedded_NS_if_ssl()
+ if CORBA.is_nil(emb_ns):
+ self._naming_service = SALOME_NamingServicePy_i(self._orb)
+ else:
+ self._naming_service = SALOME_Embedded_NamingService_ClientPy(emb_ns)
+ Component_path = contID.name + "/" + self._instanceName#self._containerName
MESSAGE( 'SALOME_ComponentPy_i Register' + str( Component_path ) )
- naming_service.Register(self._compo_o, Component_path)
+ self._naming_service.Register(self._compo_o, Component_path)
# Add componentinstance to registry
- obj = naming_service.Resolve('/Registry')
+ obj = self._naming_service.Resolve('/Registry')
if obj is None:
MESSAGE( "Registry Reference is invalid" )
else: