[omniORB] Registering an Object with more than one Name
Service???
Michael J. Donahue
mdonahue@McLeodUSA.com
Wed, 18 Oct 2000 11:48:48 -0500
Thanks to everyone who replied!
I ended up changing my code to call resolve_initial_references() and
object_to_string() to get the first Name Services IOR. Then creating my object,
activating it, calling resolve_initial_references() for the second Name Service
and binding the object with the second Name Service. Lastly, I used the IOR for
the first Name Service and bound the object to the first Name Service.
My ultimate goal is to have a Federated Name Service, but omniORB does not
appear to support this, and nobody has ever given me any good answers when I
have asked about Federating omniORB.
Thanks again,
- Mike
"McConnell, Edmund" <edmundm@ipo.att.com> on 10/18/2000 07:47:38 AM
To: "Hochberg,Glenn A, ALCOO" <ghochberg@att.com>, omnilist
<omniorb-list@uk.research.att.com>
cc: (bcc: Michael J. Donahue/MCLEOD)
Subject: RE: [omniORB] Registering an Object with more than one Name Servi
ce???
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 |
>