1 17 18 21 package org.quartz.xml; 22 23 import java.util.ArrayList ; 24 import java.util.Date ; 25 import java.util.List ; 26 27 import org.quartz.JobDetail; 28 import org.quartz.Trigger; 29 30 36 public class JobSchedulingBundle { 37 44 45 protected JobDetail jobDetail; 46 47 protected List triggers = new ArrayList (); 48 49 56 57 public JobSchedulingBundle() { 58 } 59 60 67 68 public JobDetail getJobDetail() { 69 return jobDetail; 70 } 71 72 public void setJobDetail(JobDetail jobDetail) { 73 this.jobDetail = jobDetail; 74 } 75 76 public List getTriggers() { 77 return triggers; 78 } 79 80 public void setTriggers(List triggers) { 81 this.triggers = triggers; 82 } 83 84 public void addTrigger(Trigger trigger) { 85 if (trigger.getStartTime() == null) { 86 trigger.setStartTime(new Date ()); 87 } 88 89 triggers.add(trigger); 90 } 91 92 public void removeTrigger(Trigger trigger) { 93 triggers.remove(trigger); 94 } 95 96 public String getName() { 97 if (getJobDetail() != null) { 98 return getJobDetail().getName(); 99 } else { 100 return null; 101 } 102 } 103 public String getFullName() { 104 if (getJobDetail() != null) { 105 return getJobDetail().getFullName(); 106 } else { 107 return null; 108 } 109 } 110 111 112 public boolean isValid() { 113 return ((getJobDetail() != null) && (getTriggers() != null)); 114 } 115 } 116 | Popular Tags |