[omniORB] late servant construction

Duncan Grisby dgrisby@uk.research.att.com
Fri, 04 May 2001 17:09:12 +0100


On Friday 4 May, "Renzo Tomaselli" wrote:

> Now I know I will have to use a ServantLocator for 3.x instead of the
> proprietary hook and that's fine.
> Then is that true I can generate the objref in a portable way by creating a
> Corbaloc string and then converting it to an obj ref? (I know there is a
> small further price to pay because the missing type info will force an is_a
> call). Any missing tip, trick, etc. ?

You almost certainly don't want to use corbaloc to generate references
to your objects. Although you could cook up a corbaloc URI by figuring
out the key format that omniORB uses, it would be rather fragile. As
you say, you also lose the type info.

The best thing to do is to use the POA itself to create the
references. poa->create_reference_with_id() creates an object
reference in the POA without an associated active servant. If you use
a POA with the PERSISTENT policy, and pin down the port number with
-ORBpoa_iiop_port, the object references will remain valid between
separate runs of your program too.

Cheers,

Duncan.

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