org.codehaus.spice.loggerstore
Class Configurator

java.lang.Object
  |
  +--org.codehaus.spice.loggerstore.Configurator

public class Configurator
extends Object

Configurator is a collection of utility methods to create and configure LoggerStore objects of different types using configuration resources. LogKit, Log4J and JDK14 Loggers are supported. In the case of Log4J, both DOM and Property configuration types are supported.

Author:
Mauro Talevi

Field Summary
static String JDK14
          Constant used to define JDK14 type
static String LOG4J_DOM
          Constant used to define Log4J type with DOMConfigurator
static String LOG4J_PROPERTY
          Constant used to define Log4J type with PropertyConfigurator
static String LOGKIT_EXCALIBUR
          Constant used to define LogKit type with Excalibur configuration
static String LOGKIT_SIMPLE
          Constant used to define LogKit type with Simple configuration
 
Constructor Summary
Configurator()
           
 
Method Summary
static LoggerStore createLoggerStore(String configuratorType, InputStream resource)
          Create and configure a LoggerStore from a specified configuration resource.
static LoggerStore createLoggerStore(String configuratorType, String resource)
          Create and configure a LoggerStore from a specified configuration resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG4J_DOM

public static final String LOG4J_DOM
Constant used to define Log4J type with DOMConfigurator

See Also:
Constant Field Values

LOG4J_PROPERTY

public static final String LOG4J_PROPERTY
Constant used to define Log4J type with PropertyConfigurator

See Also:
Constant Field Values

LOGKIT_EXCALIBUR

public static final String LOGKIT_EXCALIBUR
Constant used to define LogKit type with Excalibur configuration

See Also:
Constant Field Values

LOGKIT_SIMPLE

public static final String LOGKIT_SIMPLE
Constant used to define LogKit type with Simple configuration

See Also:
Constant Field Values

JDK14

public static final String JDK14
Constant used to define JDK14 type

See Also:
Constant Field Values
Constructor Detail

Configurator

public Configurator()
Method Detail

createLoggerStore

public static LoggerStore createLoggerStore(String configuratorType,
                                            String resource)
                                     throws Exception
Create and configure a LoggerStore from a specified configuration resource.

Parameters:
configuratorType - the type of the configurator
resource - the String encoding the path of the configuration resource
Returns:
the configured LoggerStore
Throws:
Exception - if unable to create the LoggerStore

createLoggerStore

public static LoggerStore createLoggerStore(String configuratorType,
                                            InputStream resource)
                                     throws Exception
Create and configure a LoggerStore from a specified configuration resource.

Parameters:
configuratorType - the type of the configurator
resource - the InputStream of the configuration resource
Returns:
the configured LoggerStore
Throws:
Exception - if unable to create the LoggerStore


Copyright © 2003 Codehaus. All Rights Reserved.