net.xoetrope.optional.log
Class XQueueLogWriter

java.lang.Object
  extended by net.xoetrope.optional.log.XQueueLogWriter
All Implemented Interfaces:
java.lang.Runnable, XLogWriter

public class XQueueLogWriter
extends java.lang.Object
implements XLogWriter, java.lang.Runnable

A background log writer using a queue to write to the output stream


Field Summary
protected  java.util.concurrent.BlockingQueue msqQ
           
protected  boolean useErrorStream
           
 
Constructor Summary
XQueueLogWriter()
          Construct a new writer
 
Method Summary
 void run()
           
 void setStream(boolean isError)
          Set the use of the error stream
 void writeLine(java.lang.String message)
          Write a line to the log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

msqQ

protected java.util.concurrent.BlockingQueue msqQ

useErrorStream

protected boolean useErrorStream
Constructor Detail

XQueueLogWriter

public XQueueLogWriter()
Construct a new writer

Method Detail

setStream

public void setStream(boolean isError)
Set the use of the error stream

Specified by:
setStream in interface XLogWriter

writeLine

public void writeLine(java.lang.String message)
Write a line to the log

Specified by:
writeLine in interface XLogWriter
Parameters:
message - the line to write

run

public void run()
Specified by:
run in interface java.lang.Runnable