diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java index 865bc5f..3563cde 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java @@ -780,7 +780,7 @@ public class DefaultPluginManager implements PluginManager { // create the plugin wrapper log.debug("Creating wrapper for plugin '{}'", pluginPath); - PluginWrapper pluginWrapper = new PluginWrapper(pluginDescriptor, pluginPath, pluginClassLoader); + PluginWrapper pluginWrapper = new PluginWrapper(this, pluginDescriptor, pluginPath, pluginClassLoader); pluginWrapper.setPluginFactory(pluginFactory); pluginWrapper.setRuntimeMode(getRuntimeMode()); diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java index 45dbc1e..8046be5 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/PluginWrapper.java @@ -19,6 +19,7 @@ package ro.fortsoft.pf4j; */ public class PluginWrapper { + PluginManager pluginManager; PluginDescriptor descriptor; String pluginPath; PluginClassLoader pluginClassLoader; @@ -27,7 +28,8 @@ public class PluginWrapper { RuntimeMode runtimeMode; Plugin plugin; // cache - public PluginWrapper(PluginDescriptor descriptor, String pluginPath, PluginClassLoader pluginClassLoader) { + public PluginWrapper(PluginManager pluginManager, PluginDescriptor descriptor, String pluginPath, PluginClassLoader pluginClassLoader) { + this.pluginManager = pluginManager; this.descriptor = descriptor; this.pluginPath = pluginPath; this.pluginClassLoader = pluginClassLoader; @@ -35,6 +37,13 @@ public class PluginWrapper { pluginState = PluginState.CREATED; } + /** + * Returns the plugin manager. + */ + public PluginManager getPluginManager() { + return pluginManager; + } + /** * Returns the plugin descriptor. */