org.alfresco.config
Class SystemPropertiesFactoryBean

java.lang.Object
  extended by org.springframework.core.io.support.PropertiesLoaderSupport
      extended by org.springframework.beans.factory.config.PropertiesFactoryBean
          extended by org.alfresco.config.SystemPropertiesFactoryBean
All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
JndiPropertiesFactoryBean

public class SystemPropertiesFactoryBean
extends org.springframework.beans.factory.config.PropertiesFactoryBean

Like the parent PropertiesFactoryBean, but overrides or augments the resulting property set with values from VM system properties. As with the Spring PropertyPlaceholderConfigurer the following modes are supported:

Note that system properties will only be included in the property set if defaults for the property have already been defined using PropertiesLoaderSupport.setProperties(Properties) or PropertiesLoaderSupport.setLocations(org.springframework.core.io.Resource[]) or their names have been included explicitly in the set passed to SystemPropertiesFactoryBean.setSystemProperties(Set).


Field Summary
 
Fields inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
logger, XML_FILE_EXTENSION
 
Constructor Summary
SystemPropertiesFactoryBean()
           
 
Method Summary
protected  java.util.Properties mergeProperties()
           
protected  void resolveMergedProperty(java.lang.String systemProperty, java.util.Properties props)
          Override hook.
 void setSystemProperties(java.util.Set systemProperties)
          Set the names of the properties that can be considered for overriding.
 void setSystemPropertiesMode(int systemPropertiesMode)
          Set how to check system properties.
 void setSystemPropertiesModeName(java.lang.String constantName)
          Set the system property mode by the name of the corresponding constant, e.g.
 
Methods inherited from class org.springframework.beans.factory.config.PropertiesFactoryBean
afterPropertiesSet, createInstance, createProperties, getObject, getObjectType, isSingleton, setSingleton
 
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, 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

SystemPropertiesFactoryBean

public SystemPropertiesFactoryBean()
Method Detail

setSystemPropertiesModeName

public void setSystemPropertiesModeName(java.lang.String constantName)
                                 throws java.lang.IllegalArgumentException
Set the system property mode by the name of the corresponding constant, e.g. "SYSTEM_PROPERTIES_MODE_OVERRIDE".

Parameters:
constantName - name of the constant
Throws:
java.lang.IllegalArgumentException - if an invalid constant was specified
See Also:
SystemPropertiesFactoryBean.setSystemPropertiesMode(int)

setSystemPropertiesMode

public void setSystemPropertiesMode(int systemPropertiesMode)
Set how to check system properties.

See Also:
PropertyPlaceholderConfigurer.setSystemPropertiesMode(int)

setSystemProperties

public void setSystemProperties(java.util.Set systemProperties)
Set the names of the properties that can be considered for overriding.

Parameters:
systemProperties - a set of properties that can be fetched from the system properties

mergeProperties

protected java.util.Properties mergeProperties()
                                        throws java.io.IOException
Overrides:
mergeProperties in class org.springframework.core.io.support.PropertiesLoaderSupport
Throws:
java.io.IOException

resolveMergedProperty

protected void resolveMergedProperty(java.lang.String systemProperty,
                                     java.util.Properties props)
Override hook. Allows subclasses to resolve a merged property from an alternative source, whilst still respecting the chosen system property fallback path.

Parameters:
systemProperty -
props -


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.