GOAD, GNOME Object Activation Directory

Now to the real hairy stuff. As tou might have seen it's really cumbersome to start the server by hand, cut'n'paste the IOR string, assume where in the argument vector the IOR string is passed to the client, and the biggest question: How should i know which server the client requires and how is the IOR string of the server is passed to the client? To overcome these difficulties GOAD is used. This section will explain how to use GOAD, how it works and expand the calculator example to start it's server automatically.

How to Find a Server by it's Name

The main problem is to find a CORBA server, when only a human readable name is known. This is nearly the same problem the Internet has, when you have to find an IP address of a host, given it's hostname and domain name. In the Internet the DNS is used, CORBA uses the CORBA Naming Server. DNS is only working, because it's hierarchical and there was an agreement on some top level servers, having knowledge about the top level level servers of the main domains (.com, .edu, .org, .net and all the country codes). Every DNS server has a configuration file, which is maintained manually and which lists all these top level servers. There's no such thing for CORBA. So the Naming Service is there, implemented by a CORBA server which might be running on your workstation (or which isn't), but you don't know the IOR of this server.

Luckily there's one thing known to all Gnome clients, and that's the X11 display they are running on. And windows in X11 have a mechanism called Properties, which may hold arbitrary data connected to a name. So what we can do is to associate the IOR of the Naming Server with such a property, so that all clients and servers can get the IOR by a simple lookup of this property from the X server. And this is how things actually work.

There's a function called gnome_name_service_get(). If you call this function you'll get back a CORBA_Object which represents a NamingContext. This NamingContext can be used to store objects with a name in the Naming Server, or to retrieve an Object if you know it's name. Because the CORBA name space is also hierarchical, the Gnome objects are stored under GNOME/Servers. This function looks up the Property CORBA_NAME_SERVICE in the root window of your X server. If such a property exists a check is made if the server is actually running. If the server appears to be dead (it crashed) a new server is started and it's IOR is registered with this property. If there is no such property, a new server is started.