• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Spring Quartz Scheduler - read value of cronExpression from property file

 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have written code using spring quartz scheduler and it is working fine. But, in that i have specified value of cron expression in applicationcontext.xml. So, i now need to read the value of CronExpression from properties file so that if we need to change the time of execution, we can just change properties file and restart the server.
<bean id="CronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="CronJob" />
<property name="cronExpression" value="0 0 3 * * ?" />
</bean>

I can't do
<bean id="CronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="CronJob" />
<property name="cronExpression" value="{cronExpression}" />
</bean>
because i don't have control over CronTriggerBean as it provided by Spring.

So, can anyone please tell how we can read the value of cronExpression from properties file.

--Raj
 
reply
    Bookmark Topic Watch Topic
  • New Topic