diff options
author | Decebal Suiu <decebal.suiu@gmail.com> | 2018-10-20 23:37:30 +0300 |
---|---|---|
committer | Decebal Suiu <decebal.suiu@gmail.com> | 2018-10-20 23:37:30 +0300 |
commit | 74865ee6da538e7133a1860124613e645388cd6b (patch) | |
tree | 1ca6b0f9cf934f878168fed8782ead6dcfa3d519 | |
parent | b2525e31b62bb19feb85a68736c75ba7f889e1f6 (diff) | |
download | pf4j-74865ee6da538e7133a1860124613e645388cd6b.tar.gz pf4j-74865ee6da538e7133a1860124613e645388cd6b.zip |
Resolve #242
-rw-r--r-- | pf4j/src/main/java/org/pf4j/AbstractPluginManager.java | 7 | ||||
-rw-r--r-- | pf4j/src/main/java/org/pf4j/Plugin.java | 13 |
2 files changed, 18 insertions, 2 deletions
diff --git a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java index f2578d8..4d4503f 100644 --- a/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java +++ b/pf4j/src/main/java/org/pf4j/AbstractPluginManager.java @@ -303,6 +303,13 @@ public abstract class AbstractPluginManager implements PluginManager { return false; } + try { + pluginWrapper.getPlugin().delete(); + } catch (PluginException e) { + log.error(e.getMessage(), e); + return false; + } + Path pluginPath = pluginWrapper.getPluginPath(); return pluginRepository.deletePluginPath(pluginPath); diff --git a/pf4j/src/main/java/org/pf4j/Plugin.java b/pf4j/src/main/java/org/pf4j/Plugin.java index 6233b44..b648b64 100644 --- a/pf4j/src/main/java/org/pf4j/Plugin.java +++ b/pf4j/src/main/java/org/pf4j/Plugin.java @@ -57,15 +57,24 @@ public class Plugin { } /** - * Start method is called by the application when the plugin is loaded. + * This method is called by the application when the plugin is started. + * See {@link PluginManager#startPlugin(String)}. */ public void start() throws PluginException { } /** - * Stop method is called by the application when the plugin is unloaded. + * This method is called by the application when the plugin is stopped. + * See {@link PluginManager#stopPlugin(String)}. */ public void stop() throws PluginException { } + /** + * This method is called by the application when the plugin is deleted. + * See {@link PluginManager#deletePlugin(String)}. + */ + public void delete() throws PluginException { + } + } |