|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.lang.Thread
net.spy.SpyThread
net.spy.log.SpyLogFlusher
SpyLogFlusher does the actual work of SpyLog. This is where the log queue is flushed and placed in permanent storage.
By default, log entries are written to the file described in the
variable logfile.
Classes overriding this will be most interested in the protected method
doFlush(). doFlush is called on a given interval when it's time to
flush the logs. The logs are available via a SpyLog object called
``log_object.'' To get a list of all log entries that need to be
flushed, the following piece of code may be executed:
Vector v = log_object.flush();
| Field Summary | |
String |
logfile
Path to the logfile. |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
SpyLogFlusher(String name)
Get a SpyFlusher for the given queue. |
|
SpyLogFlusher(String name,
ThreadGroup t)
Get a SpyFlusher for the given queue in the given ThreadGroup |
|
| Method Summary | |
void |
close()
Stop was taken and deprecated by those fools at Javasoft. |
protected void |
configure()
Do additional configuration stuff here. |
protected void |
doFlush()
This method should writes the log entries to their final destination. |
protected void |
finalize()
|
protected Vector |
flush()
Return the current queue of things to be logged |
long |
getSleepTime()
Get the current sleep time. |
int |
queueSize()
Get the current size of the queue. |
void |
run()
Periodically process the log queue. |
protected void |
setSleepTime(long sleepTime)
Set the sleep time between flushes. |
String |
toString()
Get a string describing this thingy. |
| Methods inherited from class net.spy.SpyThread |
getLogger |
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, yield |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public String logfile
| Constructor Detail |
public SpyLogFlusher(String name)
public SpyLogFlusher(String name,
ThreadGroup t)
| Method Detail |
protected void setSleepTime(long sleepTime)
public long getSleepTime()
public String toString()
protected void configure()
protected Vector flush()
public int queueSize()
protected void doFlush()
throws Exception
Exceptionpublic void close()
public void run()
protected void finalize()
throws Throwable
Throwable
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||