summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/TAO_Service/README
blob: 27a7166803ae1f600ac8642e64b838f4b27f44f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// $Id$

This directory has a generic server which opens and reads the svc.conf file in 
the directory and dynamically loads and unloads the various ORB services as per 
the entries made in the svc.conf file.

To Load a Service Dynamically:
*****************************

1. Add an entry to the svc.conf which specifies the service name that you wish to
   load dynamically.
	
	The syntax for loading a service dynamically is:

	dynamic < Service name i.e. name that you want the Service Repository to
                  use to identify the dynamically linked Service_Object
                  so that you can look it up later via, 
	          e.g., ACE_Dynamic_Service::instance () > \
                < The type of the service > \
                < The shared DLL that has the function
                  _make_Service_Name () , called the factory function> : \
                <factory_function> \
	       "< arguments to be passed to the service similar to command line arguments>"


To load Naming Service dynamically :
----------------------------------
	
  dynamic TAO_Naming_Loader Service_Object * \
          TAO_CosNaming:_make_TAO_Naming_Loader () "dummy -o ns.ior"

  So, here we want our service name to be TAO_Naming_Loader and its a
  <Service_Object *> and the factory function is in TAO_CosNaming
  DLL. We specify argv [0] to be "dummy" and the actual arguments
  start from argv [1] as in the usual case.

To load Event Service dynamically:
---------------------------------
	
	In the case of Event Service, we also want to load the default
Event Service Factory in addition to the Event Service. So, we need to
add these two entries when we want to load the event service.

# Dynamically configure the default Event Service Factory
dynamic CEC_Factory Service_Object * \
	TAO_CosEvent:_make_TAO_CEC_Default_Factory () ""

# Dynamically configure the event service into the application process.
dynamic TAO_CEC_Event_Loader Service_Object * \
        TAO_CosEvent:_make_TAO_CEC_Event_Loader () "dummy -o foo.ref"

To load Trading Service dynamically:
---------------------------------

#  Dynamically configure the trading service into the application process.
dynamic TAO_Trading_Loader Service_Object * TAO_CosTrading:_make_TAO_Trading_Loader () "dummy -TSdumpior foo.ref"

To Remove a Service
*******************

	The directive for removing a service is <remove>. Removing a 
service is simpler. Add the following entry to the same svc.conf file
after commenting the entry for loading the same service, so that
the service is not loaded again.


The generic entry is :

remove Service_Name

To Unload Naming Service :
------------------------

# Dynamically remove the Naming Service from the application process.
remove TAO_Naming_Loader

To Unload Event Service :
------------------------

# Dynamically remove the Event Service from the application process.
remove TAO_Event_Loader

To Unload Trading Service :
------------------------

# Dynamically remove the Event Service from the application process.
remove TAO_Trading_Loader

To Run TAO_Service :
==================

1. Start with a empty svc.conf file. Run the TAO_Service. Make sure
that you start with an empty svc.conf file because the ORB_init () and
the service configurator get pretty confused. 

In detail, the svc.conf file is read and services loaded when 
ORB_init () is called in the main (). But, to load any service, we
need to initialize the ORB. Here, it gets confused. To avoid this,
run the TAO_Service with no entries in the svc.conf file.

2. After running the server, now start adding entries to the svc.conf
file depending on the services you wish to load. After adding an
entry, send a SIGHUP signal:

% kill -1 PID_of_TAO_Service

	 to the TAO_Service. The service configurator reads the
svc.conf file again and reconfigures the services.

3. If you want to test if the service is loaded successfully, run the
generic client program < tests_svc_loader.cpp > located in 
orbsvcs/tests/tests_svc_loader. For more details about the
tests_svc_loader.cpp, read the README in the same directory.

4. If you want to remove the service at any instant, add an entry to
the svc.conf file to reflect your intent and send a signal to the
TAO_Service again.