Corba question



I am writing a library that has a simple function like:
add_url(char *url);
 
The function will hand the url to a corba server via an exported method on
the server.
 
Ok, heres the question(s).
I want the end programmer have to do as little as posible to use it. If it
would be posible to just use the function call buy itself, it would be a
good thing. But, that would require it to call CORBA_init. Is it acceptable
to call CORBA_init more then once in a program? If it is, what happens if
you take string_to_object(whatever) from an orb created by one CORBA_init
and pass the object to a function that has an orb created by another
CORBA_init. What would happen if I destroyed the first orb, but left the
object running. Could I still use the object? Does this whole situation need
a global orb? Ugg... :)
 
Also what happens if I call this function within a gnome program? Do I have
to write a special version to make use of the gnome_CORBA stuff?
 
A quick description of the function would be like this: (psudo coded. minus
the error correction...)
Is this valid?
 
void add_url(char *url){
  CORBA_ORB orb;
  CORBA_Environment ev;
  TM_TMD server;
  char *ior;
  ior=get_ior_from_file("~/.tm/tmd.ior");
  orb=CORBA_ORB_init(   bla bla bla... tricks to make it work... bla bla
bla...   );
  server=CORBA_ORB_string_to_object(orb, ior, &ev);
  TM_TMD_add(server, url, &ev);
  CORBA_Object_release(server);
  CORBA_Object_release((CORBA_Object)orb, &ev);
  CORBA_exception_free(&ev);
}



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