- If the services it depends on are not available (HttpService, LogService) then it continues to activate, when really it should throw an exception, or even better use a ServiceTracker to dynamically track the services.
- What if there's more than one HttpService?
- It requests a LogService then uses System.out
- It registers itself as a bundle listener before creating an instance of the ServiceRegistry. In the unlikely event that a bundle state changes while this bundle is activating you could get a NullPointerException in the
bundleChangedwhen trying to called the methods on the registry instance.
- Note the big block of code already commented out... that would stop any services which are already registered from being exposed as web services. Remember that OSGi is a very dynamic environment things can come and go as well as already be there when your bundles start.
- While not strictly required (I believe), during the stop() method it is good practice to call ungetService on any services references that have been acquired.
As for the rest of the code, I'm not qualified to comment as I don't know the inner workings of Axis2, so I'm just going to give it a try and see what happens. Watch this space.