epugh 2003/06/02 11:18:49
Modified: configuration/xdocs overview.xml
Log:
Provide a section on mixing configurations using CompositeConfiguration and using the
Configuration Factory.
Revision Changes Path
1.2 +17 -5 jakarta-commons-sandbox/configuration/xdocs/overview.xml
Index: overview.xml
===================================================================
RCS file: /home/cvs/jakarta-commons-sandbox/configuration/xdocs/overview.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- overview.xml 2 Jun 2003 18:01:01 -0000 1.1
+++ overview.xml 2 Jun 2003 18:18:49 -0000 1.2
@@ -39,6 +39,10 @@
<strong>DOM4JConfiguration</strong>
Takes values from an XML documentation using DOM4J.
</li>
+ <li>
+ <strong>JNDIConfiguration</strong>
+ Using a key in the JNDI tree, can retrieve values as configuration
properties.
+ </li>
</ul>
</p>
@@ -56,9 +60,10 @@
</p>
<p>
Using the ConfigurationFactory, (see the Junit testcase
"TestConfigurationFactory.java") you load
- up a digesterRules.xml file that specifies how to load up all the
Configuration objects. Here is
+ up a digester xml file that specifies how to load up all the Configuration
objects. Here is
a sample one using the default digesterRules.xml file:
- <pre>
+ <source>
+<![CDATA[
<?xml version="1.0" encoding="ISO-8859-1" ?>
<configuration>
@@ -66,12 +71,19 @@
<properties className="org.apache.commons.configuration.PropertiesConfiguration"
fileName="conf/test.properties"/>
<dom4j className="org.apache.commons.configuration.DOM4JConfiguration"
fileName="conf/test.xml"/>
</configuration>
-
- </pre>
+]]>
+ </source>
What this says is that we are loading up all JNDI values under
java:comp/env key, as well
as a properties file in conf/test.properties as well as a dom4j XML file in
conf/test.xml.
- Please inspect the test cases and the files in the conf/ directory for more
information.
+ Please inspect the test cases and the files in the conf/ directory for more
information on how
+ to structure your configuration xml file..
+ </p>
+ <p>
+ The order of precedence is first to last. So in the above example, if
there was a JNDI key
+ called test.precendence and another one in the XML file called
test.precedence, then the configuration
+ value from JNDI would be returned, not the one in the XML file. This
allows you to set up defaults
+ in properties/xml file, but override them from JNDI or even another
XML/properties file!
</p>
</subsection>
</section>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]