JBoss STDIO 1.0.0.CR1

org.jboss.stdio
Class AbstractLoggingWriter

java.lang.Object
  extended by java.io.Writer
      extended by org.jboss.stdio.AbstractLoggingWriter
All Implemented Interfaces:
java.io.Closeable, java.io.Flushable, java.lang.Appendable
Direct Known Subclasses:
LoggingWriter

public abstract class AbstractLoggingWriter
extends java.io.Writer

Abstract base class for writers which log to a logger.


Field Summary
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
protected AbstractLoggingWriter()
          Construct a new instance.
 
Method Summary
 void close()
          
 void flush()
          
protected abstract  java.util.logging.Level getLevel()
          Get the level at which to log.
protected abstract  java.util.logging.Logger getLogger()
          Get the logger to use.
 void write(char[] cbuf, int off, int len)
          
 void write(int c)
          
 
Methods inherited from class java.io.Writer
append, append, append, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLoggingWriter

protected AbstractLoggingWriter()
Construct a new instance.

Method Detail

write

public void write(int c)
           throws java.io.IOException

Overrides:
write in class java.io.Writer
Throws:
java.io.IOException

write

public void write(char[] cbuf,
                  int off,
                  int len)
           throws java.io.IOException

Specified by:
write in class java.io.Writer
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException

Specified by:
flush in interface java.io.Flushable
Specified by:
flush in class java.io.Writer
Throws:
java.io.IOException

getLogger

protected abstract java.util.logging.Logger getLogger()
Get the logger to use.

Returns:
the logger

getLevel

protected abstract java.util.logging.Level getLevel()
Get the level at which to log.

Returns:
the level

close

public void close()
           throws java.io.IOException

Specified by:
close in interface java.io.Closeable
Specified by:
close in class java.io.Writer
Throws:
java.io.IOException

JBoss STDIO 1.0.0.CR1

Copyright © 2010 JBoss, a division of Red Hat, Inc.