Nested plugins

8 views
Skip to first unread message

Paul Stanley

unread,
Dec 16, 2024, 4:06:56 PM12/16/24
to pf4j
Hi -

I have an application A that loads plugins (B). In turn B loads 'child plugins' (C). The problem I am facing is that the parent classloader for C is the system/app classloader. This doesn't work for me because C is dependent on classes loaded by B, so the parent classloader for C needs to be B.

App ----load----->    B   ------load-------> C

I've tried extending DefaultPluginManager, and overriding createPluginWrapper method whereby I call super.createPluginWrapper with a different classloader (whose parent is B), but it fails because the plugin is not created. 

Is there an official/better way to specify the parent classloader?

Regards,
Paul Stanley


deceba...@gmail.com

unread,
Dec 17, 2024, 2:02:16 AM12/17/24
to pf4j
> In turn B loads 'child plugins' (C)

Is C a plugin or not? It's not clear for me what means "child plugin".


> This doesn't work for me because C is dependent on classes loaded by B,

In this case the B has a dependency to C.


>  The problem I am facing is that the parent classloader for C is the system/app classloader. 

How did you do that?
Reply all
Reply to author
Forward
0 new messages