Hi:
        Blue Print and Spring DM both support declarative OSGI Service's
publish
 and reference usage.
        While using Spring DM ,  the Thread Context Class Loader feature
sometimes
 is convenience, but sometime cause unexpected issue. (If anyone feel
interest with it, I illustrate a issue caused by Spring DM Thread Context
Class Loader at the end of this mail)
        While using Blue Print, it doesn't force to use thread Context Class
Loader.
 So it's better than spring dm at this point.
        Spring DM is very easy to integrate in spring application. But while
using
 Blue Print, I have no ideas how could I integrate it with Spring?
        Although I can access the service published by blue print in a
Spring Bean, but this will ask for the application to maintenance the
reference to service carefully. Spring dm has already support a safely way
to maintenance reference to service, Blue Print also support such feature, I
think. But when I integrate with Blue Print and Spring, how could I achieve
such feature?

Does anyone know how to do this?
 
Thanks any suggestion.

Ps. A Bundle Uninstalled Exception caused by Spring DM:

1. spring osgi extender switch context class loader to current bundle
2. Starting spring application by the spring xml file of current bundle.
3. spring application may allocate thread from thread pool which shared
between multi application/bundle(etc: jetty server's thread pool).
3.1: if the allocated thread is a new created one, it will inherit the
caller thread's context class loader: it's the class loader for current
bundle.
4. After stop and uninstall the application bundle, the thread will return
back to pool, But unfortunately, it thread context class loader still point
to the uninstalled bundle;

Then if another bundle started, it will got a thread from pool which thread
context class loader point to a un-installed bundle.


Reply via email to