|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.grid.jgrid.Logger
The purpose of the Logger class is to attach an executing Job to one or more LogListeners for logging messages and event to the client.
Field Summary | |
private java.lang.String |
jobId
The id of the Job to which this Logger is attached. |
private java.util.Set |
listeners
The list of LogListener to which this Logger logs messages and events |
Constructor Summary | |
Logger(java.lang.String jobId)
Creates a new instance of Logger |
Method Summary | |
static java.lang.String |
getExceptionAsString(java.lang.Exception e)
This method is a convenience method used to translate an Exception into a String that looks like what the VM prints out when an uncaught Exception causes a stack trace to be printed. |
void |
jobCheckpointed()
Notify the LogListener(s) that the Job has been checkpointed. |
void |
jobComplete()
Notify the LogListener(s) that the Job has completed normally. |
void |
jobFailed()
Notify the LogListener(s) that the Job has exited abnormally, either due to an uncaught Exception or because the Job was canceled. |
void |
jobResumed()
Notify the LogListener(s) that the Job has been resumed. |
void |
jobStarted()
Notify the LogListener(s) that the Job has been started. |
void |
jobStopped()
Notify the LogListener(s) that the Job has exited abnormally, either due to an uncaught Exception or because the Job was canceled. |
void |
jobSuspended()
Notify the LogListener(s) that the Job has been suspended. |
void |
logError(java.lang.String error)
Log an error message from the Job to the LogListener(s). |
void |
logMessage(java.lang.String message)
Log a message from the Job to the LogListener(s) |
void |
registerHandler(LogListener listener)
Register a new LogListener with this Logger |
void |
unregisterHandler(LogListener listener)
Unregister a LogListener with this Logger. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String jobId
private java.util.Set listeners
Constructor Detail |
public Logger(java.lang.String jobId)
jobId
- The id of the Job to which this Logger will be attachedMethod Detail |
public void registerHandler(LogListener listener)
listener
- The listener to registerpublic void unregisterHandler(LogListener listener)
listener
- The listener to unregisterpublic void logError(java.lang.String error)
error
- The text of the error messagepublic void logMessage(java.lang.String message)
message
- The text of the messagepublic void jobStopped()
public void jobCheckpointed()
public void jobComplete()
public void jobStarted()
public void jobFailed()
public void jobSuspended()
public void jobResumed()
public static java.lang.String getExceptionAsString(java.lang.Exception e)
e
- the Exception to convert to a String
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |