Salome HOME
NRI : Merge from V1_2.
authornri <nri@opencascade.com>
Wed, 16 Jul 2003 10:00:25 +0000 (10:00 +0000)
committernri <nri@opencascade.com>
Wed, 16 Jul 2003 10:00:25 +0000 (10:00 +0000)
src/Loader/SALOME_Session_Loader.cxx

index 825fd045736fdf909596fa038582c4b03037a3c7..acd0ea377065ce13579130ed437deab91193e0e6 100644 (file)
@@ -40,50 +40,52 @@ int main(int argc, char **argv)
   if (myIS.getExitStatus())
     exit(1);
 //VRV: T2.4 - Trace management improvement
-  try
-    {
-      CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
-
-      SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
-      ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
-      NS.init_orb( orb ) ;
-
-      CORBA::Object_var obj = NS.Resolve("/Kernel/Session");
-
-      SALOME::Session_var session = SALOME::Session::_narrow(obj) ;
-      ASSERT(! CORBA::is_nil(session));
-      MESSAGE("SALOME::Session::_narrow(obj)");
-      INFOS("Corba initialisation, Distant server");
-
-      // -------------------------------------------------------------
-
-      session->GetInterface() ;
-
-      // -------------------------------------------------------------
-
-      orb->destroy() ;
-    }
-   catch (ServiceUnreachable&)
-     {
-       INFOS("Caught exception: Naming Service Unreachable");
-     }
-  catch (CORBA::COMM_FAILURE&)
-    {
-      INFOS("Caught CORBA::SystemException CommFailure.");
-    }
-  catch (CORBA::SystemException&)
-    {
-      INFOS("Caught CORBA::SystemException.");
-    }
-  catch (CORBA::Exception&)
-    {
-      INFOS("Caught CORBA::Exception.");
-    }
-  catch (...)
-    {
-      INFOS("Caught unknown exception.");
-    }
-  return 0 ;
+  if (myIS.withGUI()) {
+    try
+      {
+       CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
+       
+       SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
+       ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
+       NS.init_orb( orb ) ;
+       
+       CORBA::Object_var obj = NS.Resolve("/Kernel/Session");
+       
+       SALOME::Session_var session = SALOME::Session::_narrow(obj) ;
+       ASSERT(! CORBA::is_nil(session));
+       MESSAGE("SALOME::Session::_narrow(obj)");
+       INFOS("Corba initialisation, Distant server");
+       
+       // -------------------------------------------------------------
+       
+       session->GetInterface() ;
+
+       // -------------------------------------------------------------
+       
+       orb->destroy() ;
+      }
+    catch (ServiceUnreachable&)
+      {
+       INFOS("Caught exception: Naming Service Unreachable");
+      }
+    catch (CORBA::COMM_FAILURE&)
+      {
+       INFOS("Caught CORBA::SystemException CommFailure.");
+      }
+    catch (CORBA::SystemException&)
+      {
+       INFOS("Caught CORBA::SystemException.");
+      }
+    catch (CORBA::Exception&)
+      {
+       INFOS("Caught CORBA::Exception.");
+      }
+    catch (...)
+      {
+       INFOS("Caught unknown exception.");
+      }
+    return 0 ;
+  }
 }