CORBA factory stuff



 thought till just a few hours ago that implementing a factory
with the GNOME (and most of all the goad) was straightforward.
however, i discovered it is not.
let me explain myself: 
when you build a .gnorba file for a factory : two tings happen 
if you try to activate the prgm you wanted:
first, goad_server_activate_exe is called on the factory and then, 
the creat_object method of the factory is called.
however, to create the factory, the goad uses some trick (which eliot
says is made to make things faster): it waits on stdout for the factory
to output its ior string instead of pooling the name server to get the
registered factory.
This means two things: 
1) we must fork to make the factory to display something because the 
folowing code will not display anything (thanks to gtk_main loop)
  fprintf (stdout, "%s\n", CORBA_ORB_object_to_string (orb, obj, &ev));

  CORBA_exception_free (&ev);
  gtk_main ();
so, the idea is to fork the factory: the main branch outputs stuff and 
dies while the other enters in the gtk_main loop.

2) doing some forking in gtk is NOT easy (tell me if i m wrong)
it requires lots of work with lots of lines of code i don't understand
and i am not willing to understand.

The main pb with all this is that it means that you MUST do the same
if you decide to implement your own factory by hand and want it to 
be activated like any other factory by applications. ie: the goad_activate_exe
function will not suceed if you don't output stuff on stdout and if you don't
fork and output, your factory simply won't be running when you will be using it.

if i said something wrong, tell me so, please.

If i am right, please why can't we use a simple activation mechanism ?
like polling the name server instead of using ior strings.
this would make my life sooo easier to create hand-made factories...

I feel also that this strange trick used has something to do with distant objects
because the output is not really sent to stdout: it is sent into some pipe
which i feel may be used to connect two distant machines. i don't really understand 
this anyway.

So, does anyone know of a simple way to do all this ?
i want my hand made factory working wit hthe goad but i don't want all the 
bloated stuff.

any ideas, flames are welcome.

Mathieu

-- 
Mathieu Lacage 
Snailmail: ch 224, 212 Rue de Tolbiac 75013 Paris
email: lacage@email.enst.fr
url: http://www.stud.enst.fr/~lacage



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]