Introduction to the User Guide

EasyConf aims to be as easy to use as possible. If all you want is to make configurable a constant or a set of constants a single line of code for each is needed. But it is not much harder when your necessities grow and you want to use complex XML configuration.

This guide provides full documentation of all of EasyConf's features and points to documentation of the libraries it depends for further information.

Vision

EasyConf was born from necessity because none of the existing libraries had all the needed functionality. But it is not our intent to reimplement what does exist so whenever possible we'll base its functionality in existing free software libraries.

Configuration concepts

EasyConf organizes the configuration it reads in components. Each component has its own name and is composed of two parts:

  • Properties: obtained from property files
  • Configuration object: filled from XML files

A component can have only properties, only a configuration object or have both.

Let's start with the examples. To obtain the configuration of an application named my-app you have to write the following code:

 
            ComponentConfiguration conf = EasyConf.getConfiguration("my-app");
         

ComponentConfiguration is the class which holds the configuration of my-app. To retrieve the properties all you have to do is:

 
            ComponentProperties props = conf.getProperties();
         

ComponentProperties contains methods to retrieve properties of any of the supported types. The properties of the example component will be read from a file called my-app.properties. Later will see that properties can also be read from other complementary sources.

The configuration object can be read using another method of the conf object:

            Object confObj = conf.getConfigurationObject();
         

The configuration object contains a representation of an XML file. The XML file can have any user defined vocabulary, but it must be given the name of the component with xml as the extension. In our example it must be called my-app.xml. This file will be read and converted to user defined classes. The conversion is configured in a mapping file which must have digesterRules.xml as its extensions. In our example it should be called my-app.digesterRules.xml

Now you that you have the big picture, the next sections will give more details and examples of the features of EasyConf

Work in progress

This manual is a work in progress. Here is the expected table of contents:

  • Introduction
  • Properties

    • Using
    • System properties
    • Filters
    • Multiple environments
    • Multiple components
    • Planned features
  • XML Files

    • Using
    • Variables
    • Complex mappings
    • Planned features
  • J2EE

    • Taglibs
    • Services (TBD)
  • JMX

    • JMX and Configuration
    • JMX and EasyConf
  • Specific use cases (TBD)

    • Portlets
    • Hibernate
  • Utils (TBD)

The progress of this manual can be followed viewing the latest CVS files