Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » DynamicImport-Package creates bundle leak?
DynamicImport-Package creates bundle leak? [message #513908] Thu, 11 February 2010 16:10 Go to next message
Zilvinas  is currently offline Zilvinas Friend
Messages: 1
Registered: February 2010
Junior Member
Hello,

I've got problem with dynamic loading, and hope that someone of you can clarify this.

The situation is following: There are bundles A and B. A depends on B. B bundle has in its manifest declared DynamicImport-Package: *. After i start both bundles, B does classForName to load class from A, and so Equinox in trun creates dynamic import to A.
Unitl this point i think everything works as intended.
The problem I have is that when i try to update bundle "A" - framework reloads it, but all the "A" classes remains unchanged.

I have done some beduging, and memory dump analysis, so to make long story short - there is code in equinox, which on reload checks whether there are no dependents and if there are any, it puts the bundle for pending removal instead of closing it (which is also could be ok if dependencies are not dynamic).

In my case B is third party bundle and A is mine, so its kind of wierd to lose control over the bundle (by not being able to reload it) because they have declared dynamic import .
Maybe dynamic imports should be handled diferently, for instance - framework could let them go when dependency bundle is reloading.
Is it a bug, or this is intended behaviour or am i missing something here?
Re: DynamicImport-Package creates bundle leak? [message #513922 is a reply to message #513908] Thu, 11 February 2010 16:44 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Dynamic imports create "hard" wires once we have resolved a particular package wire. So in your case Bundle B really does have a hard wire to Bundle A. We must put Bundle A in a removal pending state because the class loader for B must remain consistent with respect the the current package wires it has at the time you updated A. You must call PackageAdmin.refreshPackages in order to flush out the old removal pending bundles.

Note that in your case this will force bundle A and B to refresh and get new Class loaders. This is necessary to ensure that B's class loader can load new content for the package it loads classes from for A.

HTH.

Tom.
Previous Topic:One Handler for multiple MenutItem
Next Topic:NPE in eclipse osgi GroupingChecker/ResolverImpl
Goto Forum:
  


Current Time: Fri Apr 26 02:25:42 GMT 2024

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

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

Back to the top