velosurf.util
Class ServletLogWriter

java.lang.Object
  extended by java.io.Writer
      extended by velosurf.util.ServletLogWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable

public class ServletLogWriter
extends java.io.Writer

This class implements a writer towards the servlet log

Author:
Claude Brisson

Field Summary
protected  javax.servlet.ServletContext log
          the ServletContext object used to log
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
ServletLogWriter(javax.servlet.ServletContext log)
          builds a new ServletLogWriter
 
Method Summary
 void close()
          close the writer
 void flush()
          flush any pending output
 void write(char[] cbuf, int off, int len)
          writes an array of chars to the servlet log
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected javax.servlet.ServletContext log
the ServletContext object used to log

Constructor Detail

ServletLogWriter

public ServletLogWriter(javax.servlet.ServletContext log)
builds a new ServletLogWriter

Parameters:
log - ServletContext
Method Detail

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException
writes an array of chars to the servlet log

Specified by:
write in class java.io.Writer
Parameters:
cbuf - characters to write
off - offset in the array
len - number of characters to write
Throws:
java.io.IOException - thrown by underlying servlet logger

flush

public void flush()
           throws java.io.IOException
flush any pending output

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
Throws:
java.io.IOException - thrown by underlying servlet logger

close

public void close()
           throws java.io.IOException
close the writer

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
Throws:
java.io.IOException - thrown by underlying servlet logger


~ooOoo~