aboutsummaryrefslogtreecommitdiffstats
path: root/demo/plugins
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2023-01-15 19:20:36 +0200
committerDecebal Suiu <decebal.suiu@gmail.com>2023-01-15 19:20:36 +0200
commit5fae38427d1985468b018775a956c290dc214420 (patch)
treebd5ceaf70a5116d230d89d01370e1e6731db92ab /demo/plugins
parentde63736b13a71c227c1dec95e8e39c95a3962870 (diff)
downloadpf4j-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.java15
-rw-r--r--demo/plugins/plugin2/src/main/java/org/pf4j/demo/hello/HelloPlugin.java10
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