开发者

Dynamically scheduling quartz cron job in spring?

Currently I'm running Quartz scheduler example in this link http://www.mkyong.com/spring/spring-quartz-scheduler-example/

My question is this How can I add 开发者_JAVA百科a dynamic time in CronTrigger bean, instead of hard-coded time in here :

<property name="cronExpression" value="0/5 * * * * ?"/>

I need to read this value dynamically as a parameter passed to my controller.


Inject the Scheduler into one of your beans and invoke scheduleJob(). You can pass it anything you want.


To solve this issue, I used the approach used in a blog entry titled Dynamic Scheduling with Java/Spring

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜