Generic server/service framework.
A set of named services:
Each service is a JavaBean
- init(ServiceContainer c, Properties p)
- init(ServiceContainer c, Document d)
- stop();
A service's properties are defined in an xml file or a '.props' file,
the contents of which are defined by the service itself.
The initial services are defined in an xml file. The 'service-config'
parameter refers to a file which may be an XML file, a '.props' file,
or an inline XML element.
<server>
<service>
<service-name>log</service-name>
<service-class>com.quadcap.services.Logger</service-class>
<service-config>
<file-name>server.log</file-name>
<log-level>2</log-level>
</service-config>
<load-on-startup>0</load-on-startup>
</service>
<service>
<service-name>DataSources</service-name>
<service-class>com.quadcap.services.DataSources</service-class>
<service-config>datasources.xml</service-config>
(or
<service-config>
<data-sources>
<data-source>
</data-source>
</data-sources>
</service-config>
<load-on-startup>0</load-on-startup>
</service>
<service>
<service-name>web80</service-name>
<service-class>com.quadcap.services.WebServer</service-class>
<service-config>web80.xml</service-config>
<load-on-startup>2</load-on-startup>
</service>
</server>
Services can be added/deleted at run time:
- ServiceContainer.addService(String name, Service service)
|