]> source.dussan.org Git - pf4j.git/commitdiff
Allow disabled plugins to be unloaded and deleted 11/head
authorJames Moger <james.moger@gitblit.com>
Thu, 10 Apr 2014 19:29:02 +0000 (15:29 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 10 Apr 2014 19:29:02 +0000 (15:29 -0400)
pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java

index 47dce71033c55a28c8225338e1e42aa74fa2a4dc..c44787ec0c360eea15f39820f0f11f7f53920986 100644 (file)
  */
 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;
                }