|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.vutbr.fit.racedetector.LogProducer
public class LogProducer
A simple tool for writing to specified file. Writing to the file can be potentionally slow and shouldn't be done by producing thread - therefore this job is delegated to LoggerThread controlled by the LogProducer.
Field Summary | |
---|---|
boolean |
isLoggerDone
|
java.lang.String |
POISON_PILL
Delimiter - if this delimiter is taken from the queue - file is closed and thread terminated. |
Constructor Summary | |
---|---|
LogProducer(java.io.BufferedWriter oFile)
Constructor prepare the LoggerThread. |
Method Summary | |
---|---|
void |
queueMsg(java.lang.String msg)
Add a message to the queue. |
void |
startLog()
Starts the LoggerThread. |
void |
waitTillEnd()
Wait for the end of LoggerThread which is writing the output file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final java.lang.String POISON_PILL
public volatile boolean isLoggerDone
Constructor Detail |
---|
public LogProducer(java.io.BufferedWriter oFile)
oFile
- Specified output fileMethod Detail |
---|
public void startLog()
public void queueMsg(java.lang.String msg)
msg
- Text to be written.public void waitTillEnd()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |