Am 05.08.15 um 08:52 schrieb Bertrand Delacretaz: > Hi, > > Looking at https://cwiki.apache.org/confluence/display/SLING/Startup+Handling > I'm wondering if we shouldn't just (or initially) simplify some of the > APIs that currently couple modules to the launchpad in terms of > startup. > > Looking at bundles/extensions/settings for example it seems like it's > only interested in the StartupMode, and I suspect other modules are in > the same case. The dynamics like "is startup finished" don't make > sense anyway with other launchers like Karaf IIUC. > > Currently the only way to get that mode is via > > public interface StartupHandler { > StartupMode getMode(); > boolean isFinished(); > void waitWithStartup(final boolean flag); > } > > which mixes several concerns. How about creating a StartupModeProvider > service API: > > public interface StartupModeProvider { > StartupMode getMode(); > } > > and have StartupHandler inherit from this? > > This would reduce the coupling area between the startup stuff and > client modules, and we can then isolate the StartupModeProvider > implementation in its own bundle which handles just this concern and > is independent of the startup mechanism. > We should put the interface in a separate api package. Otherwise a bundle implementing this service should also implement the other services in that package and we end up with the same situation. if a bundle is only implemnting a single service in an api package it's kind of breaking the api contract.
Carsten -- Carsten Ziegeler Adobe Research Switzerland cziege...@apache.org