* 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
This commit is contained in:
zzz
2010-03-29 21:20:48 +00:00
parent 394903a8f0
commit c43b16cfbb
10 changed files with 102 additions and 24 deletions

View File

@ -43,9 +43,17 @@ public class WebAppStarter {
/**
* add but don't start
* This is used only by RouterConsoleRunner, which adds all the webapps first
* and then starts all at once.
*/
static WebApplicationContext addWebApp(I2PAppContext ctx, Server server, String appName, String warPath, File tmpdir) throws IOException {
// Jetty will happily load one context on top of another without stopping
// the first one, so we remove any previous one here
try {
stopWebApp(server, appName);
} catch (Throwable t) {}
WebApplicationContext wac = server.addWebApplication("/"+ appName, warPath);
tmpdir.mkdir();
wac.setTempDirectory(tmpdir);
@ -64,7 +72,7 @@ public class WebAppStarter {
}
/**
* stop it
* stop it and remove the context
* @throws just about anything, caller would be wise to catch Throwable
*/
static void stopWebApp(Server server, String appName) {
@ -74,6 +82,9 @@ public class WebAppStarter {
// false -> not graceful
wac.stop(false);
} catch (InterruptedException ie) {}
try {
server.removeContext(wac);
} catch (IllegalStateException ise) {}
}
/** see comments in ConfigClientsHandler */