-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to dynamically load and unload plugins using pf4j-spring? #84
Comments
According the code source the plugin class loader is closed automatically, no need to do it explicitly in your code. It's somehow normal that the plugin class loader exists in memory, it's not collected by garbage collector. The idea is the the unloaded plugin is invalidated, it cannot loads class in the memory of app and the plugin (and the associated class loader) is not references anymore in pf4j. What is your problem after all, what is not working? |
Hello!
I now want to dynamically load and unload plugins so that the main project can access the beans and APIs in the plugins.
My loading code is as follows:
My unloading code is as follows:
After using the above code, I can access the interface defined in the bean and controller in the plugin, but when uninstalling, I found that the class loader of the plugin could not be closed correctly, and no error message was output.
I want to know what is the correct way to dynamically load and unload, is there something I have not considered, and I have not found a solution in the official documentation. I really hope you can help me. Thank you very much.
The text was updated successfully, but these errors were encountered: