Files
i2p.i2p/apps/routerconsole/java/src/net/i2p/router/web/PluginStopper.java
zzz c43b16cfbb * configclients.jsp:
- Always show start button for webapps and plugins
    * configclients.jsp, configupdate.jsp:
      - Fix submission when entering CR in a text box
    * Plugins:
      - Stop all plugins at shutdown
      - Log tweaks
    * WebApps:
      - Remove the WAC after stopping it
      - Stop a WAC before starting it to prevent dups
2010-03-29 21:20:48 +00:00

41 lines
899 B
Java

package net.i2p.router.web;
import net.i2p.router.RouterContext;
import net.i2p.util.Log;
/**
* Stop all plugins that are installed
*
* @since 0.7.13
* @author zzz
*/
public class PluginStopper extends PluginStarter {
public PluginStopper(RouterContext ctx) {
super(ctx);
}
@Override
public void run() {
stopPlugins(_context);
}
/**
* Stop all plugins
* (whether or not they were ever started)
*
* this shouldn't throw anything
*/
static void stopPlugins(RouterContext ctx) {
Log log = ctx.logManager().getLog(PluginStopper.class);
for (String app : getPlugins()) {
try {
stopPlugin(ctx, app);
} catch (Throwable e) {
if (log.shouldLog(Log.WARN))
log.warn("Failed to stop plugin: " + app, e);
}
}
}
}