diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2023-01-15 19:20:36 +0200 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2023-01-15 19:20:36 +0200 |
commit | 5fae38427d1985468b018775a956c290dc214420 (patch) | |
tree | bd5ceaf70a5116d230d89d01370e1e6731db92ab /demo/plugins | |
parent | de63736b13a71c227c1dec95e8e39c95a3962870 (diff) | |
download | pf4j-5fae38427d1985468b018775a956c290dc214420.tar.gz pf4j-5fae38427d1985468b018775a956c290dc214420.zip |
Relax Plugin construction (remove dependency on PluginWrapper)
Diffstat (limited to 'demo/plugins')
-rw-r--r-- | demo/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java | 15 | ||||
-rw-r--r-- | demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java | 10 |
2 files changed, 12 insertions, 13 deletions
diff --git a/demo/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java b/demo/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java index a0cecab..3064902 100644 --- a/demo/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java +++ b/demo/plugins/plugin1/src/main/java/org/pf4j/demo/welcome/WelcomePlugin.java @@ -16,27 +16,26 @@ package org.pf4j.demo.welcome; import org.apache.commons.lang.StringUtils; - -import org.pf4j.PluginWrapper; +import org.pf4j.Extension; import org.pf4j.RuntimeMode; +import org.pf4j.demo.api.DemoPlugin; import org.pf4j.demo.api.Greeting; -import org.pf4j.Extension; -import org.pf4j.Plugin; +import org.pf4j.demo.api.PluginContext; /** * @author Decebal Suiu */ -public class WelcomePlugin extends Plugin { +public class WelcomePlugin extends DemoPlugin { - public WelcomePlugin(PluginWrapper wrapper) { - super(wrapper); + public WelcomePlugin(PluginContext context) { + super(context); } @Override public void start() { log.info("WelcomePlugin.start()"); // for testing the development mode - if (RuntimeMode.DEVELOPMENT.equals(wrapper.getRuntimeMode())) { + if (RuntimeMode.DEVELOPMENT.equals(context.getRuntimeMode())) { log.info(StringUtils.upperCase("WelcomePlugin")); } } diff --git a/demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java b/demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java index 3b7c9ce..ed67878 100644 --- a/demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java +++ b/demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java @@ -16,19 +16,19 @@ package org.pf4j.demo.hello; import org.pf4j.Extension; -import org.pf4j.Plugin; -import org.pf4j.PluginWrapper; +import org.pf4j.demo.api.DemoPlugin; import org.pf4j.demo.api.Greeting; +import org.pf4j.demo.api.PluginContext; /** * A very simple plugin. * * @author Decebal Suiu */ -public class HelloPlugin extends Plugin { +public class HelloPlugin extends DemoPlugin { - public HelloPlugin(PluginWrapper wrapper) { - super(wrapper); + public HelloPlugin(PluginContext context) { + super(context); } @Override |