[omniORB] problems registering omniNames

Duncan Grisby duncan at grisby.org
Thu Jan 25 09:54:51 GMT 2007


On Sunday 14 January, "=?ISO-8859-1?Q?Jos=E9_Felix?=" wrote:

> In this application, we have a remote server, one of then running in
> the entire network,  and local instances running in every machine.
> Each of these instances binds to the CORBA environment a name. Each
> machine is supposed to have an interface where it is possible to
> control the local or the remote machines. If one wants to control the
> local machine, the CORBA interface ( or a program that uses omniORB
> api or similar stuff ) should ( in an ideal situation ) take the
> object whose name we tried to get from the local machine, and use a
> "local omninames" , that is the instance of omninames whose objects
> are from the local machine. If one wants to access objects located in
> a remote machine, the library should recognize this name and retrieve
> the object published in the "remote omninames", running in the remote
> server.

That all makes sense.

> So, when the local application starts, it has to publish the CORBA
> interface in two different environments: a local one ( where is
> supposed to be an "local omninames" ) and a remote one (where is
> supposed to exist an "remote omninames", or a instance of omninames
> that contains the objects published to be accessed from remote
> machines)

I don't understand this bit. Why should the local application register
itself in the remote omniNames?

> Had I make myself clear about how this system works? I hope so.
> 
> The great difficulty I found is : how to develop a program whith
> omniORB that takes a name from the "user", recognize it as a local or
> remote name, and retrieve the object whose name is associated to, if
> we have two servers (a local and a remote) ? How to switch between
> servers this way?

Well, you must know the logic to tell if a server is local or remote.
Once you have decided, you just contact the local or remote omniNames.
I don't understand what the difficulty is, I'm afraid.

First of all, remember that you don't have to register your objects in
omniNames. It's only required if you need to look them up by name. If
you're passing them around in method calls, there's generally no need to
register them by name.

Second, perhaps you just want to put references to two naming services
in the configuration?  You can do something like this in omniORB.cfg:

  InitRef = LocalNameService=corbaname::localhost
  InitRef = RemoteNameService=corbaname::some.remote.machine

Then you can use resolve_initial_refereces to get either one as
appropriate.

Does that help?

Cheers,

Duncan.

-- 
 -- Duncan Grisby         --
  -- duncan at grisby.org     --
   -- http://www.grisby.org --



More information about the omniORB-list mailing list