]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Make the helper KERNEL::getNamingService used by Study to retrieve Session SSL ready
authorAnthony GEAY <anthony.geay@edf.fr>
Sun, 21 Feb 2021 21:36:20 +0000 (22:36 +0100)
committerAnthony GEAY <anthony.geay@edf.fr>
Sun, 21 Feb 2021 21:36:20 +0000 (22:36 +0100)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_Application_SL.cxx
src/Session/Session_NS_wrapper.cxx
src/Session/Session_NS_wrapper.hxx
src/Session/Session_ServerLauncher.cxx

index b02c12a7aa15f057466e19f24117e896a74e2876..d5cc4fb4452aa4856d1726df763a1babf3726086 100644 (file)
@@ -176,12 +176,12 @@ namespace
 }
 
 /*!Constructor.*/
-SalomeApp_Application::SalomeApp_Application()
-  : LightApp_Application(),
-    myIsCloseFromExit( false ),
-    myToIgnoreMessages( false )
+SalomeApp_Application::SalomeApp_Application(SALOME_NamingService_Abstract *ns):myIsCloseFromExit( false ),myToIgnoreMessages( false )
 {
-  _ns.reset(new SALOME_NamingService(orb()));
+  if(!ns)
+    _ns.reset(new SALOME_NamingService(orb()));
+  else
+    _ns.reset(ns);
 }
 
 /*!Destructor.
index 165c6fb3b78cbe052950bb0bdc4db3ad4152513e..a29b67c21df1bf1dcfacddd90e8757df438e677e 100644 (file)
@@ -84,7 +84,7 @@ protected:
   enum { LoadStudyId = LightApp_Application::OpenStudyId + 1, NewAndScriptId };
 
 public:
-  SalomeApp_Application();
+  SalomeApp_Application(SALOME_NamingService_Abstract *ns = nullptr);
   virtual ~SalomeApp_Application();
 
   virtual void                        updateObjectBrowser( const bool = true );
index eebf34bdd13e19424b9a5b03e868fc523b765a3b..def6831ad6382d2b0ffc265aceba530288d94ef9 100644 (file)
@@ -21,7 +21,6 @@
 
 #include "SALOME_Fake_NamingService.hxx"
 
-SalomeApp_Application_SL::SalomeApp_Application_SL()
+SalomeApp_Application_SL::SalomeApp_Application_SL():SalomeApp_Application( new SALOME_Fake_NamingService )
 {
-  _ns.reset( new SALOME_Fake_NamingService );
 }
index cbd4b5974df2314b0e3107110881d410eec81739..a5dd110a736e382780082c3c38a70163ea71260c 100644 (file)
@@ -223,6 +223,13 @@ CosNaming::NamingContext_var OldStyleNS::checkTrueNamingServiceIfExpected(int ar
   return _root_context;
 }
 
+#include "SALOME_KernelServices.hxx"
+
+void NewStyleNS::defineDefaultSALOMEKERNELNamingService()
+{
+  KERNEL::assignNamingServiceSL();
+}
+
 Engines_Container_i *NewStyleNS::activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char **argv)
 {
   return KERNEL::getContainerSA();
index 96c929b4e8ce6db1be160feb30cf099406aa17e5..85518aff0af49628146afe0ab4a91f3bcf10c88a 100644 (file)
@@ -38,6 +38,7 @@ public:
   CORBA::Object_ptr Resolve(const char* Path) { return _NS.Resolve(Path); }
   RealNS *getNS() { return &_NS; }
   Engines_Container_i *activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char** argv);
+  static void defineDefaultSALOMEKERNELNamingService() { /* nothing to do by default true NamingService server is considered */ }
   static void activateContainerManager(CORBA::ORB_var orb);
   static void activateSession(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex *GUIMutex, QWaitCondition *GUILauncher, int argc, char ** argv);
   static void activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa);
@@ -60,6 +61,7 @@ public:
   CORBA::Object_ptr Resolve(const char* Path) { return _NS.Resolve(Path); }
   RealNS *getNS() { return &_NS; }
   Engines_Container_i *activateContainer(CORBA::ORB_var orb, PortableServer::POA_var poa, int argc, char** argv);
+  static void defineDefaultSALOMEKERNELNamingService();
   static void activateContainerManager(CORBA::ORB_var orb);
   static void activateSession(CORBA::ORB_var orb, PortableServer::POA_var poa, QMutex *GUIMutex, QWaitCondition *GUILauncher, int argc, char ** argv);
   static void activateSALOMEDS(CORBA::ORB_var orb, PortableServer::POA_var poa);
index 73ed5b1186583e53346036d9d5f566698bbca17c..fd8f638db445e06dbf2d259fcac807053153b306 100644 (file)
@@ -63,7 +63,7 @@ Session_ServerLauncher<MY_NS>::Session_ServerLauncher(int argc,
   _ServerLaunch = ServerLaunch;
   _SessionMutex = SessionMutex;
   _SessionStarted = SessionStarted;
-
+  MY_NS::defineDefaultSALOMEKERNELNamingService();
   // start thread
   start();
 }