How to identify a local object?

How to identify a local object?

Post by Michael Bi » Thu, 17 Jul 2003 06:23:13



Hi,

I'm writing an application that supports browsing the cos services.
The starting point into the actual browser is a call to
ORB.list_initial_services().  This returns a list of the services that
are registered/configured with the ORB.

The problem is that this list includes also references to local
objects -- objects that implement the org.omg.CORBA.Object interface,
but are valid only in the local address space.  Currently all the
objects in the list are used polymorphically -- checking for an IOR to
display, checking for certain types to see whether a plugin for such a
type exists.

This results in CORBA_MARSHAL errors when trying to access those
objects, e.g. when trying to get an IOR.  When calling _is_a on such
an object NO_IMPLEMENT is returned.

The question is if there is a defined way -- one that should work on
all CORBA implementations -- to find out whether a CORBA.Object is a
local object, or if the information above is all I get?

By the way -- have a look at http://sourceforge.net/projects/lichen/
goto Files and download the newest version of the explorer.  And note
that the display of local references is currently not possible ;^)
But browsing the NameService is cool.

Thanks,
Michael.

 
 
 

How to identify a local object?

Post by Jonathan Bigga » Fri, 18 Jul 2003 10:14:05



> The question is if there is a defined way -- one that should work on
> all CORBA implementations -- to find out whether a CORBA.Object is a
> local object, or if the information above is all I get?

I think you've identified the best portable way.  Call
ORB::object_to_string() and catch any MARSHAL exception raised.

--
Jon Biggar
Floorboard Software



 
 
 

How to identify a local object?

Post by Jonathan Bigga » Fri, 18 Jul 2003 10:22:35


 > The question is if there is a defined way -- one that should work on
 > all CORBA implementations -- to find out whether a CORBA.Object is a
 > local object, or if the information above is all I get?

I think you've identified the best portable way.  Call
ORB::object_to_string() and catch any MARSHAL exception raised.

--
Jon Biggar
Floorboard Software


 
 
 

How to identify a local object?

Post by Jonathan Bigga » Fri, 18 Jul 2003 17:36:03



> The question is if there is a defined way -- one that should work on
> all CORBA implementations -- to find out whether a CORBA.Object is a
> local object, or if the information above is all I get?

I think you've identified the best portable way.  Call
ORB::object_to_string() and catch any MARSHAL exception raised.

--
Jon Biggar
Floorboard Software