On 1/25/11 15:07, Reto Bachmann-Gmuer wrote:
On Tue, Jan 25, 2011 at 8:47 PM, Richard S. Hall<[email protected]>wrote:

On 1/25/11 14:17, Reto Bachmann-Gmuer wrote:

Hello

When I attempt to load a class with
this.getClass.getClassLoader.load("foo.Hello") this prevents future
updates
of the bundle exporting foo from being effective, services in that package
will not be running with the updated class until felix is restarted or
packageAdmin.refreshPackages called.

Is this a known problem?

This is not a "problem", that's how the spec defines it. If an exported
package is being used by some bundle, then an update to the exported bundle
does not take effect until it is refreshed. This allows you to do multiple
updates without having to refresh dependent bundles multiple times.

Interesting. I though the client bundle would keep the old version but that
other bundles would still get the updated version. Also I'm surprised that
an attempt to load an inexisting class makes the bundle "using" the package
(once the attempt to load the class terminated).

For your first comment, perhaps you should read the FAQ about updating a bundle:

    http://felix.apache.org/site/apache-felix-osgi-faq.html

For the latter, I assume you must be using dynamic imports. Wiring is done at the package level, not the class level. Before attempting to find a class, a bundle must be wired to matching package exporter. The wiring happens first, there is no check in advance to make sure the package contains the class in question.

-> richard

Cheers,
Reto


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to