1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.sys.batch;
17
18 import java.text.ParseException;
19
20 import org.quartz.CronTrigger;
21 import org.quartz.Trigger;
22
23 public class CronTriggerDescriptor extends TriggerDescriptor {
24 private String cronExpression;
25
26
27
28
29 protected void completeTriggerDescription(Trigger trigger) {
30
31 try {
32 ((CronTrigger) trigger).setTimeZone(getDateTimeService().getCurrentCalendar().getTimeZone());
33 if (!isTestMode()) {
34 ((CronTrigger) trigger).setCronExpression(cronExpression);
35 }
36 else {
37 ((CronTrigger) trigger).setCronExpression("0 59 23 31 12 ? 2099");
38 }
39 }
40 catch (ParseException e) {
41 throw new RuntimeException("Caught exception while trying to set the cronExpression attribute of a CronTrigger: " + getJobName(), e);
42 }
43 }
44
45
46
47
48
49
50 public void setCronExpression(String cronExpression) {
51 this.cronExpression = cronExpression;
52 }
53 }