在 Spring 上下文加载时停止调用 Spring Quartz 作业

发布于 2024-09-06 21:22:13 字数 168 浏览 3 评论 0原文

我的应用程序有多个作业,需要在用户需要时以编程方式执行。

我已经使用 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别念他 2024-09-13 21:22:13

我假设你有问题,因为你的工作调用尚未初始化的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文