Skip to content

Instantly share code, notes, and snippets.

@jamesmorgan
Created August 8, 2012 09:42
Show Gist options
  • Save jamesmorgan/3293812 to your computer and use it in GitHub Desktop.
Save jamesmorgan/3293812 to your computer and use it in GitHub Desktop.
Example Spring Reloadable Properties Configuration
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
">
<import resource="classpath:/spring/spring-defaultConfiguration.xml" />
<bean
class="com.morgan.design.properties.internal.ReloadablePropertyPostProcessor">
<constructor-arg ref="propertyConfigurator" />
<constructor-arg ref="eventNotifier" />
<constructor-arg ref="conversionService" />
</bean>
<bean id="propertyConfigurator"
class="com.morgan.design.properties.internal.ReadablePropertySourcesPlaceholderConfigurer">
<property name="ignoreUnresolvablePlaceholders" value="false" />
<property name="ignoreResourceNotFound" value="true" />
<constructor-arg ref="eventNotifier" />
<constructor-arg ref="propertyResolver" />
<property name="locations">
<list>
<value>classpath*:META-INF/*.properties</value>
<value>classpath:test.properties</value>
<value>file:${CONFIG_DIR}/global.properties</value>
</list>
</property>
</bean>
</beans>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment