ch.elca.el4j.env.beans
Class EnvPropertyPlaceholderConfigurer

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.PropertyPlaceholderConfigurer
              extended by ch.elca.el4j.env.beans.EnvPropertyPlaceholderConfigurer
All Implemented Interfaces:
BeanFactoryAware, BeanNameAware, BeanFactoryPostProcessor, ApplicationContextAware, Ordered, PriorityOrdered

public class EnvPropertyPlaceholderConfigurer
extends PropertyPlaceholderConfigurer
implements ApplicationContextAware

Specific property placeholder configurer for the EL4J environment.

Author:
Martin Zeltner (MZE), Stefan Wismer (SWI)
File-location:
EnvPropertyPlaceholderConfigurer
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_PLACEHOLDER_PROPERTIES_LOCATION
          The correct env location.
protected  ApplicationContext m_applicationContext
          Is the used application context.
protected  PropertyEncryptionUtil m_util
          This handles encryption.
static String OLD_ENV_PROPERTIES_LOCATION
          The deprecated env location.
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.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
EnvPropertyPlaceholderConfigurer()
           
 
Method Summary
protected  String convertPropertyValue(String originalValue)
          Decrypts values read from the env-*.properties files.
 void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
          Sets the location of the env placeholder properties file.
 void setApplicationContext(ApplicationContext applicationContext)
          
 void setCryptorFile(String file)
           
 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.PropertyPlaceholderConfigurer
parseStringValue, processProperties, resolvePlaceholder, resolvePlaceholder, resolveSystemProperty, setBeanFactory, setBeanName, setIgnoreUnresolvablePlaceholders, setNullValue, setPlaceholderPrefix, setPlaceholderSuffix, setSearchSystemEnvironment, setSystemPropertiesMode, setSystemPropertiesModeName, setValueSeparator
 
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_PLACEHOLDER_PROPERTIES_LOCATION

public static final String ENV_PLACEHOLDER_PROPERTIES_LOCATION
The correct env location.

See Also:
Constant Field Values

OLD_ENV_PROPERTIES_LOCATION

public static final String OLD_ENV_PROPERTIES_LOCATION
The deprecated env 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_util

protected PropertyEncryptionUtil m_util
This handles encryption.

Constructor Detail

EnvPropertyPlaceholderConfigurer

public EnvPropertyPlaceholderConfigurer()
Method Detail

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
                            throws BeansException
Sets the location of the env placeholder properties file. A fallback to the old env location is possible.

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

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

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 cryptor settings.

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
Returns:
The value with all encrypted values decrypted.


Copyright © 2005-2011 ELCA. All Rights Reserved.