3 On_Demand_Loading Example
4 -------------------------
6 This example illustrates how to dynamically link and load servants
7 into a POA in a platform-independent manner using the ACE_DLL feature
8 and standard CORBA Servant Manager features. In the example, the POA
9 is configured with the USE_SERVANT_MANAGER policy value, which relies
10 on an application supplied Servant Manager object to supply
11 object/server associations.
13 If the POA has the RETAIN value for the servant retention, the POA
14 expects the Servant Manager to implement the Servant Activator
15 interface. Conversely, when the POA is created with the NON_RETAIN
16 value for servant retention, the Servant Manager must implement the
17 Servant_Locator interface.
19 This example illustrates both Servant Activator and Servant_Locator
20 interfaces. The servant object is created by a factory function that
21 resides in a DLL that is linked and loaded into the server's address
22 space on-demand when client requests arrive. The ObjectID in each
23 client request indicates which DLL name and which factory function to
24 use to create the servant.
26 For the Servant_Activator example, once the servant is loaded, the
27 Object-to-Servant association is added to the Active Object Map
28 maintained by the POA. This association becomes invalid when the POA
29 is destroyed or/and the Object is deactivated. In contrast, for the
30 Servant_Locator example operation request from the client causes the
31 servant to be linked, processed, destroyed, and unlinked. For all
32 examples, the dynamic configuration granularity is at the object
33 level, i.e., every object is associated with a DLL that is linked and
34 loaded into memory on-demand.
36 Note that the server need not be statically linked with the DLL. The
37 DLL name and the factory function used to obtain the servant can be
38 provided to the server at run-time. This gives us the flexibility of
39 modifying and linking the servant without having to statically link
40 the server along with the DLL.
45 Run the run_test_pl perl script.
48 run_test_pl -f ior_file
50 The output will demonstrate the different actions performed by the
51 Servant_Manager via the Servant_Activator and the Servant_Locator
54 NOTE: If directly running run_test.pl srcipt then by default the example
55 uses Generic_Servant as the servant. Hence its necessary to build
56 $TAO_ROOT/examples/POA/Generic_Servant before you build and run this