10.1.1 Programming Information
The interface to a server is defined in the OMG IDL file. How the OMG IDL file is accessed depends on the type of client being built. Three types of clients are considered: stub based, Dynamic Invocation Interface (DII).
Client applications that use stub-style invocations need the OMG IDL file at build time. The programmer can use the OMG IDL file to generate stubs, and so forth. (For more information, see Creating CORBA Client Applications.) No other access to the Interface Repository is required.
Client applications that use the Dynamic Invocation Interface (DII) need to access the Interface Repository programmatically. The interface to the Interface Repository is defined in this chapter and is discussed in Building Client Applications. The exact steps taken to access the Interface Repository depend on whether the client is seeking information about a specific object, or browsing the Interface Repository to find an interface. To obtain information about a specific object, clients use the CORBA::Object::_get_interface
method to obtain an InterfaceDef object. (Refer to CORBA::Object::_get_interface
for a description of this method.) Using the InterfaceDef object, the client can get complete information about the interface.
Before a DII client can browse the Interface Repository, it needs to obtain the object reference of the Interface Repository to start the search.
DII clients use the Bootstrap object to obtain the object reference. (For a description of this method, see the section Tobj_Bootstrap::register_callback_port.) Once the client has the object reference, it can navigate the Interface Repository, starting at the root.
To obtain a reference to a Interface Repository in the domain to which a client application is associated, the client application can use either of two bootstrapping mechanisms:
- Invoke the
Tobj_Bootstrap::resolve_initial_references
operation with a value of“CORBA::Repository”
. This operation returns a reference to a InterfaceRepository object that is in the domain to which the client application is currently attached. You should use this mechanism if you are using the Oracle Tuxedo client software. For more information, see the section Tobj_Bootstrap::resolve_initial_references. - Invoke the
CORBA::ORB::resolve_initial_references
operation with a value of“CORBA::Repository”
. This operation returns a reference to a InterfaceRepository object that is in the domain to which the client application is currently attached. You should use this mechanism if you are using a third-party client ORB. For more information, see the section CORBA::ORB::resolve_initial_references.
Note:
To use the DII, the OMG IDL file must be stored in the Interface Repository.Parent topic: Structure and Usage