org.apache.cocoon.spring.configurator.log4j
Class Log4JConfigurator

java.lang.Object
  extended byorg.apache.log4j.xml.DOMConfigurator
      extended byorg.apache.cocoon.spring.configurator.log4j.Log4JConfigurator
All Implemented Interfaces:
Configurator, InitializingBean

public class Log4JConfigurator
extends DOMConfigurator
implements InitializingBean

This is a configurator for log4j that supports variable substitution from the settings object.

Since:
1.0
Version:
$Id: Log4JConfigurator.java 587750 2007-10-24 02:35:22Z vgritsenko $

Field Summary
protected  Resource resource
          The configuration resources.
protected  org.apache.cocoon.configuration.Settings settings
          The settings object that is used to substitute variable values.
 
Fields inherited from interface org.apache.log4j.spi.Configurator
INHERITED, NULL
 
Constructor Summary
Log4JConfigurator()
           
 
Method Summary
 void afterPropertiesSet()
          This method is called after the instance is setup and before it is used.
 void setResource(Resource r)
          Set the configuration resource.
 void setSettings(org.apache.cocoon.configuration.Settings s)
          Inject the settings object.
protected  String subst(String value)
          Substitute variables in the string value.
 
Methods inherited from class org.apache.log4j.xml.DOMConfigurator
configure, configure, configure, configureAndWatch, configureAndWatch, doConfigure, doConfigure, doConfigure, doConfigure, doConfigure, doConfigure, findAppenderByName, findAppenderByReference, parse, parseAppender, parseCategory, parseCategoryFactory, parseChildrenOfLoggerElement, parseErrorHandler, parseFilters, parseLayout, parseLevel, parseRenderer, parseRoot, setParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

settings

protected org.apache.cocoon.configuration.Settings settings
The settings object that is used to substitute variable values.


resource

protected Resource resource
The configuration resources.

Constructor Detail

Log4JConfigurator

public Log4JConfigurator()
Method Detail

setSettings

public void setSettings(org.apache.cocoon.configuration.Settings s)
Inject the settings object.

Parameters:
s - The settings bean.

setResource

public void setResource(Resource r)
Set the configuration resource.

Parameters:
r - The resource.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
This method is called after the instance is setup and before it is used.

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception - If anything during configuration goes wrong an exception is thrown.
See Also:
InitializingBean.afterPropertiesSet()

subst

protected String subst(String value)
Substitute variables in the string value.

Parameters:
value - The value which might contain variable references.
Returns:
The new value without variables (if defined).
See Also:
DOMConfigurator.subst(java.lang.String)


Copyright © 1999-2008 The Apache Software Foundation. All Rights Reserved.