diff options
author | James Moger <james.moger@gitblit.com> | 2014-04-10 15:29:02 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-04-10 15:29:02 -0400 |
commit | e996639f4709bcdf9b4bfcdb72fd086ce61cfcdb (patch) | |
tree | 47ac2174c87469716afb3fd387c232b239a4e3ca | |
parent | 726c5cab70e30ca5de0615ca56054a8ea75316d2 (diff) | |
download | pf4j-e996639f4709bcdf9b4bfcdb72fd086ce61cfcdb.tar.gz pf4j-e996639f4709bcdf9b4bfcdb72fd086ce61cfcdb.zip |
Allow disabled plugins to be unloaded and deleted
-rw-r--r-- | pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java index 47dce71..c44787e 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java @@ -12,15 +12,16 @@ */ package ro.fortsoft.pf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import ro.fortsoft.pf4j.util.*; - import java.io.File; import java.io.FileFilter; import java.io.IOException; import java.util.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import ro.fortsoft.pf4j.util.*; + /** * Default implementation of the PluginManager interface. * @@ -372,7 +373,7 @@ public class DefaultPluginManager implements PluginManager { public boolean unloadPlugin(String pluginId) { try { PluginState pluginState = stopPlugin(pluginId); - if (PluginState.STOPPED != pluginState) { + if (PluginState.STARTED == pluginState) { return false; } @@ -486,7 +487,7 @@ public class DefaultPluginManager implements PluginManager { PluginWrapper pluginWrapper = getPlugin(pluginId); PluginState pluginState = stopPlugin(pluginId); - if (PluginState.STOPPED != pluginState) { + if (PluginState.STARTED == pluginState) { log.error("Failed to stop plugin {} on delete", pluginId); return false; } |