2

Here I am again seeking enlightment. The situation is as follows:

We have a task engine running in Wildfly 11 that depends heavilly in dynamic loading through reflection. Don't need to say that we have an abstract "base" class for everything. It depends on database registration that uses simple Class.forName() to load the implementation. For usual work, it runs smoothly. Since our engine has different modules, we already work with jboss-deployment-structure.xml to tell Wildfly that the "Process" module depends on "Core" module and so on.

But now, we need to work with "plugins", so our customers could create their own implementations inside another package and simply register them in our database.

The question is: How do I tell Wildfly, or the classloader, or the divinity that manages it, to load the class inside the plugin without using .xml dependency files, since it would create a "regretable" circular dependency (the plugin already declares it's dependencies to the Core package)

Is it possible without hard changes in the implementation (like make the plugin init to declare itself to the core or something else)? we have a LOT of code and this kind of refactoring is not feasable at the moment.

Best Regards,

Fernando Augusto.

  • Without any changes to the implementation the only way you'd find the classes without loading every class is to scan the plugins with something like [ASM](http://asm.ow2.org/) – Nick Wilson Feb 06 '18 at 09:17

0 Answers0