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