This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
TZ01: How the bridge solves mapping from BundleContext to Lookup and doing ungetService? I haven't found it in the patch, but the patch is very huge. If it is not solved, it can be done by the WeakReference with an activeReferenceQueue doing the unget. (TCA). I've added test to check the current behavior: http://hg.netbeans.org/netigso/rev/08446f207b3d However the ungetService is not called. The original idea was to use weak reference, but that may not work. As the service itself is not hold by the provider. Lookup.Item is hold by the Lookup.getDefault (until the service disappears).
I am afraid I have to close this as won'tfix. I do not know how to implement the contract.
FWIW I would recommend deleting any code which attempts to bridge OSGi services and Lookup. Who is it for? Either your API is expecting to find objects in Lookup, in which case it will call Lookup, or it is expecting to find objects in the OSGi service registry, in which case it will call that. Any bridge is likely to produce bugs and not accomplish anything other than a demo. If for some particular application you do decide you want a bridge, that could be accomplished using some experimental module.