felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Offermans <marcel.offerm...@luminis.nl>
Subject Re: PicoContainer in Felix
Date Sat, 24 Dec 2005 16:35:06 GMT
Richard S. Hall wrote:

> Good question. I think other frameworks do something similar. It might 
> not work 100% of the time, but it could work in the standard cases. 
> From a conceptual purity point of view, it is not nice because bundles 
> can gain access to classes that they don't import.
>
> We need to flesh out a strategy for it to determine if it sounds like 
> it would be a good thing to do.

Fortunately, a lot of libraries that use classloaders can be made to 
play nice by setting the classloader they should use to resolve classes. 
So we're only talking about libraries that assume the context 
classloader is the right one to resolve all their resources (without 
possibilities to override that).

I would argue that these libraries need to be enhanced.

Our strategy for dealing with these "flawed" libraries is using a 
"bundle private thread" whose context classloader we set (like explained 
in the example a few posts back). Of course, the downside is the 
creation of a "worker thread" for this bundle which creates a bit of 
extra overhead.

I'm not completely convinced it would be desirable to modify any 
thread's context classloader as the thread passes through various 
bundles. I'm also not convinced it would be possible to do so 
(automatically, by the framework).

Seasons greetings, Marcel


Mime
View raw message