public List<Trigger> getTriggersForJob(QuartzInstance quartzInstance, Scheduler scheduler,
String jobName, String groupName) throws Exception {
List<Trigger> triggers = null;
JMXInput jmxInput = new JMXInput(quartzInstance, new String[]{String.class.getName(), String.class.getName()}, "getTriggersOfJob", new Object[]{jobName, groupName}, scheduler.getObjectName());
@SuppressWarnings("unchecked")
List<CompositeDataSupport> list = (List<CompositeDataSupport>) JMXUtil.callJMXOperation(jmxInput);
if (list != null && list.size() > 0)
{
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)
{