log.info("-------"+jobName+" trigger size:"+list.size());
triggers = new ArrayList<Trigger>();
for (int i = 0; i < list.size(); i++)
{
CompositeDataSupport compositeDataSupport = (CompositeDataSupport) list.get(i);
Trigger trigger = new Trigger();
trigger.setCalendarName((String) JMXUtil.convertToType(compositeDataSupport, "calendarName"));
log.info("-------"+jobName+" trigger's calendar name:"+trigger.getCalendarName());
trigger.setDescription((String) JMXUtil.convertToType(compositeDataSupport, "description"));
trigger.setEndTime((Date) JMXUtil.convertToType(compositeDataSupport, "endTime"));
trigger.setFinalFireTime((Date) JMXUtil.convertToType(compositeDataSupport, "finalFireTime"));
trigger.setFireInstanceId((String) JMXUtil.convertToType(compositeDataSupport, "fireInstanceId"));
trigger.setGroup((String) JMXUtil.convertToType(compositeDataSupport, "group"));
trigger.setJobGroup((String) JMXUtil.convertToType(compositeDataSupport, "jobGroup"));
trigger.setJobName((String) JMXUtil.convertToType(compositeDataSupport, "jobName"));
log.info("-------"+jobName+" trigger's job name:"+trigger.getJobName());
trigger.setMisfireInstruction(((Integer) JMXUtil.convertToType(compositeDataSupport, "misfireInstruction")).intValue());
trigger.setName((String) JMXUtil.convertToType(compositeDataSupport, "name"));
log.info("-------"+jobName+" trigger's name:"+trigger.getName());
trigger.setNextFireTime((Date) JMXUtil.convertToType(compositeDataSupport, "nextFireTime"));
log.info("-------"+jobName+" trigger's nextFireTime:"+trigger.getNextFireTime());
trigger.setPreviousFireTime((Date) JMXUtil.convertToType(compositeDataSupport, "previousFireTime"));
trigger.setPriority(((Integer) JMXUtil.convertToType(compositeDataSupport, "priority")).intValue());
trigger.setStartTime((Date) JMXUtil.convertToType(compositeDataSupport, "startTime"));
try
{
JMXInput stateJmxInput = new JMXInput(quartzInstance, new String[]{String.class.getName(), String.class.getName()}, "getTriggerState", new Object[]{trigger.getName(), trigger.getGroup()}, scheduler.getObjectName());
String state = (String) JMXUtil.callJMXOperation(stateJmxInput);
trigger.setSTriggerState(state);
}
catch (Throwable tt)
{
trigger.setSTriggerState(Trigger.STATE_GET_ERROR);
}
//删除group为"now"的trigger
if(trigger.getGroup().equals("now")){
deleteTrigger(quartzInstance, scheduler, trigger);
}else{
triggers.add(trigger);
}
}