Change spring bean properties at configuration time
        Posted  
        
            by Nick Gerakines
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Nick Gerakines
        
        
        
        Published on 2010-05-18T16:32:50Z
        Indexed on 
            2010/05/18
            17:10 UTC
        
        
        Read the original article
        Hit count: 360
        
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.
© Stack Overflow or respective owner