Openfire 3.5.0 Javadoc

org.jivesoftware.util.log.output.io
Class StreamTarget

java.lang.Object
  extended by org.jivesoftware.util.log.output.AbstractTarget
      extended by org.jivesoftware.util.log.output.AbstractOutputTarget
          extended by org.jivesoftware.util.log.output.io.StreamTarget
All Implemented Interfaces:
ErrorAware, LogTarget
Direct Known Subclasses:
FileTarget

public class StreamTarget
extends AbstractOutputTarget

A basic target that writes to an OutputStream.

Author:
Peter Donald

Constructor Summary
StreamTarget(OutputStream outputStream, Formatter formatter)
          Constructor that writes to a stream and uses a particular formatter.
 
Method Summary
 void close()
          Shutdown target.
protected  void setOutputStream(OutputStream outputStream)
          Set the output stream.
protected  void shutdownStream()
          Shutdown output stream.
protected  void write(String data)
          Abstract method that will output event.
 
Methods inherited from class org.jivesoftware.util.log.output.AbstractOutputTarget
doProcessEvent, getFormatter, open, output, setFormatter
 
Methods inherited from class org.jivesoftware.util.log.output.AbstractTarget
error, getErrorHandler, isOpen, processEvent, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamTarget

public StreamTarget(OutputStream outputStream,
                    Formatter formatter)
Constructor that writes to a stream and uses a particular formatter.

Parameters:
outputStream - the OutputStream to send to
formatter - the Formatter to use
Method Detail

setOutputStream

protected void setOutputStream(OutputStream outputStream)
Set the output stream. Close down old stream and send tail if appropriate.

Parameters:
outputStream - the new OutputStream

write

protected void write(String data)
Abstract method that will output event.

Overrides:
write in class AbstractOutputTarget
Parameters:
data - the data to be output

close

public void close()
Shutdown target. Attempting to send to target after close() will cause errors to be logged.

Overrides:
close in class AbstractOutputTarget

shutdownStream

protected void shutdownStream()
Shutdown output stream.


Openfire 3.5.0 Javadoc

Copyright © 2003-2007 Jive Software.