[omniORB] How to create a reference to a "well-known" object?

Duncan Grisby dgrisby@uk.research.att.com
Mon, 10 Jul 2000 10:45:41 +0100


On Sunday 9 July, "Chris Newbold" wrote:

> I'm now in the process of upgrading to omniORB 3 and was pleased to
> see that the POA provides a portable way to create an object key and
> to activate an object using that key.
> 
> However, I haven't found any corresponding tools for the client side
> which I could use to construct a reference or IOR from scratch. The
> genior tool seems to have gone away, too. Creating a reference from
> scratch must be different now, since the name or id of the POA must
> be encoded...

genior does still exist, and works exactly the way it used to. When
you create an object in a POA with the PERSISTENT policy, the object
key will always be the same, as long as you use the same POA names and
object id. As you say, the object key contains the POA names and other
things, but you can easily find out what they are by using catior the
first time you create your reference.

That said, there is a better way of doing what you want, which is to
use the interoperable naming service support. omniORB provides a
special POA, named "omniINSPOA", which you can find with
resolve_initial_references(). That POA doesn't put anything other than
the object id into the object key, so you don't have to worry about
POA names etc.

The other nice thing about using INS is that you can specify the
reference to your object with a string like
"corbaloc::my.host.name:1234/MyObjectKey".  This will work with any
INS compliant ORB.

Cheers,

Duncan.

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --