org.onebusaway.container.spring
Class SystemPropertyOverrideConfigurer

java.lang.Object
  extended by org.springframework.core.io.support.PropertiesLoaderSupport
      extended by org.onebusaway.container.spring.SystemPropertyOverrideConfigurer
All Implemented Interfaces:
org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.Ordered, org.springframework.core.PriorityOrdered

public class SystemPropertyOverrideConfigurer
extends org.springframework.core.io.support.PropertiesLoaderSupport
implements org.springframework.beans.factory.config.BeanFactoryPostProcessor, org.springframework.core.PriorityOrdered

A Spring BeanFactoryPostProcessor that can be used to override System properties (see System.getProperties()) from within a Spring application context. Because it is a BeanFactoryPostProcessor and also implements PriorityOrdered, this processor can be configured to run before almost anything else when constructing a Spring application context, especially if you set the order property to something low. This is useful for setting System properties before another BeanFactoryPostProcessor like PropertyPlaceholderConfigurer or PropertyOverrideConfigurer are applied.

Author:
bdferris
See Also:
BeanFactoryPostProcessor, PropertiesLoaderSupport, PropertyOverrideConfigurer, PropertyPlaceholderConfigurer

Field Summary
 
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
SystemPropertyOverrideConfigurer()
           
 
Method Summary
 int getOrder()
           
 void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
           
 void setOrder(int order)
           
 
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
 

Constructor Detail

SystemPropertyOverrideConfigurer

public SystemPropertyOverrideConfigurer()
Method Detail

setOrder

public void setOrder(int order)

getOrder

public int getOrder()
Specified by:
getOrder in interface org.springframework.core.Ordered

postProcessBeanFactory

public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
                            throws org.springframework.beans.BeansException
Specified by:
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessor
Throws:
org.springframework.beans.BeansException


Copyright © 2012 OneBusAway. All Rights Reserved.