Return-Path:
X-Original-To: apmail-commons-commits-archive@minotaur.apache.org
Delivered-To: apmail-commons-commits-archive@minotaur.apache.org
Received: from mail.apache.org (hermes.apache.org [140.211.11.3])
by minotaur.apache.org (Postfix) with SMTP id 76C9A112D1
for ;
Thu, 19 Jun 2014 18:57:55 +0000 (UTC)
Received: (qmail 68849 invoked by uid 500); 19 Jun 2014 18:57:53 -0000
Delivered-To: apmail-commons-commits-archive@commons.apache.org
Received: (qmail 68770 invoked by uid 500); 19 Jun 2014 18:57:53 -0000
Mailing-List: contact commits-help@commons.apache.org; run by ezmlm
Precedence: bulk
List-Help:
List-Unsubscribe:
List-Post:
List-Id:
Reply-To: dev@commons.apache.org
Delivered-To: mailing list commits@commons.apache.org
Received: (qmail 68760 invoked by uid 99); 19 Jun 2014 18:57:53 -0000
Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2014 18:57:53 +0000
X-ASF-Spam-Status: No, hits=-2000.0 required=5.0
tests=ALL_TRUSTED
X-Spam-Check-By: apache.org
Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4)
by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2014 18:57:51 +0000
Received: from eris.apache.org (localhost [127.0.0.1])
by eris.apache.org (Postfix) with ESMTP id 17D9F2388831;
Thu, 19 Jun 2014 18:57:31 +0000 (UTC)
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: svn commit: r1604002 - in
/commons/proper/configuration/trunk/src/site/xdoc/userguide:
howto_configurationbuilder.xml user_guide.xml
Date: Thu, 19 Jun 2014 18:57:30 -0000
To: commits@commons.apache.org
From: oheger@apache.org
X-Mailer: svnmailer-1.0.9
Message-Id: <20140619185731.17D9F2388831@eris.apache.org>
X-Virus-Checked: Checked by ClamAV on apache.org
Author: oheger
Date: Thu Jun 19 18:57:30 2014
New Revision: 1604002
URL: http://svn.apache.org/r1604002
Log:
Reworked basic part of combined configuration builder chapter.
Modified:
commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_configurationbuilder.xml
commons/proper/configuration/trunk/src/site/xdoc/userguide/user_guide.xml
Modified: commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_configurationbuilder.xml
URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_configurationbuilder.xml?rev=1604002&r1=1604001&r2=1604002&view=diff
==============================================================================
--- commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_configurationbuilder.xml (original)
+++ commons/proper/configuration/trunk/src/site/xdoc/userguide/howto_configurationbuilder.xml Thu Jun 19 18:57:30 2014
@@ -20,38 +20,49 @@
- Configuration Builder Howto
+ Combining Configuration Sources
-
+
- This section explains how a
-
- DefaultConfigurationBuilderobject is setup that provides
- access to a collection of different configuration sources.
- DefaultConfigurationBuilder is the option of choice for
+ While simple applications often store their configuration data in a
+ single configuration file, there may be advanced requirements for more
+ complex systems. From a certain size of configuration data it surely
+ makes sense to divide the settings available on a set of configuration
+ files each of which is related to a specific sub-domain. This makes it
+ easier for users or administrators to adapt specific configuration
+ settings. However, rather than reading multiple files and dealing with
+ multiple Configuration objects, an application propably
+ prefers a combined view on its configuration data. Commons
+ Configuration supports this use case with a special configuration
+ builder implementation:
+
+ CombinedConfigurationBuilder.
+
+
+ CombinedConfigurationBuilder is the option of choice for
applications that have to deal with multiple configuration sources. It
provides the following features:
Various configuration sources can be combined to a single
-
+
CombinedConfiguration object. This is a truly hierarchical
configuration supporting enhanced query facilities.
As configuration sources the most relevant Configuration
implementations provided by this library are supported. Sources are
- defined as bean
+ defined as bean
declarations, so complex initializations are possible.
Meta data can be provided to fine-tune the constructed
configuration.
-
DefaultConfigurationBuilder is extensible. Custom
+
CombinedConfigurationBuilder is extensible. Custom
configuration sources can be added.
This document starts with some explanations of
- DefaultConfigurationBuilder basics. Then the configuration
- definition files processed by DefaultConfigurationBuilder
+ CombinedConfigurationBuilder basics. Then the configuration
+ definition files processed by CombinedConfigurationBuilder
are discussed in detail. Finally an advanced example is presented.
@@ -60,16 +71,13 @@
In previous chapters we have already seen how specific configuration
classes like PropertiesConfiguration or
XMLConfiguration can be used to load configuration data from
- a single source. This may be sufficient for small applications, but if
- requirements for configuration become more complex, additional support
- for managing a set of different configuration sources is desired. This is
- the domain of DefaultConfigurationBuilder which allows
- combining multiple configuration sources. The properties defined in these
- sources can then be accessed as if they were defined in a single
- configuration file. The sources to be loaded have to be defined in a
- XML document with a specific structure, a so-called configuration
- definition file. The following listing shows a simple example of such
- a definition file:
+ a single source. CombinedConfigurationBuilder now allows
+ combining multiple configuration sources to a single
+
+ CombinedConfiguration object. The sources to be loaded have to
+ be defined in an XML document with a specific structure, a so-called
+ configuration definition file. The following listing shows a
+ simple example of such a definition file: