3 The test in this directory utilizes the Interface Repository
4 as might be done in an application. This test is also the
5 only one in this suite that makes use of the Interface
6 Repository administration executable 'tao_ifr'.
8 The test must be run by executing the Perl scrip 'run_test.pl'.
9 The order of events is as follows:
11 (1) The Interface Repository service is started.
13 (2) The server proces is started. The server makes
14 available an object reference to an interface
15 called 'inventory', which exists in a namespace
16 called 'warehouse', and contains an operation
17 called 'getCDinfo'. The operation takes an IN
18 argument which is a string representing the
19 artist's name, and INOUT argument which is a
20 string representing the album title, and an OUT
21 argument which is a float representing the price.
22 The operation returns a boolean value indicating
23 whether or not the particular CD is in stock. All
24 this iformation is contained in the IDL file
27 (3) The Interface Repository administration executable
28 'tao_ifr' is executed on test.idl, which adds the
29 information in test.idl to the repository.
31 (4) The client process is started. The client performs
32 the following actions:
34 (a) Locates the Interface Repository by calling
35 resolve_initial_references ("InterfaceRepository"),
38 (b) Gets the IOR of the target object. In a real
39 application, this would probably be done
40 through the Naming Service, but here the
41 IOR is read from the file where it was
44 (c) The client then makes several calls to the
45 repository, first searching for an object
46 with the name 'warehouse'. Once this is
47 found, the client checks to see if 'warehouse'
48 may contain other objects. If so, it gets a
49 list of all the objects 'contained' by
50 warehouse which are interfaces. Each inteface's
51 name is checked to find one called 'inventory'.
52 Then the client gets a list of all inventory's
53 operations. Each of these is checked to find
54 one called 'getCDinfo'. The client then gets
55 the return type and a list of the operation's
56 parameters by querying the operation repository
59 (d) The client creates a DII request pseudo-object,
60 sets its return type and adds parameters
61 according to the information extracted from
62 the operation repository object. Notice that
63 the client does not have the correct string for
64 the album title, but one that is commonly used
65 by people when referring to that album. The
66 server will try to be smart about this, and
67 match a substring of the given album title with
68 a substring of the real album title, returning
69 the corrected album title if it finds a match.
71 (e) The client invokes the DII request and displays
74 (5) The server is shut down.
76 (6) tao_ifr is again invoked on test.idl, this time with
77 the '-r' option, which removes the objects coresponding
78 to the contents of the IDL file from the repository.
80 (7) The repository is shut down.
82 By default, the client will call _get_interface() on the target
83 object to get its InterfaceDef from the respository, and then
84 query the IntefaceDef object to get information about its
85 operations and their parameters. If the command line option -n
86 is passed to the client (or to the Perl script), the client will
87 resolve the repository by a call to
88 orb->resolve_initial_references ("InterfaceRepository") and use
89 information it has (through some unspecified means) about the
90 local name of the interface and of its containing module,
91 to search the repository for the InterfaceDef of the target object,
92 and from there acquire the rest of the information the same way as
95 If the default method is used, the call to CORBA::Object::_get_interface()
96 requires that the server (specifically the generated skeleton code)
97 know about the TAO_IFR_Client library, since the implementation of
98 this method is not found in the TAO library, requiring as it does the
99 knowledge of the rather large IFR client interface. To dynamically load
100 the TAO_IFR_Client library (assuming it has been compiled), the
101 header file ACE_ROOT/TAO/tao/IFR_Client/IFR_Client_Adapter_Impl.h is
102 included in the application (in test_i.h) and TAO_IFR_Client added to
103 the list of linked libraries. This will force the static Initializer
104 function in the library to initialize all the IFR typecodes and to
105 load the library. Applications that don't need to call _get_interface
106 don't need to link this library and can thus keep the server-side
109 More information about the Interface Repository can be found in
110 TAO/docs/releasenotes/index.html.