-
-
Notifications
You must be signed in to change notification settings - Fork 546
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
Ideas for next PF4J versions #65
Comments
Maybe it's time to release a stable version (improve unit tests, fix bugs, etc) and improve the documentation (also move it to the wiki). After this version (probably 1.0.0), the number of contributors will probably increase and the community could work on more features. You also could create a TODO.md file to organize these tasks. |
I agree to gearlles. Beside that:
Problems I faced so far: I have a main-application which uses plugins (of course). Both, the main application and plugins are build with maven. Problem is: The plugins have packaging JAR, but produce a ZIP. The maven assembly plugin can only depend (with dependencyset) on the jar, but not on the zip. I could depend with file-dependency, but then I need to work with wildcards/placeholders for the version etc. I don't know how exactly this can be solved. |
I'm trying to write my own pluginmanager, ... etc. But things are blocking me:
To overcome this problem, I would need to add my custom-classes directly to PF4J. BUt I expect that this is not the way it is meant (blowing up that small library with such a "special-case" is maybe not a good idea) So, before starting a new release, I would vote for "fine-tuning" the existing version to make it as generic as it should be. I'll try to fix this a place a pull-request. |
Added pull request: #66 |
Thanks for your suggestions. |
The complete stuff is build with maven. Why should I now add a shell-script (which is platform dependend) if I could do it with maven? Have a look at the answer to my pull-request. The remaining thing I would require is the "protected" instead of "private" access of "pluginsDirectory" field. If extending DefaultPluginManager is not supported, one should be able to create an own PluginManager. But then DependencyResolver should be public. |
@tuxedo0801 @decebals About the assembly I implemented this in https://github.com/lightglitch/pf4j/tree/assembly, just run "mvn assembly:assembly" against the Demo Project and you will get a zip with the exact same structure provided by the "run-demo". I can create a pull request if you guys think is good to have in the project. Edit: the "mvn clean package" also works. |
@lightglitch |
|
This is a really cool project but it's kind of hard to tell how alive it still is? |
The project is alive. See the date for last commits, last release, last posts on forum. Why you think that it's not alive? |
Hello @decebals . Nice project :-) |
@elecomte-pro I merged the PR submitted by you. Can you explain in few words your use case, why do you need inherited marker on Extension annotation? (I wish that other people to understand the value of this modification). |
Thank you for the PR approbation and for your quick answer :-) I see two use cases (identified from an actual project)
|
Thank you for your detailed explanation. I updated the SNAPSHOT to include your modification. |
Feature-Idea: Auto-Detect plugin-updates.... If plugin-zip (or in my case plugin-jar) changes, unload/stop the already loaded/started plugin und load/start the new version. Scenario: With help of pf4j, I created a kind of small "application server". With help of plugins, I can easily extend the functionality. It's not onyl helpful wheile developing, but also for end-users who want to replace a plugin by just replacing the file on the disc without restarting the application. I'm currently evaluating of this feature can be achived by creating an own pluginmanager (which I already use for ma .jar extension plugins). |
The hot swap it's not so trivial to implement. I will try to take a look and start work at this concept. I have the same feature in pending for other project so maybe I will do something in this direction. Thanks for explanation. |
Indeed. Had a look at the code... It's not that easy, but should be possible. |
Another, maybe personal wish: stop using zip als plugin-file-container. Use JAR instead (makes life easier). And when using JAR: Don't extract it. Just use the JAR in combination with an UrlClassLoader. Would maybe make things wrt. hotswap also easier. I'm already using JAR (but still with zip extraction): https://github.com/tuxedo0801/KnxAutomationDaemon/tree/master/KnxAutomationDaemon/src/main/java/de/root1/kad/pf4j |
I don't know what to say. Your variant with jar as plugin container is OK for small plugins without dependencies. I don't want to be forced to use the maven shade plugin to pack my plugin with external libraries in a big uber-jar file. Maybe an idea is to add support for a such thing in core, in a minimalist way, and to have the possibility at runtime to specify the behavior (zip with or without extraction, jar, ...)
I am happy to see that you can customize the PF4J to satisfy you expectations.. |
My major wishes:
|
Somebody used a
I told in documentation that you can set
I don't understand these features. What they try to solve? |
Okay. However it would be nice to support it out-of-the-box, without extracting archives.
Some users just prefer scripts. Because of this, scripting was my original concept for plugin management (before I choose PF4J as plugin manager). Of course, not for "system plugins". |
I created #118. The status is work in progress. This feature will be available in the next version.
I am afraid that I don't understand. What kind of scripts? Can you describe a workflow on an example? |
RTFM? ;-)
.js = JavaScript?! And btw: I was the person who created the JarPluginManager. Today I'm not using pf4j any more, as it was no longer matching my requirements. I created a special "plugin framework", which was easier (most of the parts I copied from another project I made in the past) than adapting pf4j to my needs. It's (for me) much simpler, but totally addicted to my needs. |
Just a curiosity. What requirements you have that can not be implemented with pf4j? |
just my 2 cents |
@tuxedo0801 Thanks for explanations. |
Me? Of course, I have read the readme and looked through the code.
In this example, yes (I think it's logical, especially since Java 8). However, the point is the concept of scripting.
Okay, here is a dummy example. There is a statistician who is a bit familiar with JavaScript but have no or not much experience (and need) with Java, Maven, etc. He uses my application and want to put short script files into a folder. I, the developer define an extension point:
Formatters can be used in reports by choosing from a list. My user put a file
After this, he can use it in any report by choosing "Hash decoration" from the list. This can be accomplished by using a custom class loader which loads the .js file on-the-fly. |
No. |
@decebals @tuxedo0801 |
@turiot The problem is presented with details in this article. |
I know that, but my itention is to get the extension each time I want to use the plugin, in order to be dynamic (with a timed retry). |
Using pf4j-update you can add new plugins or update the existing ones. It's very useful when you want to publish plugins that will be available for all your applications instances. A kind of Eclipse Marketplace or Google Play. |
Closing this long running issue. @turiot can you please create a separate issue for the "hot swap" feature. |
Please see https://groups.google.com/forum/#!topic/pf4j/JcdrRcFaVJs
The text was updated successfully, but these errors were encountered: