ch.elca.el4j.env.beans
Class EnvPropertyOverrideConfigurer

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 ch.elca.el4j.env.beans.EnvPropertyOverrideConfigurer
All Implemented Interfaces:
BeanFactoryPostProcessor, ApplicationContextAware, Ordered, PriorityOrdered

public class EnvPropertyOverrideConfigurer
extends PropertyOverrideConfigurer
implements ApplicationContextAware

Specific property override configurer for the EL4J environment.

Author:
Martin Zeltner (MZE), Stefan Wismer (SWI)
File-location:
EnvPropertyOverrideConfigurer
Last check-in date:
2009-08-04 14:25:40 +0200 (Di, 04. Aug 2009) by swismer for revision 3874

Field Summary
static String ENV_BEAN_PROPERTY_PROPERTIES_LOCATION
          The env bean property location.
protected  ApplicationContext m_applicationContext
          Is the used application context.
protected  boolean m_ignoreBeanNameNotFound
          Should invalid bean names be ignored?
protected  PropertyEncryptionUtil m_util
          Property encryption handler.
protected static org.slf4j.Logger s_logger
          This logger is used to print out some global debugging info.
 
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
EnvPropertyOverrideConfigurer()
           
 
Method Summary
protected  void applyPropertyValue(ConfigurableListableBeanFactory factory, String beanName, String property, String value)
          
protected  String convertPropertyValue(String originalValue)
          Decrypts values read from the env-*.properties files.
 boolean isIgnoreBeanNameNotFound()
           
 void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
          Sets the location of the env bean property properties file.
 void setApplicationContext(ApplicationContext applicationContext)
          
 void setCryptorFile(String file)
           
 void setIgnoreBeanNameNotFound(boolean ignoreBeanNameNotFound)
           
 void setLocation(Resource location)
          NOT ALLOWED TO USE!
 void setLocations(Resource[] locations)
          NOT ALLOWED TO USE!
 void setNoEncryption()
          This is meant to be used as a bean property to turn off encryption in an internal setting.
 void setPasswordSource(PasswordSource source)
          Set a true custom password.
 
Methods inherited from class org.springframework.beans.factory.config.PropertyOverrideConfigurer
hasPropertyOverridesFor, processKey, processProperties, setBeanNameSeparator, setIgnoreInvalidKeys
 
Methods inherited from class org.springframework.beans.factory.config.PropertyResourceConfigurer
convertProperties, convertProperty, getOrder, setOrder
 
Methods inherited from class org.springframework.core.io.support.PropertiesLoaderSupport
loadProperties, mergeProperties, setFileEncoding, setIgnoreResourceNotFound, setLocalOverride, setProperties, setPropertiesArray, setPropertiesPersister
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENV_BEAN_PROPERTY_PROPERTIES_LOCATION

public static final String ENV_BEAN_PROPERTY_PROPERTIES_LOCATION
The env bean property location.

See Also:
Constant Field Values

s_logger

protected static final org.slf4j.Logger s_logger
This logger is used to print out some global debugging info. Consult it for info what is going on.


m_applicationContext

protected ApplicationContext m_applicationContext
Is the used application context.


m_ignoreBeanNameNotFound

protected boolean m_ignoreBeanNameNotFound
Should invalid bean names be ignored?


m_util

protected PropertyEncryptionUtil m_util
Property encryption handler.

Constructor Detail

EnvPropertyOverrideConfigurer

public EnvPropertyOverrideConfigurer()
Method Detail

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Sets the location of the env bean property properties file.

Specified by:
postProcessBeanFactory in interface BeanFactoryPostProcessor
Overrides:
postProcessBeanFactory in class PropertyResourceConfigurer
Throws:
BeansException

applyPropertyValue

protected void applyPropertyValue(ConfigurableListableBeanFactory factory,
                                  String beanName,
                                  String property,
                                  String value)

Overrides:
applyPropertyValue in class PropertyOverrideConfigurer

setLocation

public void setLocation(Resource location)
NOT ALLOWED TO USE!

Overrides:
setLocation in class PropertiesLoaderSupport

setLocations

public void setLocations(Resource[] locations)
NOT ALLOWED TO USE!

Overrides:
setLocations in class PropertiesLoaderSupport

setApplicationContext

public void setApplicationContext(ApplicationContext applicationContext)
                           throws BeansException

Specified by:
setApplicationContext in interface ApplicationContextAware
Throws:
BeansException

isIgnoreBeanNameNotFound

public boolean isIgnoreBeanNameNotFound()
Returns:
Returns true if ignoreBeanNameNotFound is set.

setIgnoreBeanNameNotFound

public void setIgnoreBeanNameNotFound(boolean ignoreBeanNameNotFound)
Parameters:
ignoreBeanNameNotFound - Should invalid bean names be ignored?

setNoEncryption

public void setNoEncryption()
This is meant to be used as a bean property to turn off encryption in an internal setting.


setPasswordSource

public void setPasswordSource(PasswordSource source)
Set a true custom password.

Parameters:
source - A PasswordSource interface.

setCryptorFile

public void setCryptorFile(String file)
Parameters:
file - The file containing the encryption properties.

convertPropertyValue

protected String convertPropertyValue(String originalValue)
Decrypts values read from the env-*.properties files.

Overrides:
convertPropertyValue in class PropertyResourceConfigurer
Parameters:
originalValue - The value read from env-*.properties The initialization cannot go in constructor as we don't have all the required properties there yet.
Returns:
The string with all encrypted values decrypted.


Copyright © 2005-2011 ELCA. All Rights Reserved.