From: Decebal Suiu Date: Tue, 13 Nov 2012 12:21:00 +0000 (+0200) Subject: stop started plugin in reverse order X-Git-Tag: release-0.3~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=525874fcde00ac814666cafcfdc3b6d83062742a;p=pf4j.git stop started plugin in reverse order --- diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java index 20358ec..1081526 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/DefaultPluginManager.java @@ -16,6 +16,7 @@ import java.io.File; import java.io.FilenameFilter; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -156,6 +157,8 @@ public class DefaultPluginManager implements PluginManager { * Stop all active plugins. */ public void stopPlugins() { + // stop started plugins in reverse order + Collections.reverse(startedPlugins); for (PluginWrapper pluginWrapper : startedPlugins) { try { LOG.info("Stop plugin '" + pluginWrapper.getDescriptor().getPluginId() + "'"); diff --git a/pf4j/src/main/java/ro/fortsoft/pf4j/DependencyResolver.java b/pf4j/src/main/java/ro/fortsoft/pf4j/DependencyResolver.java index 524d4cc..70c1b90 100644 --- a/pf4j/src/main/java/ro/fortsoft/pf4j/DependencyResolver.java +++ b/pf4j/src/main/java/ro/fortsoft/pf4j/DependencyResolver.java @@ -20,7 +20,6 @@ import org.slf4j.LoggerFactory; import ro.fortsoft.pf4j.util.DirectedGraph; - /** * @author Decebal Suiu */