-
-
Notifications
You must be signed in to change notification settings - Fork 545
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
Question: Migrate from other plugin system #578
Comments
Probably you can use ClassLoader/PluginClassLoader to achieve this.
The plugin that contains the resources can be declared as a dependency for other plugins => in that plugins you can use ClassLoader#getResource or ClassLoader#getResources
Put these methods in a static class? I'm sure that you can emulate all these behaviors in your pf4j based application. In the end you need to think in terms of functionalities and not in the terms in which that functionality was implemented in the old plugin system (xml stuff, ..). If you insist to preserve the old API you can add a tiny layer over PF4J to obtain the same API. |
Main question is how to register resources/methods inside plugin system. Once I try to migrate codу I add implements ExtensionPoint and apply @extension annotation and its works. But this way cannot be applied to static resources |
Start small/lean with a quickstart project which highlights your problem in a narrow context. Share with us your quickstart project. It's more simple and easy to follow. |
Demo project https://github.com/makiam/PluginFrameworkMigrateTest |
I'm researching the possibility of migrating code from another Plugin Framework and there are several functions that I can't express using pf4j.
Current framework allows me to register some localized resources inside plugin and then access them in code. Ex. I can declare in my plugin descriptor (i.e xml file)
it is also possible for several different localized versions of a resource to be available provided by different plugins.
So this resources can be accessed from application Plugin and UITheming managers like this:
var name = Translate.text("polymesh:menu.lathe");
Another functionality is to register function in plugin to be accessed from other parts application this way:
Register:
NB. Method call can be documented here!
Call:
PluginRegistry.invokeExportedMethod("preferences.getString", "spmanager", "userName");
So the question is such functionality can be adopted with pf4j
Thanks.
The text was updated successfully, but these errors were encountered: