org.codehaus.spice.loggerstore.stores
Class AbstractLoggerStore

java.lang.Object
  |
  +--org.codehaus.spice.loggerstore.stores.AbstractLoggerStore
All Implemented Interfaces:
LogEnabled, LoggerStore
Direct Known Subclasses:
ConsoleLoggerStore, Jdk14LoggerStore, Log4JLoggerStore, LogKitLoggerStore

public abstract class AbstractLoggerStore
extends Object
implements LoggerStore, LogEnabled

AbstractLoggerStore is an abstract implementation of LoggerStore for the functionality common to all Loggers.

Author:
Mauro Talevi

Constructor Summary
AbstractLoggerStore()
           
 
Method Summary
protected abstract  Logger createLogger(String name)
          Creates new Logger for the given category.
 void enableLogging(Logger logger)
          Provide a logger.
 Logger getLogger()
          Retrieves the root Logger from the store.
 Logger getLogger(String name)
          Retrieves a Logger hierarchy from the store for a given category name.
protected  Logger getRootLogger()
          Returns the root logger.
protected  void setRootLogger(Logger rootLogger)
          Sets the root Logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.spice.loggerstore.LoggerStore
close
 

Constructor Detail

AbstractLoggerStore

public AbstractLoggerStore()
Method Detail

enableLogging

public void enableLogging(Logger logger)
Provide a logger.

Specified by:
enableLogging in interface LogEnabled
Parameters:
logger - the logger

getLogger

public Logger getLogger()
                 throws Exception
Retrieves the root Logger from the store.

Specified by:
getLogger in interface LoggerStore
Returns:
the Logger
Throws:
Exception - if unable to retrieve Logger

getLogger

public Logger getLogger(String name)
                 throws Exception
Retrieves a Logger hierarchy from the store for a given category name.

Specified by:
getLogger in interface LoggerStore
Parameters:
name - the name of the logger.
Returns:
the Logger
Throws:
Exception - if unable to retrieve Logger

createLogger

protected abstract Logger createLogger(String name)
Creates new Logger for the given category. This is logger-implementation specific and will be implemented in concrete subclasses.


setRootLogger

protected final void setRootLogger(Logger rootLogger)
Sets the root Logger.


getRootLogger

protected final Logger getRootLogger()
Returns the root logger.

Returns:
the root logger.


Copyright © 2003 Codehaus. All Rights Reserved.