First we need to build a fragment bundle to gemini blueprint extender by adding this to the bundle's manifest.mf
Fragment-Host: org.eclipse.gemini.blueprint.extender
Next create a class extending OsgiBundleApplicationContextListener
in the onOsgiApplicationEvent, simply build a map to store all service dependency status. Since it's collecting event data (and that it is a fragment), so the bundle have to be installed before starting the blueprint extender and other bundles that you want to capture the events.
and build another bundle which implements Apache Shell's Command and simply call the last bundle and prints out the result.
My command's name is "geministatus" (just return "geministatus" in the getName method of your Command) so when you navigate to the shell tab of your felix webconsole, you can type geministatus and you'll find out if any bundles is waiting for any services to start the application context.
No comments:
Post a Comment