将参数传递给 Quartz 中的作业
目前我有一个代码,它有一个 java main 方法,并且需要很少的命令行参数来执行。我正在将其作为一项石英工作,我想将参数传递给这项工作。
我有办法做到吗?我对 JobDataMap 做了一些分析,但我不确定是否可以将它用于此目的。
此外,这项工作将是一次性工作,需要用户暂停和继续某种操作。对于石英这种情况,我应该扩展或使用什么样的工作?
非常感谢您抽出时间。
干杯, 阿比
Presently I have a code that has a java main method and which takes few command line args for its execution. I am in the process of making this as a quartz job, I would like to pass the arguments to this job.
Is there a way I can do it? I did some analysis on the JobDataMap but I am not sure if I can use it for this purpose.
Also, this job is going to be one time job that requires pause and continue kind of actions from the user. What kind of job should I extend or use for this case w.r.t quartz?
Thanks a bunch for your time.
Cheers,
Abi
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,是的,JobDataMap 可以让您将参数传递给您的作业,为此目的使用它没有问题!
其次,问题不在于要扩展哪个 Job(Job 类必须足够),而是更多 - 使用哪个触发器?
不知道您到底需要哪种用户交互,但您必须能够使用待机来实现您的目标
First, yes JobDataMap is here to let you pass parameters to your job, no problem about using it for that purpose !
Second, the question is not which Job to extend (Job class must be sufficient) but more - which trigger to use ?
Don't know exactly which user interaction you need, but you must be able to achieve your goal using Standby