[omniORB] Retrieving the ObjectId from an Object Reference

Gary Duzan gduzan at bbn.com
Wed Jun 11 09:54:40 BST 2003


In Message <934536459C1DF0408EA45C61B7A01EED094B40 at SENT5> ,
   Silvia Andreia Rocha <silvia.rocha at SE.EFACEC.PT> wrote:

=>Hello,
=>Thanks for the reply.
=>
=>>=>Does anyone know how an application can obtain the ObjectId associated
=>with
=>>=>an IOR?
=>>=>
=>>=>I've taken a look at "reference_to_id" but it says that it  will only
=>work if
=>>=>the POA used to create the IOR is also used to invoke the
=>"reference_to_id".
=>>
=>>   Do you want to do this in general or only on the server side?
=>>In general you can't, because the POA interface is "local", but you can
=>>use reference_to_id() or servant_to_id() on the server.
=>In fact I need to do this in general, from a given IOR any CORBA Object
=>(mine are all
=>clients and servers at the same time) must retrieve the ObjectID associated
=>with it.

   Sorry, I should have been more clear. This will only work on
the server side for the particular object. Accessing the object
id from clients breaks the transparency of object references and
is outside the CORBA object model.

   Perhaps if you gave us an idea of you are using the object id
we could suggest alternative designs which would work.

=>I'm not sure but perhaps the get_interface () can do this for me.

   No, this only gives you access to the TypeCode of the object
in the Interface Repository, if you've set one up. It won't tell
you anything about the object's identity.

					Gary Duzan
					BBN Technologies
					A Verizon Company





More information about the omniORB-list mailing list