RESOLVED - issue BATCH-980: Add SystemPropertyInitializer

This commit is contained in:
dsyer
2008-12-30 09:23:27 +00:00
parent c9d7b45f14
commit e4ca63a927
9 changed files with 190 additions and 51 deletions

View File

@@ -34,30 +34,15 @@
construct a properties file on the classpath. The default is "hsql".
-->
<bean id="environment"
class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetClass" value="java.lang.System" />
<property name="targetMethod" value="setProperty" />
<property name="arguments">
<list>
<value>environment</value>
<bean class="java.lang.System" factory-method="getProperty">
<constructor-arg>
<value>environment</value>
</constructor-arg>
<!-- The default value of the environment property -->
<constructor-arg>
<value>hsql</value>
</constructor-arg>
</bean>
</list>
</property>
class="org.springframework.batch.support.SystemPropertyInitializer">
<property name="defaultValue" value="hsql"/>
</bean>
<!-- Use this to set additional properties on beans at run time -->
<bean id="overrideProperties"
class="org.springframework.beans.factory.config.PropertyOverrideConfigurer"
depends-on="environment">
<property name="location" value="classpath:batch-${environment}.properties" />
<property name="location" value="classpath:batch-${org.springframework.batch.support.SystemPropertyInitializer.ENVIRONMENT}.properties" />
<!-- Allow system properties (-D) to override those from file -->
<property name="localOverride" value="true" />
<property name="properties">
@@ -70,7 +55,7 @@
<bean id="placeholderProperties"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
depends-on="environment">
<property name="location" value="classpath:batch-${environment}.properties" />
<property name="location" value="classpath:batch-${org.springframework.batch.support.SystemPropertyInitializer.ENVIRONMENT}.properties" />
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreUnresolvablePlaceholders" value="true" />
<property name="order" value="1" />