[omniORB] Retrieving the ObjectId from an Object Reference

Silvia Andreia Rocha silvia.rocha at SE.EFACEC.PT
Wed Jun 11 12:02:10 BST 2003


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.
I'm not sure but perhaps the get_interface () can do this for me.

>=>This brings out another issue: is it possible for an object to get and
use
>=>another objects POA? If true how can this be done?
>
>   In general, no. On the server side, a servant can't even get
>its own POA unless you implement _default_POA() (or always use
>the RootPOA.)
I always use the RootPOA to create nem POA instances for a given CORBA
Server,
this is done because I need to specify some policies and change the default
value of other policies
that already come with the RootPOA.

I asked this because of the restrictions imposed by the CORBAv2.6
specification,
it explicitly says that the POA used to invoke something like
reference_to_id() or servant_to_id()
must be the same as used to create the IOR.

Thanks once more for the tip,
Sílvia



More information about the omniORB-list mailing list