A Server class provides standard configuration, logging and {@link Service}lifecyle management.
A Server normally has a home directory, a configuration directory, a temp directory and logs directory.
The Server configuration is loaded from 2 overlapped files,
#SERVER#-default.xml
and
#SERVER#-site.xml
. The default file is loaded from the classpath, the site file is laoded from the configuration directory.
The Server collects all configuration properties prefixed with
#SERVER#
. The property names are then trimmed from the
#SERVER#
prefix.
The Server log configuration is loaded from the
#SERVICE#-log4j.properties
file in the configuration directory.
The lifecycle of server is defined in by {@link Server.Status} enum.When a server is create, its status is UNDEF, when being initialized it is BOOTING, once initialization is complete by default transitions to NORMAL. The
#SERVER#.startup.status
configuration property can be used to specify a different startup status (NORMAL, ADMIN or HALTED).
Services classes are defined in the
#SERVER#.services
and
#SERVER#.services.ext
properties. They are loaded in order (services first, then services.ext).
Before initializing the services, they are traversed and duplicate service interface are removed from the service list. The last service using a given interface wins (this enables a simple override mechanism).
After the services have been resoloved by interface de-duplication they are initialized in order. Once all services are initialized they are post-initialized (this enables late/conditional service bindings).