Package org.apache.log.output
Class AbstractWrappingTarget
java.lang.Object
org.apache.log.output.AbstractTarget
org.apache.log.output.AbstractWrappingTarget
- All Implemented Interfaces:
ErrorAware
,LogTarget
,Closeable
- Direct Known Subclasses:
AsyncLogTarget
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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractWrappingTarget
(LogTarget logTarget) Creation of a new wrapping log target.AbstractWrappingTarget
(LogTarget logTarget, boolean closeWrappedTarget) Creation of a new wrapping log target. -
Method Summary
Methods inherited from class org.apache.log.output.AbstractTarget
doProcessEvent, getErrorHandler, isOpen, open, processEvent, setErrorHandler
-
Field Details
-
m_closeWrapped
private final boolean m_closeWrapped -
m_wrappedLogTarget
-
-
Constructor Details
-
AbstractWrappingTarget
Creation of a new wrapping log target.- Parameters:
logTarget
- the underlying targetcloseWrappedTarget
- 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 implementsorg.apache.log.util.Closeable
.- See Also:
-
AbstractWrappingTarget
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 Details
-
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 interfaceCloseable
- Overrides:
close
in classAbstractTarget
-
getLogTarget
Return the target for subclasses
-