Salome HOME
Move MEDCALC tests into SSL mode
[modules/med.git] / src / MEDCalc / cmp / MED_Session.cxx
index 5437eba5e0841f62f6809ff4ca5e271b69ecaa87..4737370659c0b516b5e45ee33f60f6ecf7ee050c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2015-2021  CEA/DEN, EDF R&D
+// Copyright (C) 2015-2022  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -44,6 +44,8 @@ SALOMEDS::Study_var MED_Session::getStudyServant()
   return aStudy;
 }
 
+#include "MED_No_Session.hxx"
+
 extern "C"
 {
   /*!
@@ -61,7 +63,17 @@ extern "C"
                                               const char* instanceName,
                                               const char* interfaceName)
   {
-    MED* component = new MED_Session(orb, poa, contId, instanceName, interfaceName);
-    return component->getId();
+    CORBA::Object_var o = poa->id_to_reference(*contId);
+               Engines::Container_var cont = Engines::Container::_narrow(o);
+               if(cont->is_SSL_mode())
+               {
+      MED_No_Session* component = new MED_No_Session(orb, poa, contId, instanceName, interfaceName);
+      return component->getId();
+    }
+    else
+    {
+      MED* component = new MED_Session(orb, poa, contId, instanceName, interfaceName);
+      return component->getId();
+    }
   }
 }