I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 54aa0fdb authored by jrandom's avatar jrandom Committed by zzz
Browse files

* add "dump threads"

* hook in to the service manager and let it know we're exiting gracefully (when appropriate)
* commented out but generally functional systray integration.  i cant get it to build sometimes though, something is b0rking up
parent 3c62a5d2
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
<target name="build" depends="builddep, jar" />
<target name="builddep">
<ant dir="../../../router/java/" target="build" />
<!-- <ant dir="../../systray/java/" target="build" /> -->
<!-- router will build core -->
</target>
<target name="prepare">
......@@ -15,8 +16,16 @@
<javac
srcdir="./src"
debug="true" deprecation="on" source="1.3" target="1.3"
destdir="./build/obj"
classpath="../../../core/java/build/i2p.jar:../../../router/java/build/router.jar:../../jetty/jettylib/org.mortbay.jetty-jdk1.2.jar" />
destdir="./build/obj">
<classpath>
<pathelement location="../../../core/java/build/i2p.jar" />
<pathelement location="../../../router/java/build/router.jar" />
<pathelement location="../../jetty/jettylib/org.mortbay.jetty-jdk1.2.jar" />
<!-- <pathelement location="../../systray/java/build/lib/systray.jar" /> -->
<!-- <pathelement location="../../systray/java/lib/systray4j.jar" /> -->
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" /> <!-- we dont care if we're not on win32 -->
</classpath>
</javac>
</target>
<target name="jar" depends="compile">
<jar destfile="./build/routerconsole.jar" basedir="./build/obj" includes="**/*.class">
......@@ -44,6 +53,8 @@
<pathelement location="../../jetty/jettylib/jasper-runtime.jar" />
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
<pathelement location="../../jetty/jettylib/ant.jar" />
<pathelement location="../../systray/java/build/obj" />
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" /> <!-- we dont care if we're not on win32 -->
<pathelement location="build/routerconsole.jar" />
</classpath>
<arg value="-d" />
......@@ -88,10 +99,12 @@
</target>
<target name="cleandep" depends="clean">
<!-- router will clean core -->
<ant dir="../../../router/java/" target="distclean" />
<ant dir="../../../router/java/" target="cleandep" />
<!-- <ant dir="../../systray/java/" target="cleandep" /> -->
</target>
<target name="distclean" depends="clean">
<!-- router will clean core -->
<ant dir="../../../router/java/" target="distclean" />
<!-- <ant dir="../../systray/java/" target="distclean" /> -->
</target>
</project>
package net.i2p.router.web;
import net.i2p.router.ClientTunnelSettings;
import net.i2p.router.Router;
//import net.i2p.apps.systray.SysTray;
import org.tanukisoftware.wrapper.WrapperManager;
/**
* Handler to deal with form submissions from the service config form and act
......@@ -14,14 +18,25 @@ public class ConfigServiceHandler extends FormHandler {
if (_action == null) return;
if ("Shutdown gracefully".equals(_action)) {
WrapperManager.signalStopped(Router.EXIT_GRACEFUL);
_context.router().shutdownGracefully();
addFormNotice("Graceful shutdown initiated");
} else if ("Shutdown immediately".equals(_action)) {
_context.router().shutdown();
WrapperManager.signalStopped(Router.EXIT_HARD);
_context.router().shutdown(Router.EXIT_HARD);
addFormNotice("Shutdown immediately! boom bye bye bad bwoy");
} else if ("Cancel graceful shutdown".equals(_action)) {
_context.router().cancelGracefulShutdown();
addFormNotice("Graceful shutdown cancelled");
} else if ("Dump threads".equals(_action)) {
WrapperManager.requestThreadDump();
addFormNotice("Threads dumped to logs/wrapper.log");
//} else if ("Show systray icon".equals(_action)) {
// SysTray.instance().show();
// addFormNotice("Systray icon enabled (if possible)");
//} else if ("Hide systray icon".equals(_action)) {
// SysTray.instance().hide();
// addFormNotice("Systray icon disabled");
} else {
addFormNotice("Blah blah blah. whatever. I'm not going to " + _action);
}
......
......@@ -36,8 +36,8 @@
tray, allowing you to view the router's status (later on, I2P client applications
will be able to integrate their own functionality into the system tray as well).
If you are on windows, you can either enable or disable that icon here. <br />
<input type="submit" name="action" value="Enable systray icon" />
<input type="submit" name="action" value="Disable systray icon" />
<input type="submit" name="action" value="Show systray icon" />
<input type="submit" name="action" value="Hide systray icon" />
<h4>Run on startup</h4>
On the windows platform, you can control whether I2P is run on startup or not by
selecting one of the following options - I2P will install (or remove) a service
......@@ -48,6 +48,10 @@
as root.<br />
<input type="submit" name="action" value="Run I2P on startup" />
<input type="submit" name="action" value="Don't run I2P on startup" />
<h4>Debugging</h4>
At times, it may be helpful to debug I2P by getting a thread dump. To do so,
please select the following option and review the thread dumped to logs/wrapper.log.
<input type="submit" name="action" value="Dump threads" />
</form>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment