Vous êtes sur la page 1sur 2

RsumCorba

Fichierx.idl
orbitidl2skeletonimplx.idl idljfallx.idlouidljfclientx.idl

x.h xcommon.c xstubs.c xskels.c xskelimpl.c


orbit2configlibs/cflags[useservice=name]client/server

yHelper.java yHolder.java x.java xOperations.java xPOA.java _xStub.java crerservant(tendrexPOA.java) crerleserveur crerleclient

complterxskelimpl.c crerleserveur crerleclient

Sansservicedenommage Initialiserl'ORB Serveur Initialiserl'ORB


ORBorb=ORB.init(newString[0],null);

Serveur

CORBA_Environmentenv; CORBA_Exception_init(&env); CORBA_ORBorb=CORBA_init(int*,char**,"orbitlocalorb",&env);

RcupreretactiverlePOAManager
POArootpoa= POAHelper.narrow(orb.resolve_initial_references("RootPOA")); rootpoa.the_POAManager().activate();

RcuprerlePOA
PortableServer_POArootpoa= (PortableServer_POA)CORBA_ORB_resolve_initial_references(orb, "RootPOA",&env); PortableServer_POAManager_activate(PortableServer_POA__get_the _POAManager(rootpoa,&env),&env);

CrerunservantetlerfrencerparlePOA
XXXServantxservant=newXXXServant(); XXXcorbaXXX= XXXHelper.narrow(rootpoa.servant_to_reference(helloServant));

Crerunservant
corbaXXXObject=impl_XXX_XXX__create(rootpoa,&env);

Afficherl'IOR
System.out.println(orb.object_to_string(corbaXXObject));

Afficherl'IOR
char*ior=CORBA_ORB_object_to_string(orb,corbaXXXObject, &env); CORBA_free(ior);

Attendrelesrequtes
orb.run();

Attendrelesrequtes
CORBA_ORB_run(orb,&env); CORBA_Object_release(corbaXXXObject,&env); CORBA_ORB_shutdown(orb,CORBA_FALSE,&env);

Client Initialiserl'ORB
ORBorb=ORB.init(newString[0],null);

Rcuprerl'IORetrfrencerl'objetdistant
org.omg.CORBA.ObjectcorbaObject=orb.string_to_object(IOR);

Invoquerl'objetdistant Client Initialiserl'ORB


CORBA_Environmentenv; CORBA_Exceptioninit(&env); CORBA_ORBorb=CORBA_init(int*,char**,"orbitlocalorb",&env); XXXcorbaXXXObject=XXXHelper.narrow(corbaObject); corbaXXXObject.METHODE(...);

Rcuprerl'IORetrfrencerl'objetdistant
corbaXXXObject=CORBA_ORB_string_to_object(orb,IOR,&env);

Invoquerl'objetdistant
CORBA_char*tmp=XXX(XXXObject,...,&env); CORBA_free(tmp); CORBA_Object_release(CorbaXXXObject,&env); CORBA_ORB_shutdown(orb,CORBA_FALSE,&env); OptionsserveuretclientC/C++:

ORBIIOPIPv4=1(indispensableavecunclientJava)

Avecservicedenommage Initialiserl'ORB Serveur Initialiserl'ORB


ORBorb=ORB.init(newString[0],null);

Serveur

CORBA_Environmentenv; CORBA_Exceptioninit(&env); CORBA_ORBorb=CORBA_init(int*,char**,"orbitlocalorb",&env);

RcupreretactiverlePOAManager
POArootpoa= POAHelper.narrow(orb.resolve_initial_references("RootPOA")); rootpoa.the_POAManager().activate();

RcuprerlePOA
PortableServer_POArootpoa= (PortableServer_POA)CORBA_ORB_resolve_initial_references(orb, "RootPOA",&env); PortableServer_POAManager_activate(PortableServer_POA__get_the _POAManager(rootpoa,&env),&env);

CrerunservantetlerfrencerparlePOA
XXXServantxservant=newXXXServant(); XXXcorbaXXX= XXXHelper.narrow(rootpoa.servant_to_reference(helloServant));

Crerunservant
corbaXXXObject=impl_XXX_XXX__create(rootpoa,&env);

Rcuprerleservicedenommageetcrerunnom
org.omg.CORBA.Object=corbaNamingServiceReference= orb.resolve_initial_references("NameService"); NamingContext corbaNamingServiceObject=NamingContextHelper.narrow(corbaNamin gServiceReference); NameComponentXXXname=newNameComponent("XXX",""); NameComponentXXXPath={XXXname}; corbaNamingServiceObject.rebind(XXXPath,corbaXXXObject);

Rcuprerleservicenommageetenregistrerleservant
CosNaming_NameComponentnamePath[1]={"XXX",""}; CosNaming_Namename={1,1,namePath,CORBA_FALSE}; CosNaming_NamingContextnameServiceObject= CORBA_ORB_resolve_initial_references(orb,"NameService",&env); CosNaming_NamingContext_bind(nameServiceObject,&name, corbaXXXObject,&env);

Attendrelesrequtes
CORBA_ORB_run(orb,&env); CORBA_Object_release(CorbaXXXObject,&env); CORBA_ORB_shutdown(orb,CORBA_FALSE,&env);

Attendrelesrequtes
orb.run();

Client Initialiserl'ORB Client Initialiserl'ORB


CORBA_Environmentenv; CORBA_Exceptioninit(&env); CORBA_ORBorb=CORBA_init(int*,char**,"orbitlocalorb",&env); ORBorb=ORB.init(newString[0],null);

Rcuprerl'IORetrfrencerl'objetdistant
NamingContext corbaNamingServiceObject=NamingContextHelper.narrow(corbaNamin gServiceReference); NameComponentXXXname=newNameComponent("XXX",""); NameComponentXXXPath={XXXname}; XXX corbaXXXObject=XXXHelper.narrow(corbaNamingServiceObject.resol ve(XXXPath));

Rcuprerleservicedenommageetl'objetdistant
corbaXXXObject=CORBA_ORB_string_to_object(orb,IOR,&env);

Invoquerl'objetdistant
CORBA_char*tmp=XXX(XXXObject,...,&env); CORBA_free(tmp); CORBA_Object_release(CorbaXXXObject,&env); CORBA_ORB_shutdown(orb,CORBA_FALSE,&env);

Invoquerl'objetdistant
corbaXXXObject.METHODE(...);

OptionsserveuretclientC/C++:

OptionsserveuretclientJava:

ORBInitRefNameService=XXX ORBInitialPort=port ORBInitialHost=host ORBIIOPIPv4=1(indispensableavecunclientJava)

ORBInitRefNameService=XXX ORBInitialPortport ORBInitialHosthost

IOR: IOR:... corbaloc:iiop:version@host:port/object(exemple:corbaloc:iiop:1.2@localhost:4444/NameService) Servicesdenommage:


orbitnameserver2[ORBIIOPIPSock=port][ORBIIOPIPName=host][ORBIIOPIPv4=1][ORBCorbaloc=1][key=NAME]

tnameservORBInitialPortport orbdORBInitialPortportORBInitialHosthost