org.apache.avalon.excalibur.logger.logkit
Class LogKitConfHelper

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.avalon.excalibur.logger.logkit.LogKitConfHelper
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled

public class LogKitConfHelper
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Disposable

Tie this object to a LoggerManagerTee, give it the Hierachy that LogKitAdapter operates upon and it will populate it from the Configuration object passed via configure(). Note: this class assumes that this is a new Hierarchy, freshly created with new Hierarchy() not populated before.

Since:
4.0
Version:
CVS $Revision: 1.6 $ $Date: 2004/03/10 13:54:51 $
Author:
Avalon Development Team

Field Summary
private  org.apache.avalon.framework.context.Context m_context
          The context object
private  org.apache.log.Hierarchy m_hierarchy
           
private  java.util.Set m_targets
          Set of log targets
 
Constructor Summary
LogKitConfHelper(org.apache.log.Hierarchy hierarchy)
           
 
Method Summary
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Populates the underlying Hierarchy.
 void contextualize(org.apache.avalon.framework.context.Context context)
          Reads a context object that will be supplied to the log target factory manager.
 void dispose()
          Closes all our LogTargets.
private  void setupLoggers(LogTargetManager targetManager, java.lang.String parentCategory, org.apache.avalon.framework.configuration.Configuration parentElement, boolean root, boolean defaultAdditive)
          Setup Loggers
private  LogTargetFactoryManager setupTargetFactoryManager(org.apache.avalon.framework.configuration.Configuration configuration)
          Setup a LogTargetFactoryManager
private  LogTargetManager setupTargetManager(org.apache.avalon.framework.configuration.Configuration configuration, LogTargetFactoryManager targetFactoryManager)
          Setup a LogTargetManager
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_hierarchy

private final org.apache.log.Hierarchy m_hierarchy

m_targets

private final java.util.Set m_targets
Set of log targets


m_context

private org.apache.avalon.framework.context.Context m_context
The context object

Constructor Detail

LogKitConfHelper

public LogKitConfHelper(org.apache.log.Hierarchy hierarchy)
Method Detail

contextualize

public final void contextualize(org.apache.avalon.framework.context.Context context)
                         throws org.apache.avalon.framework.context.ContextException
Reads a context object that will be supplied to the log target factory manager.

Specified by:
contextualize in interface org.apache.avalon.framework.context.Contextualizable
Parameters:
context - The context object.
Throws:
org.apache.avalon.framework.context.ContextException - if the context is malformed

configure

public final void configure(org.apache.avalon.framework.configuration.Configuration configuration)
                     throws org.apache.avalon.framework.configuration.ConfigurationException
Populates the underlying Hierarchy.

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Parameters:
configuration - The configuration object.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed

setupTargetFactoryManager

private final LogTargetFactoryManager setupTargetFactoryManager(org.apache.avalon.framework.configuration.Configuration configuration)
                                                         throws org.apache.avalon.framework.configuration.ConfigurationException
Setup a LogTargetFactoryManager

Parameters:
configuration - The configuration object.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed

setupTargetManager

private final LogTargetManager setupTargetManager(org.apache.avalon.framework.configuration.Configuration configuration,
                                                  LogTargetFactoryManager targetFactoryManager)
                                           throws org.apache.avalon.framework.configuration.ConfigurationException
Setup a LogTargetManager

Parameters:
configuration - The configuration object.
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed

setupLoggers

private final void setupLoggers(LogTargetManager targetManager,
                                java.lang.String parentCategory,
                                org.apache.avalon.framework.configuration.Configuration parentElement,
                                boolean root,
                                boolean defaultAdditive)
                         throws org.apache.avalon.framework.configuration.ConfigurationException
Setup Loggers

Parameters:
parentElement - The array object of configurations for categories.
root - shows if we're processing the root of the configuration
Throws:
org.apache.avalon.framework.configuration.ConfigurationException - if the configuration is malformed

dispose

public void dispose()
Closes all our LogTargets.

Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable