From da30f087c7dde6554311b62ff7a5626a57558478 Mon Sep 17 00:00:00 2001 From: nri Date: Wed, 16 Jul 2003 10:00:25 +0000 Subject: [PATCH] NRI : Merge from V1_2. --- src/Loader/SALOME_Session_Loader.cxx | 90 ++++++++++++++-------------- 1 file changed, 46 insertions(+), 44 deletions(-) diff --git a/src/Loader/SALOME_Session_Loader.cxx b/src/Loader/SALOME_Session_Loader.cxx index 825fd0457..acd0ea377 100644 --- a/src/Loader/SALOME_Session_Loader.cxx +++ b/src/Loader/SALOME_Session_Loader.cxx @@ -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_::Instance() ; - ASSERT(SINGLETON_::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_::Instance() ; + ASSERT(SINGLETON_::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 ; + } } -- 2.39.2