Annuaire

Commande de compilation

Commande d'enregistrement des objets Corba

${MICO_HOME}/bin/ird -ORBIIOPAddr inet:localhost:8888 --db ${MICO_HOME}/db/db-ird
${MICO_HOME}/bin/micod -ORBIIOPAddr inet:localhost:9999 --db ${MICO_HOME}/db/db-micod.txt --forward
upsvtm Corba=Charger

Commande d'exécution

${MICO_HOME}/bin/ird -ORBIIOPAddr inet:localhost:8888 --db ${MICO_HOME}/db/db-ird
${MICO_HOME}/bin/micod -ORBIIOPAddr inet:localhost:9999 --db ${MICO_HOME}/db/db-micod.txt --forward
annuaire -ORBIfaceRepoAddr inet:localhost:8888 -ORBImplRepoAddr inet:localhost:9999 -ORBBindAddr local:

Fichier source

#include <CORBA.h>
#include <mico/string.h>
#include <upskrn.hh>
#include <upscrbexception.h>

using namespace std;

static CORBA::ORB *pOrb;
static CORBA::BOA *pBoa;
static CORBA::Object *pObjet;
static IUpsKrn *pIUpsKrn;
static IUpsOrb *pIUpsOrb;
static IUpsOrbAnnuaire *A;

/****************************************************************/
static void AfficherAnnuaire2(IUpsOrbAnnuaire *An, IUpsKrnCaractere *Chemin)
/****************************************************************/
{
IUpsKrnListe_var L;
IUpsKrnCaractere_var C;

try catch (UpsCrbException *E) catch (CORBA::Exception &e) }

/****************************************************************/
static void AfficherAnnuaire(IUpsOrbAnnuaire *An)
/****************************************************************/
{
try catch (UpsCrbException *E) catch (CORBA::Exception &e) }

/****************************************************************/
int main(int argc, char *argv[])
/****************************************************************/
{
IUpsKrnListe_var L;
IUpsKrnCaractere_var C;

pOrb=CORBA::ORB_init(argc,argv, "mico-local-orb");
if (!pOrb) pBoa=pOrb->BOA_init(argc, argv, "mico-local-boa");
if (!pBoa) pObjet=pOrb->bind("IDL:IUpsKrn:1.0");
if (!pObjet) pIUpsKrn=IUpsKrn::_narrow(pObjet);
if (!pIUpsKrn) pObjet=pOrb->bind("IDL:IUpsOrb:1.0");
if (!pObjet) pIUpsOrb=IUpsOrb::_narrow(pObjet);
if (!pIUpsOrb)
try catch (UpsCrbException *E) catch (CORBA::Exception &e)
A=NULL;
L=NULL;
C=NULL;
CORBA::release(pIUpsOrb);
pIUpsOrb=NULL;
CORBA::release(pIUpsKrn);
pIUpsKrn=NULL;
delete pBoa;
delete pOrb;
return(0);
}