What would it take to be able to write and process an applicationContext.xml file that looks something like this:
I'm looking for a marriage of the conditionals offered by XSLT and the property values that any user may configure ... to result in how the applicationContext is ultimately used.Code:<bean id="propertyConfigurer"/> <bean id="perfTunedBeanA"/> <bean id="perfTunedBeanB"/> <bean id="itsComplicated"> <xsl:choose> <xsl:when test="${somePropertyConfigurerProperty} > 10"> <property name="useMe" ref="perfTunedBeanA" /> </xsl:when> <xsl:otherwise> <property name="useMe" ref="perfTunedBeanB" /> </xsl:otherwise> </xsl:choose> </bean>
This may make it more difficult to figure out what-is & what-is-not configured in a given appContext when looking at the deployment ... but its a decent trade off when I consider the fact that it keeps the users from mucking about in the xml file and allows me to tweak what's needed by just having the users specify their configuration via a properties file.
I'm not sure if extending GenericApplicationContext or BeanDefinitionDocumentReader or something else is the right way to get started on something like this ... so I would appreciate any pointers anyone can give on how to go about dissecting spring classes in order to implement such a feature?
Thanks!


Reply With Quote
roperties to read from an external configuration file the ids of the beans to inject.
