Browse Source

Merge pull request #11 from gitblit/delete_disabled

Allow disabled plugins to be unloaded and deleted
pull/12/head
Decebal Suiu 11 years ago
parent
commit
1d1f3c3c34
  1. 13
      pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java

13
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;
}

Loading…
Cancel
Save