/pf4j-spring

Spring-boot combines PF4J to implement plug-in definition, development, packaging, upload, load, unload, start, stop, enable, disable, use and other functions。spring-boot结合PF4J实现插件定义、开发、打包、上传、加载、卸载、启动、停止、启用、停用、使用等功能

Primary LanguageJavaApache License 2.0Apache-2.0

pf4j-spring

Spring-boot combines PF4J to implement plug-in definition, development, packaging, upload, load, unload, start, stop, enable, disable, use and other functions

Modules

Build & Run

git clone https://github.com/clyoudu/pf4j-spring.git

Then edit pf4j-spring/demo/manager/src/main/resources/application.yml, change spring.pf4j.path to another dir

cd pf4j-spring
mvn clean package
cd demo/manager/target
java -jar manager-1.0.0-SNAPSHOT.jar

Open http://localhost:8080, you will see page like this

Plugin Management:

  1. You can upload plugins jar in demo/plugins/*/target/*.jar
  2. Click 'Reload' button, then the plugin list will refresh automatically
  3. Load/Unload/Start/Stop/Enable/Disable/Delete operations are available for different plugin state

Business Feature:

  1. With plugin state changed, extension buttons list changed
  2. Click buttons, a message displayed as plugin extension expected

TODO

[] Managing & Using plugin through spring application context is not tested

Plugin Framework for Java

PF4J