org.apache.log4j.helpers

Class AppenderAttachableImpl

public class AppenderAttachableImpl extends Object implements AppenderAttachable

A straightforward implementation of the {@link AppenderAttachable} interface.

Since: version 0.9.1

Author: Ceki Gülcü

Field Summary
protected VectorappenderList
Array of appenders.
Method Summary
voidaddAppender(Appender newAppender)
Attach an appender.
intappendLoopOnAppenders(LoggingEvent event)
Call the doAppend method on all attached appenders.
EnumerationgetAllAppenders()
Get all attached appenders as an Enumeration.
AppendergetAppender(String name)
Look for an attached appender named as name.
booleanisAttached(Appender appender)
Returns true if the specified appender is in the list of attached appenders, false otherwise.
voidremoveAllAppenders()
Remove and close all previously attached appenders.
voidremoveAppender(Appender appender)
Remove the appender passed as parameter form the list of attached appenders.
voidremoveAppender(String name)
Remove the appender with the name passed as parameter form the list of appenders.

Field Detail

appenderList

protected Vector appenderList
Array of appenders.

Method Detail

addAppender

public void addAppender(Appender newAppender)
Attach an appender. If the appender is already in the list in won't be added again.

appendLoopOnAppenders

public int appendLoopOnAppenders(LoggingEvent event)
Call the doAppend method on all attached appenders.

getAllAppenders

public Enumeration getAllAppenders()
Get all attached appenders as an Enumeration. If there are no attached appenders null is returned.

Returns: Enumeration An enumeration of attached appenders.

getAppender

public Appender getAppender(String name)
Look for an attached appender named as name.

Return the appender with that name if in the list. Return null otherwise.

isAttached

public boolean isAttached(Appender appender)
Returns true if the specified appender is in the list of attached appenders, false otherwise.

Since: 1.2

removeAllAppenders

public void removeAllAppenders()
Remove and close all previously attached appenders.

removeAppender

public void removeAppender(Appender appender)
Remove the appender passed as parameter form the list of attached appenders.

removeAppender

public void removeAppender(String name)
Remove the appender with the name passed as parameter form the list of appenders.
Copyright 2000-2005 Apache Software Foundation.