Log4j 1.3alpha-8

org.apache.log4j.joran.action
Class JndiSubstitutionPropertyAction

java.lang.Object
  |
  +--org.apache.log4j.spi.ComponentBase
        |
        +--org.apache.log4j.joran.action.Action
              |
              +--org.apache.log4j.joran.action.JndiSubstitutionPropertyAction
All Implemented Interfaces:
Component

public class JndiSubstitutionPropertyAction
extends Action

This action looks up JNDI properties specified in the configuration file and adds them to the Joran ExecutionContext. The element in the configuration file should have an attribute called "name". This attribute will be the key to the naming context lookup, as well as the key to the ExecutionContext properties. If a value is found whose name matches the given name, it will be placed in the ExecutionContext's properties.

Author:
Yoav Shapira

Fields inherited from class org.apache.log4j.joran.action.Action
ACTION_CLASS_ATTRIBUTE, CLASS_ATTRIBUTE, FILE_ATTRIBUTE, NAME_ATTRIBUTE, PATTERN_ATTRIBUTE, VALUE_ATTRIBUTE
 
Fields inherited from class org.apache.log4j.spi.ComponentBase
repository
 
Constructor Summary
JndiSubstitutionPropertyAction()
           
 
Method Summary
 void begin(org.apache.log4j.joran.spi.ExecutionContext ec, String name, Attributes attributes)
          Called when the parser first encounters an element.
 void end(org.apache.log4j.joran.spi.ExecutionContext ec, String name)
           
protected  void findNamingContext()
          Creates the naming context.
protected  Context getNamingContext()
          Returns the naming context for lookups.
 
Methods inherited from class org.apache.log4j.joran.action.Action
getColumnNumber, getLineNumber, toString
 
Methods inherited from class org.apache.log4j.spi.ComponentBase
getLogger, getLoggerRepository, getNonFloodingLogger, resetErrorCount, setLoggerRepository
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JndiSubstitutionPropertyAction

public JndiSubstitutionPropertyAction()
Method Detail

getNamingContext

protected Context getNamingContext()
Returns the naming context for lookups.
Returns:
The context (may be null)

findNamingContext

protected void findNamingContext()
                          throws NamingException
Creates the naming context. This is an expensive operation.
Throws:
NamingException - If an error occurs

begin

public void begin(org.apache.log4j.joran.spi.ExecutionContext ec,
                  String name,
                  Attributes attributes)
Description copied from class: Action
Called when the parser first encounters an element. The return value indicates whether child elements should be processed. If the returned value is 'false', then child elements are ignored.
Overrides:
begin in class Action
See Also:
Action.begin(org.apache.log4j.joran.spi.ExecutionContext, java.lang.String, org.xml.sax.Attributes)

end

public void end(org.apache.log4j.joran.spi.ExecutionContext ec,
                String name)
Overrides:
end in class Action
See Also:
Action.end(org.apache.log4j.joran.spi.ExecutionContext, java.lang.String)

Log4j 1.3alpha-8

Copyright © 2000-2006 Apache Software Foundation.
Licensed under the Apache License, Version 2.0.