On 2010-05-25 12.07, Edward Yakop wrote:
I'm not sure which OSGi approach you took, but I'm wondering on how do
you passed BundleContext around in order to get ServiceTracker bootstrapped?
Do you do this as part of application assembly? or do you expose
bundleContext as qi4j service?
If it's the former, shouldn't it be possible to get the proxy and
service tracker created at startup?

I cheat:
BundleContext context = BundleReference.class.cast( serviceDescriptor.type().getClassLoader() ).getBundle().getBundleContext(); ServiceTracker serviceTracker = new ServiceTracker(context, serviceDescriptor.type().getName(), null);
---
In the changes I'm doing now I also register a bundle listener, so that I can close the ST when the bundle stops. Since there is no explicit lifecycle event for imported services that's the only workaround I can think of.

/Rickard


_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to