I ran into a issue last night in Tomcat where the listener that is processing the webapp needs access to the list of SCLLoaders maintained by the runtime.
The runtime maintains a list of registered SCDLModelLoader components - as each loader is initialized it adds itself to this list using a autowired reference to the RuntimeContext. However, there is no way to retrieve what's in this list. TuscanyRuntime does this by maintaining a reference to the underlying List itself. A simple hack solution would be to add a method TuscanyRuntime to expose the list. However, this is a key API that will be used by anything that wants to load SCDL configuration information so I don't think exposing the internal implementation is the way to go. Instead, I think we should add a system service that provides a registry of all SCDLModelLoaders. Loader implementations would autowire to it rather than to the RuntimeContext but would then register in the same way. Things that needed to load scdl information would be able to locate the registry using the normal service locate API rather then special methods on the runtime itself. Doing this will make it easier to embed Tuscany in different environments - we can verify this using the Tomcat embedding I am working on at the moment. -- Jeremy
