我们正在使用spring的任务:schedule-tasks根据cron表达式调度一个任务。我们的基本配置如下所示。我的问题是,既然我们没有提供调度程序对“任务:计划任务”的引用,那么它是如何工作的?它自动生成什么样的默认配置?
<task:scheduled-tasks>
<task:scheduled ref="runScheduler" method="run"
cron="0 0/5 * * * ?" />
</task:scheduled-tasks>
答案 0 :(得分:0)
根据您的示例提供有关您的示例here的更多信息。
本文将解释所有信息。
但要恢复,请进入您的配置:
<task:scheduled-tasks>
<task:scheduled ref="runScheduler" method="run"
cron="0 0/5 * * * ?" />
</task:scheduled-tasks>
进入&#34; 任务:预定&#34;你有一个&#34; 参考&#34;引用bean RunScheduler 的属性。 它可以声明:
XML配置文件,在此示例中为此文件&#34; resources / spring / batch / jobs / job-report &#34;:
<bean id="runScheduler" class="com.mkyong.RunScheduler" />
注释:
@Component
公共类RunScheduler {
...
}
答案 1 :(得分:0)
如果您使用 Spring Integration ,则默认任务计划程序为explain here。
这是 SimpleTaskScheduler
。