在 Spring 上下文加载时停止调用 Spring Quartz 作业
我的应用程序有多个作业,需要在用户需要时以编程方式执行。
我已经使用 MethodInvokingJobFactoryBean 实现了所有作业,问题是每当我的 spring 上下文加载时,所有作业都会被解雇。
如何在Spring上下文加载时停止Job的执行?
提前致谢 阿杰
My application has got multiple Jobs which needs to be executed programatically when user wants.
I have implemented all the Jobs using MethodInvokingJobFactoryBean and the issue is whenever my spring context gets loads up all the Jobs gets fired.
How to stop the execution of Job on spring context loading ??
Thanks in advance
Ajay
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设你有问题,因为你的工作调用尚未初始化的bean?
那么您将会对 bean 元素上的 depends-on 属性感兴趣。
您还可以在 SchedulerFactoryBean 上设置 startupDelay 属性。
I assume you have problem because your job calls beans which has not been initialized?
Then you will be interested in depends-on attribute on bean element.
You can also set startupDelay property on SchedulerFactoryBean.