aboutsummaryrefslogtreecommitdiffstats
path: root/demo/plugins
diff options
context:
space:
mode:
authorDecebal Suiu <decebal.suiu@gmail.com>2023-01-30 20:36:47 +0200
committerGitHub <noreply@github.com>2023-01-30 20:36:47 +0200
commit1f04209be1769e40c730cf2701926611e2f85435 (patch)
treed824ef5c8dd93264a4b99ed9bf3704540d73ce76 /demo/plugins
parentde63736b13a71c227c1dec95e8e39c95a3962870 (diff)
downloadpf4j-1f04209be1769e40c730cf2701926611e2f85435.tar.gz
pf4j-1f04209be1769e40c730cf2701926611e2f85435.zip
Relax Plugin construction (remove dependency on PluginWrapper) (#512)
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