Skip to main content



      Home
Home » Eclipse Projects » Equinox » Do I have to remove BundleListeners when Bundles are uninstalled?(Does Eclipse manages the listeners in a weak datastructure or removes them automatically?)
icon5.gif  Do I have to remove BundleListeners when Bundles are uninstalled? [message #502821] Wed, 09 December 2009 14:52 Go to next message
Eclipse UserFriend
Using the BundleListener interface and the methods BundleContext.addBundleListener(..) and removeBundleListener(..) I wandered whether or not I have to remove a BundleListener before its object is disposed. E.g., if I uninstall a bundle dynamically are BundleListener intances provided by this bundle removed automatically or do I have to unregister them before I uninstall the bundle?
Re: Do I have to remove BundleListeners when Bundles are uninstalled? [message #508650 is a reply to message #502821] Tue, 19 January 2010 12:40 Go to previous message
Eclipse UserFriend
Probably too late to be useful. But when a bundle is uninstalled it first is stopped. This allows the bundles themselves to clean up and remove any listeners they need to. This is important if the bundle has some ordering issue where they need to remove some listeners before disabling some functionality of the bundle on stop().

But the framework is still responsible for removing and remaining listeners which the bundle may have registered with its BundleContext when the bundle is stopped. The end result is that a management agent (doing the uninstall operation) should not have to worry about cleaning up any listeners registered by the bundles it is uninstalling.

HTH

Tom.
Previous Topic:question about the OSGi, equinox, eclipse
Next Topic:OSGi - NullPointerException in ContextFinder
Goto Forum:
  


Current Time: Wed Jul 23 19:34:31 EDT 2025

Powered by FUDForum. Page generated in 0.41247 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top