]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Implementation of Engines_Component_i::isSSLMode
authorAnthony Geay <anthony.geay@edf.fr>
Fri, 11 Jun 2021 06:31:31 +0000 (08:31 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Fri, 11 Jun 2021 06:31:31 +0000 (08:31 +0200)
idl/SALOME_Component.idl
src/Container/Component_i.cxx
src/Container/SALOME_Component_i.hxx
src/Container/SALOME_Container_i.hxx

index 89b97011b1c3e9b1c36131a62e8d6d2b8ced08e7..47d5f7c167008fcab78d0c82a2423b59135429c5 100644 (file)
@@ -264,6 +264,7 @@ module Engines
     //!  Determines whether the server has already been loaded or not.
     void ping();
 
+    boolean isSSLMode() raises(SALOME::SALOME_Exception);
     //! Remove component instance from container
     /*!
       Deactivates the %Component.
index 84c1251302a537220fe5e8b3488fbd51e397d80a..892698e55fa0584dec9844fa5d6e517ca91c9b4f 100644 (file)
@@ -34,6 +34,7 @@
 #include "Utils_SINGLETON.hxx"
 #include "Utils_ORB_INIT.hxx"
 #include "SALOME_NamingService.hxx"
+#include "Utils_CorbaException.hxx"
 
 #include <cstdio>
 #ifndef WIN32
@@ -176,6 +177,20 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb,
 
 }
 
+CORBA::Boolean Engines_Component_i::isSSLMode()
+{
+  PortableServer::ServantBase *serv(_poa->reference_to_servant(_container));
+  if(!serv)
+    THROW_SALOME_CORBA_EXCEPTION("_container and component are not managed by the same POA ! Looks bad !", SALOME::INTERNAL_ERROR);
+  Abstract_Engines_Container_i *elt=dynamic_cast<Abstract_Engines_Container_i *>(serv);
+  if(!elt)
+    THROW_SALOME_CORBA_EXCEPTION("_container servant object if not a Abstract_Engines_Container_i ! It smells bad !", SALOME::INTERNAL_ERROR);
+  SALOME_NamingService_Container_Abstract *ns(elt->getNS());
+  if(!ns)
+    THROW_SALOME_CORBA_EXCEPTION("_container servant object points to a nullptr NS ! It smells bad !", SALOME::INTERNAL_ERROR);
+  return elt->isSSLMode() && (!dynamic_cast<SALOME_NamingService *>(ns));
+}
+
 SALOME_NamingService_Abstract *Engines_Component_i::getNS()
 {
   ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
index beac21100e2fbf65c95439d1bf41d17513dbe1de..befe0112d1fc73f27a056c313930f95419f608a3 100644 (file)
@@ -71,6 +71,8 @@ public:
                       const char *interfaceName,
                       bool notif = false,
                       bool regist = true);
+                      
+  CORBA::Boolean isSSLMode() override;
 
   virtual ~Engines_Component_i();
 
index 93ea6a67544dc0289fe719aaa4dd5faca2375b22..4dc832eab50bf8ac8b1c63aa7cea8d779bab7f70 100644 (file)
@@ -90,6 +90,8 @@ public:
 
   Engines::EmbeddedNamingService_ptr get_embedded_NS_if_ssl() override;
 
+  SALOME_NamingService_Container_Abstract *getNS() const { return _NS; }
+
   void remove_impl(Engines::EngineComponent_ptr component_i);
   void finalize_removal();