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.

Bug 179389 - ungetService when no longer used via Lookup the
Summary: ungetService when no longer used via Lookup the
Status: RESOLVED WONTFIX
Alias: None
Product: platform
Classification: Unclassified
Component: Netigso (show other bugs)
Version: 6.x
Hardware: Other Linux
: P3 normal (vote)
Assignee: Jaroslav Tulach
URL:
Keywords:
Depends on:
Blocks: 149013
  Show dependency tree
 
Reported: 2010-01-11 09:52 UTC by Jaroslav Tulach
Modified: 2010-03-10 09:25 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2010-01-11 09:52:32 UTC
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).
Comment 1 Jaroslav Tulach 2010-03-10 09:13:37 UTC
I am afraid I have to close this as won'tfix. I do not know how to implement the contract.
Comment 2 Jesse Glick 2010-03-10 09:25:52 UTC
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.