• quartz获取缓存中所有运行中的Job


    原文地址:https://blog.csdn.net/zzm8421/article/details/77769203

    Quartz 2.1.5:

    public static void getAllJobs(){
            try {
                Scheduler scheduler = schedulerFactory.getScheduler();
                for (String groupName : scheduler.getJobGroupNames()) {
                    for (JobKey jobKey : scheduler.getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
                        String jobName = jobKey.getName();
                        String jobGroup = jobKey.getGroup();
                        //get job's trigger
                        List<Trigger> triggers = (List<Trigger>) scheduler.getTriggersOfJob(jobKey);
                        Date nextFireTime = triggers.get(0).getNextFireTime();
                        System.out.println("[jobName] : " + jobName + " [groupName] : "
                            + jobGroup + " - " + nextFireTime);
                    }
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

    Quartz 1.8.6

    Scheduler scheduler = new StdSchedulerFactory().getScheduler();
    
    //loop all group
    for (String groupName : scheduler.getJobGroupNames()) {
    
    //loop all jobs by groupname
    for (String jobName : scheduler.getJobNames(groupName)) {
    
          //get job's trigger
      Trigger[] triggers = scheduler.getTriggersOfJob(jobName,groupName);
      Date nextFireTime = triggers[0].getNextFireTime();
    
      System.out.println("[jobName] : " + jobName + " [groupName] : "
            + groupName + " - " + nextFireTime);
    
    }
    
    }
  • 相关阅读:
    TypeScript 里 interface 和 type 的区别
    TypeScript 定义函数的几种写法
    什么是 TypeScript 里的 Constructor signature
    Linux 主要的发行系统版本介绍
    PHP跨域
    26. Remove Duplicates from Sorted Array
    关于hashmap的文章
    1. Two Sum
    qt5-资源与图像
    qt--QDialogButtonBox按钮盒
  • 原文地址:https://www.cnblogs.com/dyh004/p/9399596.html
Copyright © 2020-2023  润新知