Salome HOME
Make PVSERVER available in SSL mode.
[modules/gui.git] / src / PVServerService / ENGINE / PVSERVER.py
index 52b9d040bbfe697a7075e79ecefde1f39a505673..6ec683846619e4dfe0e38adc9c20ae7d04663d0c 100644 (file)
@@ -20,7 +20,8 @@
 #
 
 import PVSERVER_ORB__POA
 #
 
 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,
 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._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)
         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
         ##
         
         ## 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.
 
     """ 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()
     def destroy(self):
         # TODO
         self.StopPVServer()
+
   
\ No newline at end of file
   
\ No newline at end of file