Hello Calvin,

Saturday, July 28, 2001, 8:50:05 PM, you wrote:

CY> I was looking at the ServiceManager source code, and was wondering why
CY> is service-manager.xml loaded from system property?  Would it be more
CY> consistent if it was loaded from an init parameter?

8) There are some hints exists in ServiceManager. ServiceManager as is
uses init() method to load and parse config and init variables. But
init process in ServiceManager is splitted to the several parts -

 init()
  |_ initStructures()    prepare internal structures for init process
  |_ initConfig()        read system variables and parse
                         service-manager.xml
      |_ initDigester()  init digester object to parse config

This scheme can be used for independent ServiceManager configuration,
with independent config file for ServiceManager - service-manager.xml.
Simple version of initConfig() reads all variables from system
properties - such solution is compatible with _any_ sphere of java
world. But if you want to use it in servlet world, for example, then
you can extend ServiceManager and write your own version of the
initConfig() to read variables from init parameters in web.xml.

Another approach is to use parent's application config file to read
ServiceManager config from. This scheme uses ServicesServlet. In this
situation ServiceManager don't need to know config file location. 8))
ServicesServlet calls ServiceManager.initStructures() in its init()
method to init internal ServiceManager structures and calls
ServiceManager.initDigester() to add all ServiceManager related rules.
That is all. 8) After that all config will be read from single
struts-config.xml file.

CY> Also, what is the plan for integrating services into ActionServlet?  My
CY> concern is that, as it stands now, the ServicesServlet will have to be
CY> kept consistent with ActionServlet as ActionServlet changes.

Yes, it is. But integration of the ServiceManager to the ActionServlet
is not only my solution. Now it is only one of the ways to make struts
extendable with number of services. If community vote to integrate it
to the struts head brunch then ServiceManager became a part of struts
distribution. So meanwhile every hard ActionServlet change summons
changing of the ServicesServlet.

-- 
Best regards,
 Oleg                            mailto:[EMAIL PROTECTED]


Reply via email to