Salome HOME
updated copyright message
[modules/gui.git] / src / PVServerService / ENGINE / PVSERVER.py
index c3396b6e6e36bdf133ad104f0102c7e30aeec13a..2188ddd97296d6188a5bad2b8b68250a8b93c86e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2015  CEA/DEN, EDF R&D
+# Copyright (C) 2015-2023  CEA, EDF, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,8 @@
 #
 
 import PVSERVER_ORB__POA
-from SALOME_NamingServicePy import SALOME_NamingServicePy_i
+import SALOME_ComponentPy
+import SALOME_Embedded_NamingService_ClientPy
 from PVSERVER_impl import PVSERVER_impl, MESSAGE 
     
 class PVSERVER(PVSERVER_ORB__POA.PVSERVER_Gen,
@@ -43,16 +44,26 @@ class PVSERVER(PVSERVER_ORB__POA.PVSERVER_Gen,
 #         self._interfaceName = interfaceName
         self._containerName = containerName
 #         self._contId = contID
+        self._compo_o = None
+
+        emb_ns = contID.get_embedded_NS_if_ssl()
+        import CORBA
+        if CORBA.is_nil(emb_ns):
+            self._naming_service = SALOME_ComponentPy.SALOME_NamingServicePy_i( self._orb )
+        else:
+            self._naming_service = SALOME_Embedded_NamingService_ClientPy.SALOME_Embedded_NamingService_ClientPy(emb_ns)
 
-        self._naming_service = SALOME_NamingServicePy_i(self._orb)
         Component_path = self._containerName + "/" + self._instanceName
         MESSAGE(  'SALOME_ComponentPy_i Register' + str( Component_path ) )
         id_o = poa.activate_object(self)
-        compo_o = poa.id_to_reference(id_o)
+        self._compo_o = poa.id_to_reference(id_o)
         
         ## And launch registration
         ##
-        self._naming_service.Register(compo_o, Component_path)        
+        self._naming_service.Register(self._compo_o, Component_path)
+
+    def getCorbaRef(self):
+        return self._compo_o
 
     """ Override base class destroy to make sure we try to kill the pvserver
         before leaving.
@@ -60,4 +71,5 @@ class PVSERVER(PVSERVER_ORB__POA.PVSERVER_Gen,
     def destroy(self):
         # TODO
         self.StopPVServer()
+
   
\ No newline at end of file