<< Prev
 Table of Contents


Expert Users

CORBA integration
 

First, check at gnome.org for doc about Corba / Orbit / Gnorba... won't explain you what's corba...
The Gsfdm server is divised in 2 interfaces : The full descriptions of arguments is on "idl/gsfdm.idl", the interface definition of gsfdm.
"#" functions are defined for compatibility but do nothing

Now just code you may want to use in your application. Here I use gnome and orbit. Use what you want, it's the same skeleton. This is a client connection, same as use in gsfdm when connunicate with a running server.


#include "GSFDM.h"           // gsfdm-corba functions definition

// variable definitions
CORBA_ORB                             orb;
CORBA_Environment             ev;
PortableServer_POA                 root_poa;
PortableServer_POAManager pm;
GSFDM_Url                                gsfdm_url_servant;

// Corba initialization, exeption initialization... the way you like
//.............................
CORBA_exception_init( &ev );
orb = gnome_CORBA_init( PACKAGE, VERSION, &argc, argv, NULL, GNORBA_INIT_SERVER_FUNC, &ev );

// Register the CORBA object : server side
// HERE there no exeption test, You HAVE to do it...
 root_poa = ( PortableServer_POA )CORBA_ORB_resolve_initial_references( orb, "RootPOA", &ev );
 pm = PortableServer_POA__get_the_POAManager( root_poa, &ev );
 PortableServer_POAManager_activate( pm, &ev );

//.............................

// to connect to a corba server, you need the IOC id, you don't usually know it, so a solution - not the only
// one - is to look in server list using goad library
// You could directly use the Corba Cos Register
{    GoadServerList *l = goad_server_list_get();
 
             // here just try to connect to the URL interface...

if( ( gsfdm_url_servant = goad_server_activate_with_id( l, "gsfdm_url"GOAD_ACTIVATE_EXISTING_ONLY, NULL ) ) )
{        // ok, running
//....................................
GSFDM_Url_add_url( gsfdm_url_servant, to_download, &ev );
//....................................


} else {
         // not running 

// ..................................
}

//..................................

  }
  goad_server_list_free( l );
 }

//...............................



Create your own plugin


 << Prev
 Table of Contents