* RouterConsoleRunner:

- Prep for ClientApp interface by storing context in a field,
      shuffle around what's static and what's not
      (ticket #347)
    - Remove ports from port mapper on shutdown, other changes to
      track actual ports better
      (ticket #731)
    - Hook in password manager using MD5, untested.
      (ticket #731)
This commit is contained in:
zzz
2012-10-13 13:06:22 +00:00
parent a475a912e6
commit 0b897fdc98
6 changed files with 101 additions and 93 deletions

View File

@ -6,7 +6,7 @@ import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import net.i2p.I2PAppContext;
import net.i2p.router.RouterContext;
import net.i2p.util.FileUtil;
import net.i2p.util.SecureDirectory;
@ -51,7 +51,7 @@ public class WebAppStarter {
* adds and starts
* @throws just about anything, caller would be wise to catch Throwable
*/
static void startWebApp(I2PAppContext ctx, ContextHandlerCollection server,
static void startWebApp(RouterContext ctx, ContextHandlerCollection server,
String appName, String warPath) throws Exception {
File tmpdir = new SecureDirectory(ctx.getTempDir(), "jetty-work-" + appName + ctx.random().nextInt());
WebAppContext wac = addWebApp(ctx, server, appName, warPath, tmpdir);
@ -65,7 +65,7 @@ public class WebAppStarter {
* This is used only by RouterConsoleRunner, which adds all the webapps first
* and then starts all at once.
*/
static WebAppContext addWebApp(I2PAppContext ctx, ContextHandlerCollection server,
static WebAppContext addWebApp(RouterContext ctx, ContextHandlerCollection server,
String appName, String warPath, File tmpdir) throws IOException {
// Jetty will happily load one context on top of another without stopping
@ -103,7 +103,7 @@ public class WebAppStarter {
wac.setExtractWAR(false);
// this does the passwords...
RouterConsoleRunner.initialize(wac);
RouterConsoleRunner.initialize(ctx, wac);
// see WebAppConfiguration for info
String[] classNames = wac.getConfigurationClasses();