Salome HOME
Merge remote-tracking branch 'origin/master'
[modules/gui.git] / src / Session / Session_ServerLauncher.cxx
index 39c9c5ef6752a1f3c553ef45e048cbf4fc6f8396..4cfe26c20dedde0fe67b61c1913f79288052c724 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -111,8 +111,8 @@ void Session_ServerLauncher::CheckArgs()
   _argCopy.reserve(_argc);
   for (int iarg=0; iarg <_argc; iarg++)
     {
-      SCRUTE(iarg);
-      SCRUTE(_argv[iarg]);
+      //SCRUTE(iarg);
+      //SCRUTE(_argv[iarg]);
       _argCopy.push_back(_argv[iarg]);
       switch (argState)
         {
@@ -124,16 +124,16 @@ void Session_ServerLauncher::CheckArgs()
           }
         case 1: // looking for server type
           {
-           // Temporary solution
-           // Issue 21337 - no more SalomeApp_Engine_i activation here
-           // TODO: To be removed as soon as any trace of SalomeAppEngine
-           // has been eliminated from KERNEL scripts
-           if (strcmp(_argv[iarg], "SalomeAppEngine")==0){
-             argState = 0;
-             iarg += 2; // skipping "()" 
-             break;
-           }
-           // Temporary solution
+            // Temporary solution
+            // Issue 21337 - no more SalomeApp_Engine_i activation here
+            // TODO: To be removed as soon as any trace of SalomeAppEngine
+            // has been eliminated from KERNEL scripts
+            if (strcmp(_argv[iarg], "SalomeAppEngine")==0){
+              argState = 0;
+              iarg += 2; // skipping "()" 
+              break;
+            }
+            // Temporary solution
 
             for (int i=0; i<Session_ServerThread::NB_SRV_TYP; i++)
                 if (strcmp(_argv[iarg],Session_ServerThread::_serverTypes[i])==0)
@@ -230,6 +230,16 @@ void Session_ServerLauncher::ActivateAll()
   delete[] argv;
 }
 
+void Session_ServerLauncher::ShutdownAll()
+{
+  MESSAGE("Session_ServerLauncher::ShutdownAll()");
+  std::list<Session_ServerThread*>::reverse_iterator itServ;
+  for (itServ = _serverThreads.rbegin(); itServ !=_serverThreads.rend(); itServ++)
+  {
+    (*itServ)->Shutdown();
+  }
+}
+
 /*! 
   Destruction des classes serveur dans l'ordre inverse de creation
 */