org.apache.log.output
Class AbstractOutputTarget

java.lang.Object
  extended byorg.apache.log.output.AbstractTarget
      extended byorg.apache.log.output.AbstractOutputTarget
All Implemented Interfaces:
Closeable, ErrorAware, LogTarget
Direct Known Subclasses:
DatagramOutputTarget, NullOutputLogTarget, ServletOutputLogTarget, SMTPOutputLogTarget, SocketOutputTarget, StreamTarget, WriterTarget

public abstract class AbstractOutputTarget
extends AbstractTarget

Abstract output target. Any new output target that is writing to a single connected resource should extend this class directly or indirectly.

Author:
Avalon Development Team, Peter Donald

Constructor Summary
AbstractOutputTarget()
          Parameterless constructor.
AbstractOutputTarget(Formatter formatter)
          Creation of a new abstract output target instance.
 
Method Summary
 void close()
          Shutdown target.
protected  void doProcessEvent(LogEvent event)
          Process a log event.
protected  Formatter getFormatter()
          Returns the Formatter.
protected  void open()
          Startup log session.
protected  void write(java.lang.String data)
          Abstract method to write data.
 
Methods inherited from class org.apache.log.output.AbstractTarget
getErrorHandler, isOpen, processEvent, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOutputTarget

public AbstractOutputTarget()
Parameterless constructor.


AbstractOutputTarget

public AbstractOutputTarget(Formatter formatter)
Creation of a new abstract output target instance.

Parameters:
formatter - the formatter to apply
Method Detail

getFormatter

protected Formatter getFormatter()
Returns the Formatter.


write

protected void write(java.lang.String data)
Abstract method to write data.

Parameters:
data - the data to be output

doProcessEvent

protected void doProcessEvent(LogEvent event)
Process a log event.

Specified by:
doProcessEvent in class AbstractTarget
Parameters:
event - the event to process

open

protected void open()
Startup log session.

Overrides:
open in class AbstractTarget

close

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

Specified by:
close in interface Closeable
Overrides:
close in class AbstractTarget


Copyright © 1997-2005 The Apache Software Foundation. All Rights Reserved.