Search in sources :

Example 1 with JobAndTrigger

use of com.cloud.zhuwj.quartz.domain.JobAndTrigger in project spring-cloud-framework by zhuwj921.

the class JobAndTriggerImpl method getJobAndTriggerDetails.

public PageInfo<JobAndTrigger> getJobAndTriggerDetails(int pageNum, int pageSize) throws SchedulerException {
    PageHelper.startPage(pageNum, pageSize);
    List<JobAndTrigger> list = jobAndTriggerDAO.getJobAndTriggerDetails();
    Iterator<JobAndTrigger> listIt = list.iterator();
    while (listIt.hasNext()) {
        JobAndTrigger jobAndTrigger = listIt.next();
        Trigger.TriggerState triggerState = scheduler.getTriggerState(new TriggerKey(jobAndTrigger.getTriggerName(), jobAndTrigger.getTriggerGroup()));
        if (triggerState == Trigger.TriggerState.NORMAL) {
            jobAndTrigger.setRunning(true);
        }
    }
    PageInfo<JobAndTrigger> page = new PageInfo<JobAndTrigger>(list);
    return page;
}
Also used : TriggerKey(org.quartz.TriggerKey) PageInfo(com.github.pagehelper.PageInfo) Trigger(org.quartz.Trigger) JobAndTrigger(com.cloud.zhuwj.quartz.domain.JobAndTrigger) JobAndTrigger(com.cloud.zhuwj.quartz.domain.JobAndTrigger)

Aggregations

JobAndTrigger (com.cloud.zhuwj.quartz.domain.JobAndTrigger)1 PageInfo (com.github.pagehelper.PageInfo)1 Trigger (org.quartz.Trigger)1 TriggerKey (org.quartz.TriggerKey)1