org.apache.cocoon.spring.configurator.impl
Class ExtendedPropertyOverrideConfigurer

java.lang.Object
  extended by org.springframework.core.io.support.PropertiesLoaderSupport
      extended by org.springframework.beans.factory.config.PropertyResourceConfigurer
          extended by org.springframework.beans.factory.config.PropertyOverrideConfigurer
              extended by org.apache.cocoon.spring.configurator.impl.ExtendedPropertyOverrideConfigurer
All Implemented Interfaces:
BeanFactoryPostProcessor, Ordered, PriorityOrdered

public class ExtendedPropertyOverrideConfigurer
extends PropertyOverrideConfigurer

Our version of the property override configurer which reads properties from the Cocoon spring configuration directory. A property should have the following format: {bean name}/{property name}={value}.

Since:
1.0
Version:
$Id: ExtendedPropertyOverrideConfigurer.java 677626 2008-07-17 16:06:10Z gkossakowski $

Field Summary
protected  List locations
          The locations of the directories where the different property files are located.
protected  ResourceFilter resourceFilter
           
protected  ResourceLoader resourceLoader
          The resource loader used to load the property files.
protected  org.apache.cocoon.configuration.Settings settings
          The settings object.
 
Fields inherited from class org.springframework.beans.factory.config.PropertyOverrideConfigurer
DEFAULT_BEAN_NAME_SEPARATOR
 
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
 
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
 
Constructor Summary
ExtendedPropertyOverrideConfigurer()
           
 
Method Summary
 void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
          Read all property files from the specified location and apply the changes.
 void setLocations(List list)
          Set the directories to search in.
 void setResourceFilter(ResourceFilter resourceFilter)
          Set the resource filter
 void setResourceLoader(ResourceLoader loader)
          Set the resource loader.
 void setSettings(org.apache.cocoon.configuration.Settings object)
          Set the settings.
 
Methods inherited from class org.springframework.beans.factory.config.PropertyOverrideConfigurer
applyPropertyValue, hasPropertyOverridesFor, processKey, processProperties, setBeanNameSeparator, setIgnoreInvalidKeys
 
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertPropertyValue, getOrder, setOrder
 
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setLocation, setLocations, setProperties, setPropertiesArray, setPropertiesPersister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locations

protected List locations
The locations of the directories where the different property files are located.


resourceLoader

protected ResourceLoader resourceLoader
The resource loader used to load the property files. This loader is either resolving relative to the current sitemap or the root of the context.


resourceFilter

protected ResourceFilter resourceFilter

settings

protected org.apache.cocoon.configuration.Settings settings
The settings object.

Constructor Detail

ExtendedPropertyOverrideConfigurer

public ExtendedPropertyOverrideConfigurer()
Method Detail

setLocations

public void setLocations(List list)
Set the directories to search in.

Parameters:
list - A list of string pointing to directories.

setSettings

public void setSettings(org.apache.cocoon.configuration.Settings object)
Set the settings.

Parameters:
object - The settings object.

setResourceLoader

public void setResourceLoader(ResourceLoader loader)
Set the resource loader.

Parameters:
loader - The new resource loader.

setResourceFilter

public void setResourceFilter(ResourceFilter resourceFilter)
Set the resource filter

Parameters:
resourceFilter -

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Read all property files from the specified location and apply the changes.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Overrides:
postProcessBeanFactory in class PropertyResourceConfigurer
Throws:
BeansException
See Also:
PropertyResourceConfigurer.postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory)


Copyright © 1999-2009 The Apache Software Foundation. All Rights Reserved.