|
发表于 2009-5-15 12:55:22
|
显示全部楼层
可以参考APG(19.5节)
We have learned how service configuration directives are processed at program start-up via the ACE_Service_Config::open() method. So how do these configuration directives get processed after that point? As we saw in the example programs in this chapter, after the Service Configurator framework is initialized, control often resides in the Reactor framework's event loop. There are two ways to make ACE reprocess the same service configuration file—or set of files—used when ACE_Service_Config::open() was called.
On systems that have POSIX signal capability, send the process a SIGHUP signal. For this to work, the program must be executing the Reactor event loop. As this is often the case, the requirement is not usually a problem. Note that the signal number to use for this can be changed when the program starts, by specifying the -s command line option (see Table 19.1).
The program itself can call ACE_Service_Config::reconfigure() directly. This is the favored option on Windows, as POSIX signals are not available, and can also be used for programs that are not running the Reactor event loop. To make this more automatic on Windows, it's possible to create a file/directory change event, register the event handle with the ACE_WFMO_Reactor, and use the event callback to do the reconfiguration.
Both of these options will reprocess the service configuration file(s) previously processed via ACE_Service_Config::open(). Therefore, the usual practice is to comment out the static and/or dynamic service initialization directives and add—or uncomment, if previously added—the desired remove directives, save the file(s), and trigger the reconfiguration. |
|