Salome HOME
updated copyright message
[modules/kernel.git] / src / Container / SALOME_Container_Common.cxx
index b768a328d3efbafd5b6e5252466ded1d46aa7c21..ba5628b9222f48d82d9b6e61a680f1c166b2b73b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 #else
 #include <process.h>
 #endif
+#include "ArgvKeeper.hxx"
 #include "SALOME_Container_Common.hxx"
 #include "SALOME_Container_i.hxx"
 #include "utilities.h"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
 #include "OpUtil.hxx"
 #include "KernelBasis.hxx"
 
@@ -128,6 +127,7 @@ void unexpectedHandler(void)
   AttachDebugger();
 }
 
+template<class ContainerServant>
 int container_common_main(int argc, char* argv[], std::unique_ptr<SALOME_NamingService_Container_Abstract> ns)
 {
   setSSLMode(ns?!ns->IsTrueNS():false);
@@ -150,9 +150,8 @@ int container_common_main(int argc, char* argv[], std::unique_ptr<SALOME_NamingS
   // Initialise the ORB.
   //SRN: BugID: IPAL9541, it's necessary to set a size of one message to be at least 100Mb
   //CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ;
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  CORBA::ORB_ptr orb = init(argc , argv ) ;
+  SetArgcArgv(argc, argv);
+  CORBA::ORB_ptr orb = KERNEL::GetRefToORB();
 
   //  LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
   INFOS_COMPILATION;
@@ -184,7 +183,7 @@ int container_common_main(int argc, char* argv[], std::unique_ptr<SALOME_NamingS
       system(aCommand.str().c_str());
 #endif
       
-      new Engines_Container_i(orb, root_poa, containerName , argc , argv, ns.get() );
+      new ContainerServant(orb, root_poa, containerName , argc , argv, ns.get() );
       ns.release();
 
       pman->activate();