org.reactive.configuration
Class CommonsConfigurationFactoryBean

java.lang.Object
  extended by org.springframework.beans.factory.config.AbstractFactoryBean
      extended by org.reactive.configuration.CommonsConfigurationFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean

public class CommonsConfigurationFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean

A factory bean used to create instances of commons-configuration's composite configurations from a variety of resources.

An example of the factory bean configuration required for Commons Configuration

 <bean id="configuration" class="org.reactive.configuration.CommonsConfigurationFactoryBean">
     <property name="xmlResources">
         <set>
             <bean class="org.springframework.beans.factory.config.ResourceFactoryBean">
                 <property name="location">
                     <value>classpath:/org/reactive/beans/factory/config/ConfigurationPlaceholderProcessorTest_placeholders.xml</value>
                 </property>
             </bean>
         </set>
     </property>
     <property name="propertiesResources">
         <set>
             <bean class="org.springframework.beans.factory.config.ResourceFactoryBean">
                 <property name="location">
                     <value>classpath:/org/reactive/beans/factory/config/ConfigurationPlaceholderProcessorTest_placeholders.properties</value>
                 </property>
             </bean>
         </set>
     </property>
 </bean>
 

Since:
9.6.2005
Version:
$Id: CommonsConfigurationFactoryBean.java,v 1.3 2005/06/16 07:02:08 dan_washusen Exp $
Author:
Dan Washusen
See Also:
DefaultResourceLoader

Field Summary
 
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
 
Constructor Summary
CommonsConfigurationFactoryBean()
           
 
Method Summary
protected  java.lang.Object createInstance()
          Creates an instance of composite configuration based using the resources provided by setPropertiesResources(java.util.Set), setXmlPropertiesResources(java.util.Set) and setXmlResources(java.util.Set).
 java.lang.Class getObjectType()
           
 void setJNDIConfigurationEnabled(boolean JNDIConfigurationEnabled)
          Sets the boolean flag determining if the JNDI configuration should be added to the composite configuration
 void setJndiPrefix(java.lang.String jndiPrefix)
          Sets the prefix used when querying a JNDI context.
 void setPropertiesResources(java.util.Set propertiesResources)
          Sets a set of resources used to create properties based configurations.
 void setXmlPropertiesResources(java.util.Set xmlPropertiesResources)
          Sets a set of resources used to create xml properies configuration.
 void setXmlResources(java.util.Set xmlResources)
          Sets a ste of resources used to create xml based configurations.
 
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, getObject, isSingleton, setSingleton
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsConfigurationFactoryBean

public CommonsConfigurationFactoryBean()
Method Detail

setJndiPrefix

public void setJndiPrefix(java.lang.String jndiPrefix)
Sets the prefix used when querying a JNDI context.

Parameters:
jndiPrefix - the prefix used when querying a JNDI context

setJNDIConfigurationEnabled

public void setJNDIConfigurationEnabled(boolean JNDIConfigurationEnabled)
Sets the boolean flag determining if the JNDI configuration should be added to the composite configuration

Parameters:
JNDIConfigurationEnabled - true if JNDI configuration should be enabled, otherwise false

setPropertiesResources

public void setPropertiesResources(java.util.Set propertiesResources)
Sets a set of resources used to create properties based configurations.

Parameters:
propertiesResources - a list of resources used to create properties based configurations

setXmlResources

public void setXmlResources(java.util.Set xmlResources)
Sets a ste of resources used to create xml based configurations.

Parameters:
xmlResources - a list of resources used to create xml based configurations

setXmlPropertiesResources

public void setXmlPropertiesResources(java.util.Set xmlPropertiesResources)
Sets a set of resources used to create xml properies configuration.

Parameters:
xmlPropertiesResources - a list of resources used to create xml based configurations

createInstance

protected java.lang.Object createInstance()
                                   throws java.lang.Exception
Creates an instance of composite configuration based using the resources provided by setPropertiesResources(java.util.Set), setXmlPropertiesResources(java.util.Set) and setXmlResources(java.util.Set).

Specified by:
createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean
Returns:
An instance of commons-configurations composite configuratoin
Throws:
java.lang.Exception - If an error occurrs while creating the configuration from the provided resources

getObjectType

public java.lang.Class getObjectType()


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