Hi, On Tue, 2018-04-17 at 10:02 +0200, Christian Schneider wrote: > Dear Felix community, > > during the last weeks Andrei Dulvac and I worked on a small framework > to > check if an OSGi based system is fully up. > > Our work originated in testing sling modules and whole sling > instances. We > soon found though that the concept is more general than sling and can > be > applied to any OSGi based system. > > The system readiness framework has a SystemReadinessMonitor service > that > reports the aggregated state of the system. It delegates to > SystemReadinessCheck services that each check for a certain aspect. > We > implemented a first check based on a list of expected top level > services. > The system can be customised by adding specific checks for your > application. For example we plan to add sling specific checks inside > the > sling project. > > In addition to simply detecting if the system is ready we also > created a DS > based root cause analysis that can be very helpful to detect why a > set of > components does not come up as expected. > > We would like to donate this project to the Apache Felix project as > it > might get more attention there by people that are not related to > sling. The > project is Apache licensed from the start and we already got a basic > documentation as well as good test coverage. > > We currently host it in this github repository: > https://github.com/dulvac/system-readiness > > The packages are still mentioning sling but of course we would change > this > to felix if this community is interested in the donation.
It is an interesting approach. Determining whether or not the framework is in a useable state is a rather difficult problem for dynamic systems. The problem obviously being that when a bundle appears to be active, it does not necessarily imply that its services are ready for duty. In the past, I've worked with another, somewhat similar, utility (see [1]) that provides a callback whenever the framework reached a "stable" state (or becomes "unstable") so I could act upon that. What I liked about this was that it did not require me to implement "readiness checks" for any of my services (though I see that it might be useful to provide such custom checks occassionally). That said, I think it would be interesting to have an addon for Felix that has minimal dependencies and combines both approaches :) 1. https://github.com/beinformed/osgitest/tree/master/com.beinformed.fr amework.osgi.frameworkstate Regards, Jan Willem
