|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hdcookbook.grinxlet.DebugLog
public class DebugLog
A class to manage the debug log. The log is managed as static data; the constructor of this class is therefore private. When the debug log is active, a daemon thread runs that listens for telnet connections to view the log. The DebugLog class doesn't maintain any references outside of its own data in order to aid in xlet cleanup. When the surrounding xlet is destroyed, there might be a slight delay before the daemon thread terminates, but because the DebugLog class doesn't maintain any references to the xlet, there are no xlet references in the daemon thread's root set. This means that the rest of the xlet can be GC'd even if the daemon thread hasn't quite terminated yet.
Method Summary | |
---|---|
static void |
print(java.lang.String s)
Add s to the debug log, without a line break at the end. |
static void |
println(java.lang.String s)
Add s to the debug log, with a line break at the end. |
void |
run()
|
static void |
shutdownDebugListener()
|
static void |
startDebugListener()
Start the DebugLog listening for incoming telnet connections. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void startDebugListener()
java.lang.IllegalStateException
- if the DebugLog has been shut downpublic void run()
run
in interface java.lang.Runnable
public static void shutdownDebugListener()
startDebugListener()
public static void print(java.lang.String s)
public static void println(java.lang.String s)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |