Package org.apache.log4j.helpers
Class AppenderAttachableImpl
java.lang.Object
org.apache.log4j.helpers.AppenderAttachableImpl
- All Implemented Interfaces:
AppenderAttachable
A straightforward implementation of the
AppenderAttachable interface.- Since:
- version 0.9.1
- Author:
- Ceki Gülcü
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAppender(Appender newAppender) Attach an appender.intCall thedoAppendmethod on all attached appenders.Get all attached appenders as an Enumeration.getAppender(String name) Look for an attached appender named asname.booleanisAttached(Appender appender) Returnstrueif the specified appender is in the list of attached appenders,falseotherwise.voidRemove and close all previously attached appenders.voidremoveAppender(String name) Remove the appender with the name passed as parameter form the list of appenders.voidremoveAppender(Appender appender) Remove the appender passed as parameter form the list of attached appenders.
-
Constructor Details
-
AppenderAttachableImpl
public AppenderAttachableImpl()
-
-
Method Details
-
addAppender
Attach an appender. If the appender is already in the list in won't be added again.- Specified by:
addAppenderin interfaceAppenderAttachable
-
appendLoopOnAppenders
Call thedoAppendmethod on all attached appenders. -
getAllAppenders
Get all attached appenders as an Enumeration. If there are no attached appendersnullis returned.- Specified by:
getAllAppendersin interfaceAppenderAttachable- Returns:
- Enumeration An enumeration of attached appenders.
-
getAppender
Look for an attached appender named asname.Return the appender with that name if in the list. Return null otherwise.
- Specified by:
getAppenderin interfaceAppenderAttachable
-
isAttached
Returnstrueif the specified appender is in the list of attached appenders,falseotherwise.- Specified by:
isAttachedin interfaceAppenderAttachable- Since:
- 1.2
-
removeAllAppenders
public void removeAllAppenders()Remove and close all previously attached appenders.- Specified by:
removeAllAppendersin interfaceAppenderAttachable
-
removeAppender
Remove the appender passed as parameter form the list of attached appenders.- Specified by:
removeAppenderin interfaceAppenderAttachable
-
removeAppender
Remove the appender with the name passed as parameter form the list of appenders.- Specified by:
removeAppenderin interfaceAppenderAttachable
-