Hi,

I just noticed this thread and I meant to draw your attention to a Felix
subproject I started couple of years ago to address precisely this question
of service diagnostics using various DI frameworks.

The idea is to merge and diagnose service dependencies across DI frameworks
and point directly to the root(s) missing service(s), which can quickly
become complicated for a growing number of services. For instance:

If A using SCR depends on B provided by DependencyManager
and B depends on C provided by SCR
and C depends on a missing service D

The plugin will display a graph only showing the missing C to D dependency;
all intermediates (A and B) are hidden because they will automatically be
resolved if D becomes available.
The plugin also attempts to detect potential loops in service dependencies.

While the primary use case is a graphical representation in the webconsole,
the code is organized to be extended and reused:
- the diagnostics engine is itself a service which can be used to
programmatically diagnose service issues for other uses (logging,
alarms...)
- DI frameworks specifics are plugins implementing a simple interface: for
now only Felix SCR and Felix DependencyManager plugins are implemented, but
additional plugins for Blueprint implementations, iPojo or others could be
easily added, even as separate bundles.

As it was mentioned in the thread, diagnostics care only about services and
not bundles, as one bundle may provide many services, even using several DI
frameworks.

Incidentally, the plugin also presents other graphs of service to bundles
dependencies or ownership as well as a view of the service registry, but
these only show registered (and thus resolved) services and can quickly
become difficult to read with numerous services.

The project is called Web Console ServiceDiagnostics Plugin and can be
found on Felix' download page:
http://apache.websitebeheerjd.nl//felix/org.apache.felix.servicediagnostics.plugin-0.1.3.jar

It has a dependency on the following bundles (basically scala, the
webconsole and the DI frameworks used, so you're probably just missing
scala in the list):
scala-library-2.10.0.jar
org.apache.felix.http.jetty-2.2.0.jar
org.apache.felix.webconsole-4.2.0.jar
com.springsource.org.apache.commons.fileupload-1.2.1.jar
com.springsource.org.apache.commons.io-1.4.0.jar
json-20090211_1.jar
org.apache.felix.dependencymanager-3.0.0.jar
org.apache.felix.dependencymanager.shell-3.0.0.jar
org.apache.felix.scr-1.6.0.jar
org.osgi.compendium-4.2.0.jar
org.apache.felix.shell-1.4.3.jar
org.apache.felix.webconsole.plugins.shell-1.0.0-SNAPSHOT.jar

The source code (in Scala) is fairly small and can be viewed here:
http://svn.apache.org/repos/asf/felix/trunk/webconsole-plugins/servicediagnostics/core/

I hope this looks like what you may be looking for. It certainly proved
useful in my organization to track service related issues and ease the work
of developers.

Best regards,
Arjun Panday
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to