|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.core.io.support.PropertiesLoaderSupport
org.springframework.beans.factory.config.PropertyResourceConfigurer
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
it.openutils.deployment.spring.EnvironmentPropertyConfigurer
public class EnvironmentPropertyConfigurer
A propertyconfigurer that can be used to dynamically select a list of property files based on the current environment.
You can configure the fileLocation parameter with a list of file location, using variables for:
A sample value for the fileLocation parameter would be: WEB-INF/config/${env}/my.properties,
WEB-INF/config/${appl}/my.properties,
WEB-INF/config/${contextParam/instance}/my.properties,
classpath:my-${env}.properties,classpath:default.properties.
After replacing all the known variables the resulting list is parsed and any existing file is merged in a single property list, used to configure the remaining spring context
| Nested Class Summary | |
|---|---|
protected class |
EnvironmentPropertyConfigurer.PlaceholderResolvingStringValueResolver
BeanDefinitionVisitor that resolves placeholders in String values, delegating to the parseStringValue method of the containing class. |
| Field Summary | |
|---|---|
protected java.util.Properties |
properties
Cached properties (super field is private). |
| Fields inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer |
|---|
DEFAULT_PLACEHOLDER_PREFIX, DEFAULT_PLACEHOLDER_SUFFIX, DEFAULT_VALUE_SEPARATOR, SYSTEM_PROPERTIES_MODE_FALLBACK, SYSTEM_PROPERTIES_MODE_NEVER, SYSTEM_PROPERTIES_MODE_OVERRIDE |
| 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 | |
|---|---|
EnvironmentPropertyConfigurer()
|
|
| Method Summary | |
|---|---|
java.lang.reflect.Constructor[] |
determineCandidateConstructors(java.lang.Class beanClass,
java.lang.String beanName)
|
java.lang.Object |
getEarlyBeanReference(java.lang.Object bean,
java.lang.String beanName)
|
java.util.Properties |
getProperties()
Returns the Properties loaded by this configurer. |
java.lang.String |
getProperty(java.lang.String key)
Returns a single property. |
java.lang.Object |
postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
|
boolean |
postProcessAfterInstantiation(java.lang.Object bean,
java.lang.String beanName)
|
void |
postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
|
java.lang.Object |
postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
|
java.lang.Object |
postProcessBeforeInstantiation(java.lang.Class beanClass,
java.lang.String beanName)
|
org.springframework.beans.PropertyValues |
postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
java.beans.PropertyDescriptor[] pds,
java.lang.Object bean,
java.lang.String beanName)
|
java.lang.Class |
predictBeanType(java.lang.Class beanClass,
java.lang.String beanName)
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
|
void |
setApplicationPropertyName(java.lang.String applicationPropertyName)
Sets the applicationPropertyName. |
void |
setExposeSystemProperties(boolean exposeSystemProperties)
Set all the properties configured as system properties. |
void |
setFileLocation(java.lang.String fileLocation)
Setter for fileLocation. |
void |
setInherit(boolean inherit)
Sets the inherit. |
void |
setNullValue(java.lang.String nullValue)
|
void |
setServerPropertyName(java.lang.String serverPropertyName)
Sets the serverPropertyName. |
| Methods inherited from class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer |
|---|
parseStringValue, processProperties, resolvePlaceholder, resolvePlaceholder, resolveSystemProperty, setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName |
| 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 |
|---|
protected java.util.Properties properties
| Constructor Detail |
|---|
public EnvironmentPropertyConfigurer()
| Method Detail |
|---|
public void setFileLocation(java.lang.String fileLocation)
fileLocation.
fileLocation - The fileLocation to set.public void setInherit(boolean inherit)
inherit - the inherit to setpublic void setServerPropertyName(java.lang.String serverPropertyName)
serverPropertyName - the serverPropertyName to setpublic void setApplicationPropertyName(java.lang.String applicationPropertyName)
applicationPropertyName - the applicationPropertyName to setpublic void setExposeSystemProperties(boolean exposeSystemProperties)
exposeSystemProperties - true if you want to set configured properties as system properties.public void setNullValue(java.lang.String nullValue)
setNullValue in class org.springframework.beans.factory.config.PropertyPlaceholderConfigurer
public void postProcessBeanFactory(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
throws org.springframework.beans.BeansException
postProcessBeanFactory in interface org.springframework.beans.factory.config.BeanFactoryPostProcessorpostProcessBeanFactory in class org.springframework.beans.factory.config.PropertyResourceConfigurerorg.springframework.beans.BeansExceptionpublic java.util.Properties getProperties()
public java.lang.String getProperty(java.lang.String key)
key - Property key
null if not found.
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansException
public boolean postProcessAfterInstantiation(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessAfterInstantiation in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessororg.springframework.beans.BeansException
public java.lang.Class predictBeanType(java.lang.Class beanClass,
java.lang.String beanName)
predictBeanType in interface org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor
public java.lang.reflect.Constructor[] determineCandidateConstructors(java.lang.Class beanClass,
java.lang.String beanName)
throws org.springframework.beans.BeansException
determineCandidateConstructors in interface org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessororg.springframework.beans.BeansException
public java.lang.Object getEarlyBeanReference(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
getEarlyBeanReference in interface org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessororg.springframework.beans.BeansException
public java.lang.Object postProcessBeforeInstantiation(java.lang.Class beanClass,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessBeforeInstantiation in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessororg.springframework.beans.BeansException
public org.springframework.beans.PropertyValues postProcessPropertyValues(org.springframework.beans.PropertyValues pvs,
java.beans.PropertyDescriptor[] pds,
java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessPropertyValues in interface org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessororg.springframework.beans.BeansException
public java.lang.Object postProcessBeforeInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessBeforeInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansException
public java.lang.Object postProcessAfterInitialization(java.lang.Object bean,
java.lang.String beanName)
throws org.springframework.beans.BeansException
postProcessAfterInitialization in interface org.springframework.beans.factory.config.BeanPostProcessororg.springframework.beans.BeansException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||