org.reactive.configuration
Class CommonsConfigurationFactory

java.lang.Object
  extended by org.apache.commons.configuration.ConfigurationFactory
      extended by org.reactive.configuration.CommonsConfigurationFactory

public class CommonsConfigurationFactory
extends org.apache.commons.configuration.ConfigurationFactory

An extension of the org.apache.commons.configuration.ConfigurationFactory that takes a spring org.springframework.core.io.Resource.

An example of the bean factory configuration required for Commons Configuration

 <bean id="commonsConfigurationFactory" class="org.reactive.configuration.CommonsConfigurationFactory" singleton="true">
      <property name="configurationResource">
          <value>classpath:/org/reactive/beans/factory/config/ConfigurationPlaceholderProcessorTest_configuration.xml</value>
      </property>
  </bean>

  <bean id="configuration" factory-bean="commonsConfigurationFactory" factory-method="getConfiguration" />

  <bean id="configurationPlaceholderProcessor" class="org.reactive.beans.factory.config.ConfigurationPlaceholderProcessor">
      <property name="placeholderEvaluator">
          <bean class="org.reactive.beans.factory.config.commons.CommonsPlaceholderEvaluator">
              <property name="configuration">
                  <ref bean="configuration"/>
              </property>
          </bean>
      </property>
  </bean>
 

Since:
16.12.2004
Version:
$Id: CommonsConfigurationFactory.java,v 1.1 2004/12/26 23:42:29 dan_washusen Exp $
Author:
Dan Washusen
See Also:
DefaultResourceLoader

Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.commons.configuration.ConfigurationFactory
org.apache.commons.configuration.ConfigurationFactory.AdditionalConfigurationData, org.apache.commons.configuration.ConfigurationFactory.ConfigurationBuilder, org.apache.commons.configuration.ConfigurationFactory.DigesterConfigurationFactory, org.apache.commons.configuration.ConfigurationFactory.FileConfigurationFactory
 
Constructor Summary
CommonsConfigurationFactory()
           
 
Method Summary
 void setConfigurationResource(org.springframework.core.io.Resource resource)
          Set the resource that the configuration factory will use to instantiate instances of org.apache.commons.configuration.Configuration.
 
Methods inherited from class org.apache.commons.configuration.ConfigurationFactory
getBasePath, getConfiguration, getConfigurationFileName, getConfigurationURL, getDigesterRuleNamespaceURI, getDigesterRules, initDefaultDigesterRules, initDigesterSectionRules, setBasePath, setConfigurationFileName, setConfigurationURL, setDigesterRuleNamespaceURI, setDigesterRules, setupDigesterInstance, setupUnionRules
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsConfigurationFactory

public CommonsConfigurationFactory()
Method Detail

setConfigurationResource

public void setConfigurationResource(org.springframework.core.io.Resource resource)
                              throws java.io.IOException
Set the resource that the configuration factory will use to instantiate instances of org.apache.commons.configuration.Configuration. This method simple calls org.apache.commons.configuration.ConfigurationFactory.setConfigurationURL(resource.getURL()).

An example might be "classpath:/configuration.xml" to load the configuration.xml file from the root of the classpath.

Parameters:
resource - The resource that the configuration factory will use to instantiate instances of org.apache.commons.configuration.Configuration
Throws:
java.io.IOException - If an error occurs while attempting to create a URL for the resource.


Copyright © 2004-2005 reactive.org. All Rights Reserved.