* 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
This commit is contained in:
jrandom
2004-08-23 21:32:24 +00:00
committed by zzz
parent 3c62a5d2b4
commit 54aa0fdb11
3 changed files with 38 additions and 6 deletions

View File

@ -4,6 +4,7 @@
<target name="build" depends="builddep, jar" /> <target name="build" depends="builddep, jar" />
<target name="builddep"> <target name="builddep">
<ant dir="../../../router/java/" target="build" /> <ant dir="../../../router/java/" target="build" />
<!-- <ant dir="../../systray/java/" target="build" /> -->
<!-- router will build core --> <!-- router will build core -->
</target> </target>
<target name="prepare"> <target name="prepare">
@ -15,8 +16,16 @@
<javac <javac
srcdir="./src" srcdir="./src"
debug="true" deprecation="on" source="1.3" target="1.3" debug="true" deprecation="on" source="1.3" target="1.3"
destdir="./build/obj" destdir="./build/obj">
classpath="../../../core/java/build/i2p.jar:../../../router/java/build/router.jar:../../jetty/jettylib/org.mortbay.jetty-jdk1.2.jar" /> <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>
<target name="jar" depends="compile"> <target name="jar" depends="compile">
<jar destfile="./build/routerconsole.jar" basedir="./build/obj" includes="**/*.class"> <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/jasper-runtime.jar" />
<pathelement location="../../jetty/jettylib/javax.servlet.jar" /> <pathelement location="../../jetty/jettylib/javax.servlet.jar" />
<pathelement location="../../jetty/jettylib/ant.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" /> <pathelement location="build/routerconsole.jar" />
</classpath> </classpath>
<arg value="-d" /> <arg value="-d" />
@ -88,10 +99,12 @@
</target> </target>
<target name="cleandep" depends="clean"> <target name="cleandep" depends="clean">
<!-- router will clean core --> <!-- router will clean core -->
<ant dir="../../../router/java/" target="distclean" /> <ant dir="../../../router/java/" target="cleandep" />
<!-- <ant dir="../../systray/java/" target="cleandep" /> -->
</target> </target>
<target name="distclean" depends="clean"> <target name="distclean" depends="clean">
<!-- router will clean core --> <!-- router will clean core -->
<ant dir="../../../router/java/" target="distclean" /> <ant dir="../../../router/java/" target="distclean" />
<!-- <ant dir="../../systray/java/" target="distclean" /> -->
</target> </target>
</project> </project>

View File

@ -1,6 +1,10 @@
package net.i2p.router.web; package net.i2p.router.web;
import net.i2p.router.ClientTunnelSettings; 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 * 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 (_action == null) return;
if ("Shutdown gracefully".equals(_action)) { if ("Shutdown gracefully".equals(_action)) {
WrapperManager.signalStopped(Router.EXIT_GRACEFUL);
_context.router().shutdownGracefully(); _context.router().shutdownGracefully();
addFormNotice("Graceful shutdown initiated"); addFormNotice("Graceful shutdown initiated");
} else if ("Shutdown immediately".equals(_action)) { } 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"); addFormNotice("Shutdown immediately! boom bye bye bad bwoy");
} else if ("Cancel graceful shutdown".equals(_action)) { } else if ("Cancel graceful shutdown".equals(_action)) {
_context.router().cancelGracefulShutdown(); _context.router().cancelGracefulShutdown();
addFormNotice("Graceful shutdown cancelled"); 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 { } else {
addFormNotice("Blah blah blah. whatever. I'm not going to " + _action); addFormNotice("Blah blah blah. whatever. I'm not going to " + _action);
} }

View File

@ -36,8 +36,8 @@
tray, allowing you to view the router's status (later on, I2P client applications 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). 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 /> 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="Show systray icon" />
<input type="submit" name="action" value="Disable systray icon" /> <input type="submit" name="action" value="Hide systray icon" />
<h4>Run on startup</h4> <h4>Run on startup</h4>
On the windows platform, you can control whether I2P is run on startup or not by 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 selecting one of the following options - I2P will install (or remove) a service
@ -48,6 +48,10 @@
as root.<br /> as root.<br />
<input type="submit" name="action" value="Run I2P on startup" /> <input type="submit" name="action" value="Run I2P on startup" />
<input type="submit" name="action" value="Don't 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> </form>
</div> </div>