org.apache.log.output
Class AbstractWrappingTarget

java.lang.Object
  extended byorg.apache.log.output.AbstractTarget
      extended byorg.apache.log.output.AbstractWrappingTarget
All Implemented Interfaces:
Closeable, ErrorAware, LogTarget
Direct Known Subclasses:
AsyncLogTarget

public abstract class AbstractWrappingTarget
extends AbstractTarget

Abstract base class for targets that wrap other targets. The class provides functionality for optionally closing a wrapped target that implements org.apache.log.util.Closeable.

Author:
Avalon Development Team
See Also:
Closeable

Constructor Summary
AbstractWrappingTarget(LogTarget logTarget)
          Creation of a new wrapping log target.
AbstractWrappingTarget(LogTarget logTarget, boolean closeWrappedTarget)
          Creation of a new wrapping log target.
 
Method Summary
 void close()
          Shutdown target.
protected  LogTarget getLogTarget()
          Return the target for subclasses
 
Methods inherited from class org.apache.log.output.AbstractTarget
doProcessEvent, getErrorHandler, isOpen, open, processEvent, setErrorHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractWrappingTarget

public AbstractWrappingTarget(LogTarget logTarget,
                              boolean closeWrappedTarget)
Creation of a new wrapping log target.

Parameters:
logTarget - the underlying target
closeWrappedTarget - boolean flag indicating whether the wrapped log target should be closed when this target is closed. Note: This flag has no effect unless the underlying target implements org.apache.log.util.Closeable.
See Also:
Closeable

AbstractWrappingTarget

public AbstractWrappingTarget(LogTarget logTarget)
Creation of a new wrapping log target. The underlying log target will not be closed when this target is closed.

Parameters:
logTarget - the underlying target
Method Detail

close

public void close()
Description copied from class: AbstractTarget
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

getLogTarget

protected final LogTarget getLogTarget()
Return the target for subclasses



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