crazy paranoia to deal with errors referencing bad dll/.so files for the service wrapper / systray / etc

This commit is contained in:
jrandom
2004-08-26 03:12:52 +00:00
committed by zzz
parent fab3c0df3e
commit 18ff889b56

View File

@ -18,11 +18,19 @@ 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); try {
WrapperManager.signalStopped(Router.EXIT_GRACEFUL);
} catch (Throwable t) {
addFormError("Warning: unable to contact the service manager - " + t.getMessage());
}
_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)) {
WrapperManager.signalStopped(Router.EXIT_HARD); try {
WrapperManager.signalStopped(Router.EXIT_HARD);
} catch (Throwable t) {
addFormError("Warning: unable to contact the service manager - " + t.getMessage());
}
_context.router().shutdown(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)) {
@ -32,23 +40,35 @@ public class ConfigServiceHandler extends FormHandler {
_context.router().shutdown(Router.EXIT_HARD_RESTART); _context.router().shutdown(Router.EXIT_HARD_RESTART);
addFormNotice("Hard restart requested"); addFormNotice("Hard restart requested");
} else if ("Dump threads".equals(_action)) { } else if ("Dump threads".equals(_action)) {
WrapperManager.requestThreadDump(); try {
WrapperManager.requestThreadDump();
} catch (Throwable t) {
addFormError("Warning: unable to contact the service manager - " + t.getMessage());
}
addFormNotice("Threads dumped to logs/wrapper.log"); addFormNotice("Threads dumped to logs/wrapper.log");
} else if ("Show systray icon".equals(_action)) { } else if ("Show systray icon".equals(_action)) {
SysTray tray = SysTray.getInstance(); try {
if (tray != null) { SysTray tray = SysTray.getInstance();
tray.show(); if (tray != null) {
addFormNotice("Systray enabled"); tray.show();
} else { addFormNotice("Systray enabled");
addFormNotice("Systray not supported on this platform"); } else {
addFormNotice("Systray not supported on this platform");
}
} catch (Throwable t) {
addFormError("Warning: unable to contact the systray manager - " + t.getMessage());
} }
} else if ("Hide systray icon".equals(_action)) { } else if ("Hide systray icon".equals(_action)) {
SysTray tray = SysTray.getInstance(); try {
if (tray != null) { SysTray tray = SysTray.getInstance();
tray.hide(); if (tray != null) {
addFormNotice("Systray disabled"); tray.hide();
} else { addFormNotice("Systray disabled");
addFormNotice("Systray not supported on this platform"); } else {
addFormNotice("Systray not supported on this platform");
}
} catch (Throwable t) {
addFormError("Warning: unable to contact the systray manager - " + t.getMessage());
} }
} else { } else {
addFormNotice("Blah blah blah. whatever. I'm not going to " + _action); addFormNotice("Blah blah blah. whatever. I'm not going to " + _action);