1 // Copyright (C) 2003 CEA/DEN, EDF R&D
5 // File : SALOME_Session_loader.cxx
6 // Author : Paul RASCLE, EDF
11 /*! \file SALOME_Session_loader.cxx
14 #include <SALOMEconfig.h>
15 #include CORBA_CLIENT_HEADER(SALOME_Session)
16 #include CORBA_CLIENT_HEADER(Logger)
18 #include "Utils_ORB_INIT.hxx"
19 #include "Utils_SINGLETON.hxx"
20 #include "SALOME_NamingService.hxx"
21 #include "utilities.h"
23 //! CORBA client for SALOME Session server : launch GUI
25 * SALOME_Session Loader launches a SALOME GUI on the SALOME session servant process
28 #include <qapplication.h>
29 #include "InquireServersQThread.h"
31 int main(int argc, char **argv)
33 //VRV: T2.4 - Trace management improvement
34 QApplication myQApp(argc, argv) ;
35 InquireServersGUI myIS;
36 myQApp.setMainWidget(&myIS);
37 ASSERT(QObject::connect(&myQApp, SIGNAL(lastWindowClosed()), &myQApp, SLOT(quit()) ) );
41 if (myIS.getExitStatus())
43 //VRV: T2.4 - Trace management improvement
47 CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv) ;
49 SALOME_NamingService &NS = *SINGLETON_<SALOME_NamingService>::Instance() ;
50 ASSERT(SINGLETON_<SALOME_NamingService>::IsAlreadyExisting()) ;
53 CORBA::Object_var obj = NS.Resolve("/Kernel/Session");
55 SALOME::Session_var session = SALOME::Session::_narrow(obj) ;
56 ASSERT(! CORBA::is_nil(session));
57 MESSAGE("SALOME::Session::_narrow(obj)");
58 INFOS("Corba initialisation, Distant server");
60 // -------------------------------------------------------------
62 session->GetInterface() ;
64 // -------------------------------------------------------------
68 catch (ServiceUnreachable&)
70 INFOS("Caught exception: Naming Service Unreachable");
72 catch (CORBA::COMM_FAILURE&)
74 INFOS("Caught CORBA::SystemException CommFailure.");
76 catch (CORBA::SystemException&)
78 INFOS("Caught CORBA::SystemException.");
80 catch (CORBA::Exception&)
82 INFOS("Caught CORBA::Exception.");
86 INFOS("Caught unknown exception.");