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"
26 int main (int argc, char * argv[])
30 // Initializing omniORB
31 CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
33 // Obtain a reference to the root POA
34 CORBA::Object_var obj = orb->resolve_initial_references("RootPOA") ;
35 PortableServer::POA_var poa = PortableServer::POA::_narrow(obj) ;
37 // Use Name Service to find container
38 SALOME_NamingService NS(orb);
40 SALOME_MPILifeCycleCORBA LCC(&NS);
42 Engines::Component_var comp = LCC.FindOrLoad_MPIComponent("MPIFactoryServer","TestMPIComponent",2);
44 Engines::TestMPIComponent_var m1 = Engines::TestMPIComponent::_narrow(comp);
45 if(CORBA::is_nil(m1)){
46 INFOS("echec recuperation poignee composant");
50 INFOS("Lancement de coucou");
56 catch(CORBA::COMM_FAILURE& ex) {
57 INFOS("Caught system exception COMM_FAILURE -- unable to contact the object.");
59 catch(CORBA::SystemException&) {
60 INFOS("Caught a CORBA::SystemException.");
62 catch(CORBA::Exception&) {
63 INFOS("Caught CORBA::Exception.");
66 INFOS("Caught unknown exception.");