这个 Quartz Cron 表达式是如何执行的
我有以下内容;
private String cronExpression = "";
private final String jobID = "MyJObID";
...
Scheduler scheduler = ServiceLocator.getInstance().getScheduler();
CronTrigger trigger = new CronTrigger(jobID , Scheduler.DEFAULT_GROUP, cronExpression);
JobDetail jobDetail = new JobDetail(jobID , Scheduler.DEFAULT_GROUP, MyJob.class);
scheduler.scheduleJob(jobDetail, trigger);
我的问题是空 cron 表达式何时触发此作业?
I have a the following;
private String cronExpression = "";
private final String jobID = "MyJObID";
...
Scheduler scheduler = ServiceLocator.getInstance().getScheduler();
CronTrigger trigger = new CronTrigger(jobID , Scheduler.DEFAULT_GROUP, cronExpression);
JobDetail jobDetail = new JobDetail(jobID , Scheduler.DEFAULT_GROUP, MyJob.class);
scheduler.scheduleJob(jobDetail, trigger);
My question is when is this job triggered for the empty cron expression?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你确定它有效吗?
只需查看 org.quartz.CronExpression#buildExpression() 方法代码,看起来应该抛出异常:
[在 Quartz 1.6.0 中检查]
Are you sure it works?
Just by looking at the
org.quartz.CronExpression#buildExpression()
method code it looks like an exception should be thrown:[checked in Quartz 1.6.0]
感谢各位的帮助,找到问题了。
中设置为一些有意义的值
经过一晚的搜索,我发现该类在 JBoss 中注册为 MBean,并且 cron 表达式属性的值在部署描述符
Thanks for the help guys, found the issue.
After some night of searching i found out that the class was registered in JBoss as a MBean and a value for the cron expression attribute was set to some meaningful value in the deployment descriptor
Sigh