|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fido.frontend.FidoMessage
Singleton class used by classes in the FidoServer to send debug messages back to the client. This class contains all static methods that can be accessed without an instance of FidoMessage.
The FidoMessage class uses the name of Java thread as a key into a Hashtable that maps to a FidoSession object. The FidoSession object holds the PrintWriter that is used to communicate debug messages back to the client.
Each call from a client creates a new Java thread in the server. A call to bindFrontEnd() stores the name of the Java thread in the hash table with a new instance of FidoMessageWriter. Within the thread, a call to either log() or logException() will print the string to the PrintWriter for the client.
FidoMessageWriter
,
FidoSession
Method Summary | |
static void |
bindFrontEnd(java.io.PrintWriter out)
Binds the name of the current Java thread to a PrintWriter so any message genereated within this thread will be passed back to the client. |
static void |
bindFrontEnd(java.io.PrintWriter out,
java.lang.String htmlContext)
Binds the name of the current Java thread to a PrintWriter so any message genereated within this thread will be passed back to the client. |
static void |
log(java.lang.String msg)
Logs a string message back to the client. |
static void |
logException(java.lang.Exception ex)
Logs an exception back to the client. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void bindFrontEnd(java.io.PrintWriter out)
First, sets the name of the current Java thread within the server to the current time in milliseconds, converted to a string. This is used as a key into a hashtable to retrieve an instance of a FidoMessageWriter. There is one one FidoMessageWriter for each user connected to the server.
The PrintWriter parameter can be the stream passed to a servlet, as in the DebugFrontEnd, or System.out, which will print any message to the system console where the application server is running. This is used for debug programs such as ART.
out
- The PrintWriter class that will send the message
back to the client.FidoMessageWriter
public static void bindFrontEnd(java.io.PrintWriter out, java.lang.String htmlContext)
This method performs the same task as bindFrontEnd(PrintWriter), except an htmlContext is passed. This parameter is used to generate relative links for web pages, such as links to the help pages.
out
- The PrintWriter class that will send the message
back to the client.htmlContext
- The html context, which is the part of the
URL between the hostname and the sevlet which is running.bindFrontEnd(PrintWriter)
public static void log(java.lang.String msg)
msg
- String to pass back to the client.public static void logException(java.lang.Exception ex)
This is the method that uses the htmlContext from the constructor to reference the correct HTTP path to the help system.
This classes uses an HtmlExceptionWriter to convert the Exception.
ex
- Exception to pass back to the client.HtmlExceptionWriter
|
Fido Alpha 3.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |