Tache

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
tache -ORBIfaceRepoAddr inet:localhost:8888 -ORBImplRepoAddr inet:localhost:9999 -ORBBindAddr local:

Fichier source

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

using namespace std;

static const CORBA::UShort CO_SynchronisationPrivee=1;
static const CORBA::UShort CO_SynchronisationProtegee=2;
static const CORBA::UShort CO_SynchronisationPublique=3;
static const CORBA::UShort CO_SynchronisationLecturePartagee=1;
static const CORBA::UShort CO_SynchronisationLectureExclusive=2;
static const CORBA::UShort CO_SynchronisationEcriturePartagee=3;
static const CORBA::UShort CO_SynchronisationEcritureExclusive=4;

static CORBA::ORB *pOrb;
static CORBA::BOA *pBoa;
static CORBA::Object *pObjet;
static IUpsKrn *pIUpsKrn;
static IUpsSys *pIUpsSys;
static IUpsSysSynchronisation *S;
static IUpsSysTache_var T1;
static IUpsKrnCaractere_var C;

/****************************************************************/
static CORBA::Long PrincipalT1(IUpsSysTache *T)
/****************************************************************/
{
try catch (UpsCrbException *E) catch (CORBA::Exception &e) return(0);
}

/****************************************************************/
int main(int argc, char *argv[])
/****************************************************************/
{
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:IUpsSys:1.0");
if (!pObjet) pIUpsSys=IUpsSys::_narrow(pObjet);
if (!pIUpsSys)
try catch (UpsCrbException *E) catch (CORBA::Exception &e)
CORBA::release(pIUpsSys);
pIUpsSys=NULL;
CORBA::release(pIUpsKrn);
pIUpsKrn=NULL;
delete pBoa;
delete pOrb;
return(0);
}