org.openeai.config
Class LoggerConfig

java.lang.Object
  extended by org.openeai.OpenEaiObject
      extended by org.openeai.config.EnterpriseConfigurationObjectImpl
          extended by org.openeai.config.LoggerConfig
All Implemented Interfaces:
EnterpriseConfigurationObject

public class LoggerConfig
extends EnterpriseConfigurationObjectImpl
implements EnterpriseConfigurationObject

A LoggerConfig is a wrapper class that takes information stored in an OpenEAI Deployment document (LoggerConfig Element) and stores it in a Java object. Then the properties associated with the LoggerConfig are used to initialize the static logger that all decendants of OpenEaiObject inherits. If an object isn't a subclass of OpenEaiObject then it can use these properties to initialize a log4j Category object itself. These properties are specified by Log4J.

Configuration Parameters:

These are the configuration parameters specified by the LoggerConfig Element in the Deployment document. NOTE: The properties that need to be specified are dictated by Log4J since that's the logging framework used by OpenEAI. The parameters listed below are for a typical OpenEAI application. For more information regarding Log4J properties, consult that documentation.

Name Required Description
name yes Name of the LoggerConfig object. This is how the object will be stored in AppConfig and should be unique. This allows developers to conveniently categorize Loggers for an application if they wish to use multiple loggers configured differently. Generally, the logger inherited by all OpenEaiObject decendants sufices.
ConfigClass no* Name of the configuration class that wraps the config Element (this class)
Property yes (at least one) This is a pair of Elements that tells the LoggerConfig object what Java Properties object to build that will be used to initialize the Log4J Category. It consists of PropertyName and a PropertyValue Elements that are stored in the Java Properties object.

Version:
3.0 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
LoggerConfig()
          Constructor
LoggerConfig(org.jdom.Element configElement)
           
LoggerConfig(java.lang.String configDocUrl, java.lang.String loggerName)
           
 
Method Summary
 void init(org.jdom.Element configElement)
          Implements the init(Element) method that all EnterpriseConfiguration objects must implement.
 
Methods inherited from class org.openeai.config.EnterpriseConfigurationObjectImpl
addProperty, getAppName, getConfigDoc, getConfigElementByAttributeValue, getElementByAttributeValue, getName, getType, getValidation, refresh, setAppName, setConfigDoc, setName, setRefresh, setType, setValidation
 
Methods inherited from class org.openeai.OpenEaiObject
getDebug, getFromAddr, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openeai.config.EnterpriseConfigurationObject
getAppName, getProperties, refresh, setAppName
 

Constructor Detail

LoggerConfig

public LoggerConfig()
Constructor


LoggerConfig

public LoggerConfig(java.lang.String configDocUrl,
                    java.lang.String loggerName)
             throws EnterpriseConfigurationObjectException
Throws:
EnterpriseConfigurationObjectException

LoggerConfig

public LoggerConfig(org.jdom.Element configElement)
             throws EnterpriseConfigurationObjectException
Throws:
EnterpriseConfigurationObjectException
Method Detail

init

public void init(org.jdom.Element configElement)
          throws EnterpriseConfigurationObjectException
Implements the init(Element) method that all EnterpriseConfiguration objects must implement. This init method takes the Configuration element passed in and pulls out configuration information specific to the static 'logger' being initialized. When AppConfig detects that it's configuring the 'logger' it builds this config object and passes the properties from it to the initializeLog4j method in OpenEaiObject.

Specified by:
init in interface EnterpriseConfigurationObject
Overrides:
init in class EnterpriseConfigurationObjectImpl
Parameters:
configElement - Element the configuration element that AppConfig has pulled from the configuration document relevant to the EnterpriseConnectionPool being configured. Or, the element that was found in the init() method.
Throws:
EnterpriseConfigurationObjectException - if errors occur processing the configuration Element.


Copyright © 2002,2003 OpenEAI Software Foundation