Spring configuration management in Equinox_83722259 - Gumtree/gumtree GitHub Wiki
Created by Tony Lam, last modified on May 21, 2008
Spring supports configuration management via properties substitutiion in its XML bean context. The following is the XML example:
System properties should look something like this:
Above uses the system properties to override the bean settings. In Equinox, all system property are kept in the config.ini. To enable the Spring PropertyPlaceholderConfigurer, you need to import package org.springframework.beans.factory.config. This placeholder allows default settings (in case it cannot resolve from the system properties). To enable this, import package org.springframework.core.io.support.
References:
Configuration management with Spring: http://blog.arendsen.net/index.php/2005/03/12/configuration-management-with-spring/
Spring PropertyPlaceholderConfigurer with default value: http://thiamteck.blogspot.com/2008/04/spring-propertyplaceholderconfigurer.html
<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
<property name="properties">
<props>
<prop key="restlet.serverPort">9876</prop>
</props>
</property>
</bean>
<bean id="jettyServer" class="com.noelios.restlet.equinox.JettyStarter" init-method="init" destroy-method="cleanup">
<property name="port" value="${restlet.serverPort}" />
</bean>
# Production port restlet.serverPort = 9999
Document generated by Confluence on Apr 01, 2015 00:11