Ok i am not completely sure that i understand what you are doing in
CellarExtender/CombinedClassLoader/HazelcastBundleListener... or do i have
to explicitly use the CombinedClassLoader in my other bundle?
The goal was that I want to create CamelProcessors during runtime and use
them in Blueprints. My actual approach is to automatically register them as
a Service and inject them into my blueprint. This works but it can not
access a BundleContext via FramWorkUtils so I can't get a Servicetracker.

br,
Matthias

Am Mi., 29. Sept. 2021 um 14:46 Uhr schrieb Jean-Baptiste Onofré <
j...@nanthrax.net>:

> Hi,
>
> No it's not really possible without a framework extension.
> Bundle classloader is directly managed by the framework.
>
> However, you can create/federate/control classloader. It's what we do in
> Cellar using the ClassLoaderService:
>
>
> https://github.com/apache/karaf-cellar/blob/main/core/src/main/java/org/apache/karaf/cellar/core/utils/CombinedClassLoader.java
>
> You can create groovy classloader and extend it.
>
> NB: a similar ClassLoader service is in preparation in K5:
>
> https://github.com/jbonofre/karaf5/blob/main/boot/src/main/java/org/apache/karaf/boot/service/ClassLoaderService.java
> (WIP)
>
> Regards
> JB
>
> On 29/09/2021 14:42, Matthias Leinweber wrote:
> > Hello,
> >
> > Is it possible to replace the bundle classloader with another? The idea
> > behind this is that you have a groovy class loader which uses the bundle
> > class loader as a parent. Then after the initialization of the groovy
> > class loader this class loader loads additional classes during runtime.
> >
> > When I add dynamic-import to a bundle which is using my groovy dynamic
> > bundle it should be possible to use the dynamically loaded classes in
> > the other bundle.
> >
> > But unfortunately i don't find a way to replace the bundle class loader
> > .. any ideas about this?
> >
> > best regards
> > Matthias
>

Reply via email to