Change spring bean properties at configuration time
- by Nick Gerakines
In a spring servlet xml file, I'm using org.springframework.scheduling.quartz.SchedulerFactoryBean to regularly fire a set of triggers.
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref local="AwesomeTrigger" />
<ref local="GreatTrigger" />
<ref local="FantasticTrigger"/>
</list>
</property>
</bean>
The issue is that in different environments, I don't want certain triggers firing. Is there a way to include some sort of configuration or variable defined either in my build.properties for the environment or in a spring custom context properties file that assists the bean xml to determine which triggers should be included in the list? That way, for example, AwesomeTrigger would be called in development but not qa.