ORB::resolve_initial_references

Overview Obtains an object reference to a key service, such as the Naming Service or the Interface Repository.
Original class CORBA::ORB
Exceptions If the input identifier is not valid, a CORBA::ORB::InvalidName exception is thrown.
If another error occurs, a CORBA::SystemException is thrown.


Intended Usage

The CORBA::ORB::resolve_initial_references method is intended to be used by client and server applications to obtain initial object references for accessing key services, such as the Interface Repository, Naming Service or other services registered with the ORB.

The caller specifies the identifier of the service for which a reference is needed, then narrows the return result to the proper type. For example, when the input is "InterfaceRepository", the return result should be narrowed to CORBA::Repository. References to services registered with the orb by the CORBA::ORB::register_initial_reference method can be obtained using their identifier. References of Current interfaces can also be obtained by invoking ORB::resolve_initial_references with their identifier.

When the input identifier is "NameService", the return result is the root name context of the naming tree, and should be narrowed to CosNaming::NamingContext (or some class derived from it). Typically an application uses CORBA::ORB::resolve_initial_references to obtain a reference to the root name context, then invokes operations on that reference to obtain all other object references.

To configure the behavior of resolve_initial_references refer to Initial References and use the ORBInitRef and ORBDefaultInitRef arguments with the CORBA::ORB_init method.

Syntax

  CORBA::Object_ptr resolve_initial_references (const char* identifier);

Input parameters

identifier
The non-NULL identifier of the object reference to be obtained. Valid identifiers are those returned by CORBA::ORB::list_initial_services. The caller retains ownership of this string.

Return values

CORBA::Object_ptr
A reference to the requested services. The caller assumes ownership of the returned object reference, and should subsequently release it using CORBA::release.

Example

  #include "corba.h"
  ...
  /* assume op initialized */
  extern CORBA::ORB_ptr op;
  CORBA::ORB::ObjectIdList *oil = op->list_initial_services();
  /* pass in the first element of oil as identifier to obtain object 
     reference */
  CORBA::Object_ptr optr ;
  optr = op->resolve_initial_references((*oil)[0]);
  /* narrow optr appropriately ... */
  CORBA::release(optr);
  ...

Related reference
CORBA module



Searchable topic ID:   rcor_modo29
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/corba/ref/rcor_modo29.html

Library | Support | Terms of Use | Feedback