3 This directory has a generic server which opens and reads the svc.conf file in
4 the directory and dynamically loads and unloads the various ORB services as per
5 the entries made in the svc.conf file.
7 To Load a Service Dynamically:
8 *****************************
10 1. Add an entry to the svc.conf which specifies the service name that you wish to
13 The syntax for loading a service dynamically is:
15 dynamic < Service name i.e. name that you want the Service Repository to
16 use to identify the dynamically linked Service_Object
17 so that you can look it up later via,
18 e.g., ACE_Dynamic_Service::instance () > \
19 < The type of the service > \
20 < The shared DLL that has the function
21 _make_Service_Name () , called the factory function> : \
23 "< arguments to be passed to the service similar to command line arguments>"
26 To load Naming Service dynamically :
27 ----------------------------------
29 dynamic TAO_Naming_Loader Service_Object * \
30 TAO_CosNaming_Serv:_make_TAO_Naming_Loader () "dummy -o ns.ior"
32 So, here we want our service name to be TAO_Naming_Loader and its a
33 <Service_Object *> and the factory function is in TAO_CosNaming_Serv
34 DLL. We specify argv [0] to be "dummy" and the actual arguments
35 start from argv [1] as in the usual case.
37 To load Event Service dynamically:
38 ---------------------------------
40 In the case of Event Service, we also want to load the default
41 Event Service Factory in addition to the Event Service. So, we need to
42 add these two entries when we want to load the event service.
44 # Dynamically configure the default Event Service Factory
45 dynamic CEC_Factory Service_Object * \
46 TAO_CosEvent_Serv:_make_TAO_CEC_Default_Factory () ""
48 # Dynamically configure the event service into the application process.
49 dynamic TAO_CEC_Event_Loader Service_Object * \
50 TAO_CosEvent_Serv:_make_TAO_CEC_Event_Loader () "dummy -o foo.ref"
52 To load Trading Service dynamically:
53 ---------------------------------
55 # Dynamically configure the trading service into the application process.
56 dynamic TAO_Trading_Loader Service_Object * \
57 TAO_CosTrading_Serv:_make_TAO_Trading_Loader () "dummy -TSdumpior foo.ref"
62 The directive for removing a service is <remove>. Removing a
63 service is simpler. Add the following entry to the same svc.conf file
64 after commenting the entry for loading the same service, so that
65 the service is not loaded again.
68 The generic entry is :
72 To Unload Naming Service :
73 ------------------------
75 # Dynamically remove the Naming Service from the application process.
76 remove TAO_Naming_Loader
78 To Unload Event Service :
79 ------------------------
81 # Dynamically remove the Event Service from the application process.
82 remove TAO_Event_Loader
84 To Unload Trading Service :
85 ------------------------
87 # Dynamically remove the Event Service from the application process.
88 remove TAO_Trading_Loader
93 1. Start with a empty svc.conf file. Run the TAO_Service. Make sure
94 that you start with an empty svc.conf file because the ORB_init () and
95 the service configurator get pretty confused.
97 In detail, the svc.conf file is read and services loaded when
98 ORB_init () is called in the main (). But, to load any service, we
99 need to initialize the ORB. Here, it gets confused. To avoid this,
100 run the TAO_Service with no entries in the svc.conf file.
102 2. After running the server, now start adding entries to the svc.conf
103 file depending on the services you wish to load. After adding an
104 entry, send a SIGHUP signal:
106 % kill -1 PID_of_TAO_Service
108 to the TAO_Service. The service configurator reads the
109 svc.conf file again and reconfigures the services.
111 3. If you want to test if the service is loaded successfully, run the
112 generic client program < tests_svc_loader.cpp > located in
113 orbsvcs/tests/tests_svc_loader. For more details about the
114 tests_svc_loader.cpp, read the README in the same directory.
116 4. If you want to remove the service at any instant, add an entry to
117 the svc.conf file to reflect your intent and send a signal to the