diff --git a/java/util/classes/org/mozilla/util/Debug.java b/java/util/classes/org/mozilla/util/Debug.java index 4d1f870bae73..68d694629eac 100644 --- a/java/util/classes/org/mozilla/util/Debug.java +++ b/java/util/classes/org/mozilla/util/Debug.java @@ -56,7 +56,7 @@ import java.util.Date; * *

* @author Keith Bernstein - * @version $Id: Debug.java,v 1.2 1999/11/06 02:25:55 dmose%mozilla.org Exp $ */ + * @version $Id: Debug.java,v 1.3 2002/04/12 22:57:18 edburns%acm.org Exp $ */ public class Debug extends Object { static public final String HELP_FILTER_STRING = "HELP"; @@ -77,6 +77,10 @@ public class Debug extends Object { static long startTime = 0L; static long lapTime = 0L; + public static boolean keepWaiting = true; + + + static { /** This code adds to the filters Vector from the * System.Properties variable named by PROPERTY_NAME @@ -97,6 +101,32 @@ public class Debug extends Object { } } +/** + +* Usage:

+ +* Place a call to this method in the earliest possible entry point of +* your servlet app. It will cause the app to enter into an infinite +* loop, sleeping until the static var keepWaiting is set to false. The +* idea is that you attach your debugger to the servlet, then, set a +* breakpont in this method. When it is hit, you use the debugger to set +* the keepWaiting class var to false. + +*/ + +public static void waitForDebugger() { + while (keepWaiting) { + try { + Thread.sleep(5000); + } + catch (InterruptedException e) { + System.out.println("DebugUtil.waitForDebugger(): Exception: " + + e.getMessage()); + } + } +} + + /** * Sets a debug filter, for future consumption by this class, as well as other * utility classes, like Log, etc.