It looks like you have a subclass of PropertyPlaceholderConfigurer, why don't you override resolveProperty with a logical check of the run-time values โโand resolveProperty to the default values โโotherwise? You may need to create a dedicated subclass for the child context and enter the source of the run-time values โโin it.
What you can also do is put your runtime values โโin the system properties and use the override mode for systemPropertiesMode . This is a simple but not very clean solution; some of the options for my first approach would be better. If you create multiple click contexts, this will work until you create them in parallel.
update: I would start with something like:
final Map<String,String> myRuntimeValues; ClassPathXmlApplicationContext childAppContext = new ClassPathXmlApplicationContext(parentApplicationContext) { protected void prepareBeanFactory(ConfigurableListableBeanFactory beanFactory) { super.prepareBeanFactory(); beanFactory.registerSingleton("myRuntimeValues", myRuntimeValues); } };
and enter "myRuntimeValues" in the PropertyPlaceholderConfigurer bean defined in the client context file. Some more digging may lead to a better solution, this is not a typical use case, I'm sure you will understand further.
source share