An initial reference is a well-known object reference associated with an identifier. CORBA provides mechanisms to configure, register, list, and get (or resolve) initial references. Obtaining an initial reference of the Naming Service also is called "bootstrapping".
A reference can refer to a local object or to a remote object.
Initial references can be obtained from the Object Request Broker (ORB) by calling ORB::resolve_initial_references(). Initial object references returned by this call are of the CORBA::Object class and generally must be narrowed to an appropriate interface to be useful.
For example:
CORBA::Object * objPtr; objPtr = op->resolve_initial_references( "NameService" ); CosNaming::NamingContext * rootNameContext; rootNameContext = ::CosNaming::NamingContext::_narrow(objPtr);
A list of the initial references that are available from the ORB can be obtained by calling ORB::list_initial_references().
There are several ways an identifier and an initial reference are known to the ORB:
Resolution of initial references occurs when ORB::resolve_initial_references() is invoked. The ORB follows an ordered search for the reference:
Note: This argument might be a corbaloc URL string that specifies multiple host port pairs. Resolution is attempted with each host port pair in order of their specification. This operation follows CORBA's Interoperable Naming Specification (INS).
The C++ ORB supports CORBA's Interoperable Naming Specification (INS) and a different method that is an IBM extension. For backward compatibility, the ORB tries the latter if the INS mode does not succeed.
If an initial reference cannot be obtained using the framework described previously, there are alternatives for obtaining a reference. For more information, see the topic, "Strategies for retrieving the IOR of a remote object".