Logback API
Version 0.9.8

ch.qos.logback.core.spi
Class AppenderAttachableImpl<E>

java.lang.Object
  extended by ch.qos.logback.core.spi.AppenderAttachableImpl<E>
All Implemented Interfaces:
AppenderAttachable<E>

public class AppenderAttachableImpl<E>
extends Object
implements AppenderAttachable<E>

A straightforward implementation of the AppenderAttachable interface.

Author:
Ceki Gülcü

Constructor Summary
AppenderAttachableImpl()
           
 
Method Summary
 void addAppender(Appender<E> newAppender)
          Attach an appender.
 int appendLoopOnAppenders(E e)
          Call the doAppend method on all attached appenders.
 void detachAndStopAllAppenders()
          Remove and stop all previously attached appenders.
 boolean detachAppender(Appender appender)
          Remove the appender passed as parameter form the list of attached appenders.
 Appender<E> detachAppender(String name)
          Remove the appender with the name passed as parameter form the list of appenders.
 Appender<E> getAppender(String name)
          Look for an attached appender named as name.
 boolean isAttached(Appender appender)
          Returns true if the specified appender is in the list of attached appenders, false otherwise.
 Iterator iteratorForAppenders()
          Get all attached appenders as an Enumeration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppenderAttachableImpl

public AppenderAttachableImpl()
Method Detail

addAppender

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

Specified by:
addAppender in interface AppenderAttachable<E>

appendLoopOnAppenders

public int appendLoopOnAppenders(E e)
Call the doAppend method on all attached appenders.


iteratorForAppenders

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

Specified by:
iteratorForAppenders in interface AppenderAttachable<E>
Returns:
Enumeration An enumeration of attached appenders.

getAppender

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

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

Specified by:
getAppender in interface AppenderAttachable<E>

isAttached

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

Specified by:
isAttached in interface AppenderAttachable<E>
Since:
1.2

detachAndStopAllAppenders

public void detachAndStopAllAppenders()
Remove and stop all previously attached appenders.

Specified by:
detachAndStopAllAppenders in interface AppenderAttachable<E>

detachAppender

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

Specified by:
detachAppender in interface AppenderAttachable<E>

detachAppender

public Appender<E> detachAppender(String name)
Remove the appender with the name passed as parameter form the list of appenders.

Specified by:
detachAppender in interface AppenderAttachable<E>

Logback API
Version 0.9.8

Copyright © 2005-2008 QOS.ch. All Rights Reserved.