diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java index cf81ee022..6d0a4faa9 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHandler.java @@ -1,7 +1,6 @@ package net.i2p.router.web; import java.io.File; -import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; @@ -13,7 +12,6 @@ import net.i2p.router.startup.ClientAppConfig; import net.i2p.router.startup.LoadClientAppsJob; import net.i2p.util.Log; -import org.mortbay.http.HttpListener; import org.mortbay.jetty.Server; /** @@ -180,16 +178,14 @@ public class ConfigClientsHandler extends FormHandler { addFormNotice(_("WebApp configuration saved successfully - restart required to take effect.")); } - // Big hack for the moment, not using properties for directory and port - // Go through all the Jetty servers, find the one serving port 7657, - // requested and add the .war to that one + /** + * Big hack for the moment, not using properties for directory and port + * Go through all the Jetty servers, find the one serving port 7657, + * requested and add the .war to that one + */ private void startWebApp(String app) { - Collection c = Server.getHttpServers(); - for (int i = 0; i < c.size(); i++) { - Server s = (Server) c.toArray()[i]; - HttpListener[] hl = s.getListeners(); - for (int j = 0; j < hl.length; j++) { - if (hl[j].getPort() == 7657) { + Server s = PluginStarter.getConsoleServer(); + if (s != null) { try { File path = new File(_context.getBaseDir(), "webapps"); path = new File(path, app + ".war"); @@ -199,8 +195,6 @@ public class ConfigClientsHandler extends FormHandler { addFormError(_("Failed to start") + ' ' + _(app) + " " + ioe + '.'); } return; - } - } } addFormError(_("Failed to find server.")); } diff --git a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java index acef26f72..3633a5335 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java @@ -68,6 +68,25 @@ public class ConfigClientsHelper extends HelperBase { return buf.toString(); } + public String getForm3() { + StringBuilder buf = new StringBuilder(1024); + buf.append("
| " + _("Plugin") + " | " + _("Run at Startup?") + " | " + _("Start Now") + " | " + _("Description") + " |
|---|
+ <%=intl._("The plugins listed below are started by the webConsole client and run in the same JVM as the router. They are usually web applications accessible through the router console.")%> +
+
<%=intl._("To install a plugin, enter the URL to download the plugin from:")%>
diff --git a/router/java/src/net/i2p/router/RouterContext.java b/router/java/src/net/i2p/router/RouterContext.java
index dfa9d7c21..b4fa75381 100644
--- a/router/java/src/net/i2p/router/RouterContext.java
+++ b/router/java/src/net/i2p/router/RouterContext.java
@@ -62,7 +62,7 @@ public class RouterContext extends I2PAppContext {
private Calculator _capacityCalc;
- private static List _contexts = new ArrayList(1);
+ private static List