Plugins: Order and reverse order plugin names for start/stop all cases.

This commit is contained in:
sponge
2012-03-19 12:37:39 +00:00
parent d1ed30e79c
commit 4ffbfce51e
3 changed files with 9 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import java.net.URLClassLoader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
@ -537,6 +538,7 @@ public class PluginStarter implements Runnable {
if (files[i].isDirectory())
rv.add(files[i].getName());
}
Collections.sort(rv); // ensure the list is in sorted order.
return rv;
}

View File

@ -1,5 +1,7 @@
package net.i2p.router.web;
import java.util.Collections;
import java.util.List;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
@ -27,7 +29,9 @@ public class PluginStopper extends PluginStarter {
*/
private static void stopPlugins(RouterContext ctx) {
Log log = ctx.logManager().getLog(PluginStopper.class);
for (String app : getPlugins()) {
List<String> pl = getPlugins();
Collections.reverse(pl); // reverse the order
for (String app : pl) {
if (isPluginRunning(app, ctx)) {
try {
stopPlugin(ctx, app);