Salome HOME
Updated copyright comment
[modules/homard.git] / src / HOMARD_I / HOMARD_Gen_i_Session.cxx
index 96c4a3799715f6c89cf34c3361c35a2f907d7f5f..0275923cbbf61c96b0fd67c8d5a7b98b5ba145e4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2021  CEA/DEN, EDF R&D
+// Copyright (C) 2021-2024  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -46,6 +46,7 @@ SMESH::SMESH_Gen_var HOMARD_Gen_i_Session::retrieveSMESHInst() const
 }
 
 //=============================================================================
+#include "HOMARD_Gen_i_No_Session.hxx"
 extern "C"
 {
   HOMARDENGINE_EXPORT
@@ -56,7 +57,17 @@ extern "C"
                                                  const char* interfaceName)
   {
     MESSAGE("PortableServer::ObjectId* HOMARDEngine_factory()");
-    HOMARD_Gen_i_Session* myHOMARD_Gen = new HOMARD_Gen_i_Session(orb, poa, contId, instanceName, interfaceName);
-    return myHOMARD_Gen->getId();
+    CORBA::Object_var o = poa->id_to_reference(*contId);
+    Engines::Container_var cont = Engines::Container::_narrow(o);
+    if(cont->is_SSL_mode())
+    {
+      HOMARD_Gen_i_No_Session* myHOMARD_Gen = new HOMARD_Gen_i_No_Session(orb, poa, contId, instanceName, interfaceName);
+      return myHOMARD_Gen->getId();
+    }
+    else
+    {
+      HOMARD_Gen_i_Session* myHOMARD_Gen = new HOMARD_Gen_i_Session(orb, poa, contId, instanceName, interfaceName);
+      return myHOMARD_Gen->getId();
+    }
   }
 }