net.sourceforge.acelogger.appender
Class MultipleAppender

java.lang.Object
  extended by net.sourceforge.acelogger.appender.BaseAppender
      extended by net.sourceforge.acelogger.appender.MultipleAppender
All Implemented Interfaces:
Appender, Identifiable

public class MultipleAppender
extends BaseAppender

An implementation of Appender used as a Multiplexer. This class should be used to append a log call to various appenders.

Since:
1.0.0
Version:
1.0.0
Author:
Zardi (https://sourceforge.net/users/daniel_zardi)

Constructor Summary
MultipleAppender(String identifier)
          Constructs a new MultipleAppender with the supplied identifier that will multiplex its calls to nowhere.
MultipleAppender(String identifier, Collection<Appender> appenders)
          Constructs a new MultipleAppender with the supplied identifier that will multiplex its calls to each appender in the supplied collection.
 
Method Summary
 boolean addAllAppenders(Collection<Appender> appenders)
          Adds each appender in a collection to this multiplexer.
 boolean addAppender(Appender appender)
          Adds an appender to this multiplexer.
protected  Runnable appendLogProcess(LogEvent call)
          Defines the process used to append a log call.
 List<Appender> getAppenders()
          Gets the appenders registered in this multiple appender.
 boolean removeAppender(Appender appender)
          Removes an appender from this multiplexer.
 void setAppenders(Collection<Appender> appenders)
          Sets the appenders registered in this multiple appender.
 
Methods inherited from class net.sourceforge.acelogger.appender.BaseAppender
appendFooter, appendFooterProcess, appendHeader, appendHeaderProcess, appendLog, close, closeProcess, formatLogCall, getExecutor, getFormatter, getIdentifier, getThreshold, initialize, open, openProcess, setThreshold
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultipleAppender

public MultipleAppender(String identifier)
Constructs a new MultipleAppender with the supplied identifier that will multiplex its calls to nowhere.

Parameters:
identifier - A string that identifies this appender.
Since:
1.0.0

MultipleAppender

public MultipleAppender(String identifier,
                        Collection<Appender> appenders)
Constructs a new MultipleAppender with the supplied identifier that will multiplex its calls to each appender in the supplied collection.

Parameters:
identifier - A string that identifies this appender.
appenders - The appenders where log calls will be multiplexed to.
Since:
1.0.0
Method Detail

getAppenders

public final List<Appender> getAppenders()
Gets the appenders registered in this multiple appender.

Returns:
An unmodifiable list containing the appenders currently registered.
Since:
1.0.0

setAppenders

public final void setAppenders(Collection<Appender> appenders)
Sets the appenders registered in this multiple appender.

Parameters:
appenders - A collection of appenders that will be registered in this multiple appender.
Since:
1.0.0

addAppender

public final boolean addAppender(Appender appender)
Adds an appender to this multiplexer.

Parameters:
appender - The appender that should be added to the multiplexer.
Returns:
True if the appender was added successfully; false otherwise.
Since:
1.0.0

addAllAppenders

public final boolean addAllAppenders(Collection<Appender> appenders)
Adds each appender in a collection to this multiplexer.

Parameters:
appenders - The appender collection that should be added to the multiplexer.
Returns:
True if the appender list was modified; false otherwise.
Since:
1.0.0

removeAppender

public final boolean removeAppender(Appender appender)
Removes an appender from this multiplexer.

Parameters:
appender - The appender that should be removed from this multiplexer.
Returns:
True if the element was removed; false otherwise.
Since:
1.0.0

appendLogProcess

protected Runnable appendLogProcess(LogEvent call)
Defines the process used to append a log call.

Specified by:
appendLogProcess in class BaseAppender
Parameters:
call - The call that will be logged.
Returns:
A Runnable indicating the process used to log this call.


Copyright © 2007-2010 The AceLogger Team. All Rights Reserved.