[omniORB] Registering an Object with more than one Name Servi ce???

McConnell, Edmund edmundm@ipo.att.com
Wed, 18 Oct 2000 05:47:38 -0700


why not put the two naming services in a federated name service?

for example:
	1. save the stringified IOR of NameService1.
	2. save the stringified IOR of NameService2.
	3. create a new naming context (NC) and save it's stringified IOR.
	4. create a new context binding in NC called "nameservice1" and bind
it to the IOR saved in (1).
	5. create a new context binding in NC called "nameservice2" and bind
it to the IOR saved in (2).
	6. configure your ORB so
orb.resolve_initial_references("NameService") returns NC.
	    (hint: use ORBInitRef NameService=<IOR:saved in (3)> if using
omniORB.)

then your code can do the following (pseudo-code):

my_object = ...
ns = orb.resolve_initial_references("NameService");  // returns NC
ns1 = ns.resolve("nameservice1");
ns2 = ns.resolve("nameservice2");
ns1.bind("name1",my_object);
ns2.bind("name2",my_object);

> "Michael J. Donahue" wrote:
> 
> > How can I register an Object with more that one CORBA Name 
> Service?  I tried
> > creating two instances of the ORB and two instances of the 
> BOA each created with
> > a fake set of command line arguments that pointed to two 
> different omniORB Name
> > Services and then calling obj_is_ready() for each BOA with 
> the same pointer to
> > the Objects Implementation.  The second call to 
> obj_is_ready() on the respective
> > second instance of BOA generated a CORBA::INV_OBJREF 
> exception.  Is there some
> > way I can duplicate the handle to the Object so that it 
> won't get this error,
> > yet it will still bind the same Object to both Name Services.
> >
> > - Mike
> 
> --
> Glenn A. Hochberg  | "Any activity becomes creative when the doer
> AT&T Labs          |  cares about doing it right, or doing it better."
> ghochberg@att.com  |      -John Updike
> (973) 236-6638     |
>