PDA

View Full Version : Refresh PropertyPlaceholder data at runtime



rebornspirt
Oct 28th, 2004, 09:55 AM
Is it possible to reload / refresh the property files that are configured in the PropertyPlaceholder or is it necessary to refresh the complete application context (using ConfigurableApplicationContext) instead?

Grtz

Maarten

Colin Sampaleanu
Oct 28th, 2004, 10:17 AM
You need to refresh the whole context, since the replacement happens at the time of the context load/reload. The configurer is a bean factory postprocesor, which runs at that time.

pietercoucke
Oct 28th, 2004, 10:21 AM
I think you will need to refresh the complete application context, because the properties from the PropertyPlaceHolderConfigurer are set in the beans in the configuration. After that a lot of initialization can happen (eg. afterPropertiesSet() call in InitializingBean, which may set other properties in the beans).
Just reloading the PropertyPlaceHolderConfigurer wouldn't change those properties I guess.