Hi,
I'm stumbling a little on the new GeoServerLoader class differences
between 1.7.x and trunk and guess I need some clarifications.
The context in which I'm operating is some logging changes, and in
the process I've looked into how the whole configuration is loaded.
On 1.7.x, first service.xml is loaded to retrieve logging configuration,
then logging is configured, then the catalog and the services information is loaded, and finally a series of pluggable initializers
is processed (for stuff that you need to do at startup, but after the
normal configuration has been processed).
On trunk, the initializers are still there, but GeoServerLoader.initialize() is actually never called. What happens
instead is that the Spring context is left free to load the classes
in the order it wants, and GeoServerLoader acts as a post processor,
configuring each of them as it is loaded, and running the
GeoServerInitializer after the service configuration is loaded.
By the time the LoggingInitializer is called, both Catalog and
GeoServer have been loaded.
Now, it's better to initialize logging before the catalog is loaded,
because that operation generates a lot of logs over which it would
be good to have some control.
So the temptation to solve the issue on trunk as well is to:
- make LoggingInitializer a GeoServerPreInitializer, that is,
a kind of initiliazer that does run before everything else
is setup, that would be called when GeoServerLoader.setApplicationContext(...) is called, and
that would just have an initialize() method
- have the LoggingInitializer directly read services.xml and
configure itself without the need to depend on GeoServer
(using pieces of the legacy logging reader from 1.6.x)
and finally replicate most of it on 1.7.x as well, for consistency.
Suggestions?
Also note that it took me a few hours in the debugger to figure out the
above, due to the new code and the differences between 1.7.x and trunk.
Having a few scraps of documentation would have helped
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.