1 // using namespace std;
2 //=============================================================================
3 // File : TestMPILifeCycleCORBA.cxx
4 // Created : mer jui 4 13:11:27 CEST 2003
5 // Author : Bernard SECHER, 2003
7 // Copyright : CEA 2003
9 //=============================================================================
11 #include "utilities.h"
15 #include <SALOMEconfig.h>
16 #include CORBA_CLIENT_HEADER(SALOME_MPIContainer)
17 #include CORBA_CLIENT_HEADER(SALOME_TestMPIComponent)
19 # include "Utils_ORB_INIT.hxx"
20 # include "Utils_SINGLETON.hxx"
21 #include "SALOME_NamingService.hxx"
22 #include "SALOME_MPILifeCycleCORBA.hxx"
25 int main (int argc, char * argv[])
29 // Initializing omniORB
30 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
32 // Obtain a reference to the root POA
33 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA") ;
34 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj) ;
36 // Use Name Service to find container
37 SALOME_NamingService NS(orb);
39 SALOME_MPILifeCycleCORBA LCC(&NS);
41 Engines::Component_var comp = LCC.FindOrLoad_MPIComponent("MPIFactoryServer","TestMPIComponent",2);
43 Engines::TestMPIComponent_var m1 = Engines::TestMPIComponent::_narrow(comp);
44 if(CORBA::is_nil(m1)){
45 INFOS("echec recuperation poignee composant");
49 INFOS("Lancement de coucou");
55 catch(CORBA::COMM_FAILURE& ex) {
56 INFOS("Caught system exception COMM_FAILURE -- unable to contact the object.");
58 catch(CORBA::SystemException&) {
59 INFOS("Caught a CORBA::SystemException.");
61 catch(CORBA::Exception&) {
62 INFOS("Caught CORBA::Exception.");
65 INFOS("Caught unknown exception.");