Hi, I would too, the problem is if we don't override loadClass the class loader adapter will be able to see classes that will not be available to the Bundle. By default it delegates to the system class loader and if we don't override loadClass it will defer to that classloader first, so classes not visible to the bundle because they haven't been imported and aren't in the boot delegation property will be visible.
I don't know how much of an issue it is, but it is why I would stick with loadClass for now. Alasdair On 26 October 2010 12:09, Timothy Ward <[email protected]> wrote: > > Hi, > > I would also be +1 for this, but I'd prefer the implementation not to > override loadclass(). > > I think that at the same time we should move some of the other generic OSGi > tools such as the ManifestHeaderProcessor. The function there would be great > for JPA and for blueprint, but at the moment they would have to import from > the application utils bundle which would bloat the dependency graph. > > Regards, > > Tim > > ---------------------------------------- >> Subject: Re: Utility for making a Bundle look like a ClassLoader >> From: [email protected] >> Date: Tue, 26 Oct 2010 07:36:07 +0100 >> To: [email protected] >> >> + 1 >> >> I think those were duplicated for short-term convenience more than anything >> else. >> >> Valentin >> >> On 25 Oct 2010, at 22:39, Alasdair Nottingham wrote: >> >> > It appears that we have multiple classes which basically create a >> > ClassLoader that delegates to a Bundle. Ones I know of are: >> > >> > /blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/utils/BundleDelegatingClassLoader.java >> > /util/src/main/java/org/apache/aries/util/BundleToClassLoaderAdapter.java >> > /jpa/jpa-container/src/main/java/org/apache/aries/jpa/container/unit/impl/BundleDelegatingClassLoader.java >> > >> > There may be others. I was wondering if it would make sense to try to >> > common these up into one place? >> > >> > Thoughts? >> > Alasdair >> > >> > -- >> > Alasdair Nottingham >> > [email protected] >> > -- Alasdair Nottingham [email protected]
