简体   繁体   中英

getJobNames() in quartz scheduler 2.2.1

We are upgrading from quartz scheduler release 1.8.6 to 2.2.1 .

In 1.8.6 we did this:

String[] jobs = sched.getJobNames(Scheduler.DEFAULT_GROUP);

How do I achieve this in quartz scheduler 2.2.1 ?

I have tried the GroupMatcher thing, with a TriggerKey match and the sched.getTriggerKeys , but I cannot get it to work.

In quartz 2.0.xa GroupMatcher class was introduced. So, to get job keys you should write something like this:

scheduler.getJobKeys(GroupMatcher.jobGroupEquals(Scheduler.DEFAULT_GROUP))

Have a look at GroupMatcher javadoc: http://quartz-scheduler.org/api/2.2.0/org/quartz/impl/matchers/GroupMatcher.html

By the way, there is a comprehensive migration guide from 1.8.x to 2.0.x on Quartz-Scheduler site: http://quartz-scheduler.org/documentation/quartz-2.x/migration-guide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM