net.sourceforge.acelogger.factory
Class AppenderFactory

java.lang.Object
  extended by net.sourceforge.acelogger.factory.AppenderFactory

public final class AppenderFactory
extends Object

Factory for managing instances of configured appenders.

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

Method Summary
static Appender getAppender(String identifier)
          Obtains a properly configured appender for the given identifier.
static Appender getDefaultAppender()
          Returns the default appender of this factory, the one used when no appender is found for a given identifier.
static List<Appender> getRegisteredAppenders()
          Returns a list of all appenders registered in this factory.
static Appender registerAppender(Appender appender)
          Registers an appender within this factory.
static Appender setDefaultAppender(Appender defaultAppender)
          Sets the default appender of this factory, the one used when no appender is found for a given identifier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAppender

public static Appender getAppender(String identifier)
Obtains a properly configured appender for the given identifier.

Parameters:
identifier - The identifier of the intended appender.
Returns:
A properly configured appender for the given identifier. If the identifier is not found, then the default appender is returned.
Since:
1.0.0
See Also:
getDefaultAppender()

setDefaultAppender

public static Appender setDefaultAppender(Appender defaultAppender)
Sets the default appender of this factory, the one used when no appender is found for a given identifier.

Parameters:
defaultAppender - The appender that will be used as the default one from now.
Returns:
The previous default appender.
Since:
1.0.0

getDefaultAppender

public static Appender getDefaultAppender()
Returns the default appender of this factory, the one used when no appender is found for a given identifier.

Returns:
The default appender.
Since:
1.0.0

getRegisteredAppenders

public static List<Appender> getRegisteredAppenders()
Returns a list of all appenders registered in this factory.

Returns:
A list of appenders.
Since:
1.0.0

registerAppender

public static Appender registerAppender(Appender appender)
Registers an appender within this factory. The mapped identifier will be the appenders identifier.

Parameters:
appender - The appender to be registered.
Returns:
The default appender if there was no previous mapping for the identifier or the previous configured appender otherwise.
Since:
1.0.0
See Also:
getDefaultAppender()


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