1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.hr.time.scheduler;
17
18
19 import java.util.Calendar;
20 import org.quartz.JobExecutionContext;
21 import org.quartz.JobExecutionException;
22 import org.springframework.scheduling.quartz.QuartzJobBean;
23
24 public class TimeBlockSerializerJobBean extends QuartzJobBean{
25
26 private static TimeBlockSerializerService timeBlockSerializerService;
27
28
29
30 public TimeBlockSerializerService getTimeBlockSerializerService() {
31 return timeBlockSerializerService;
32 }
33
34
35
36 public void setTimeBlockSerializerService(
37 TimeBlockSerializerService timeBlockSerializerService) {
38 TimeBlockSerializerJobBean.timeBlockSerializerService = timeBlockSerializerService;
39 }
40
41
42 @Override
43 protected void executeInternal(JobExecutionContext arg0)
44 throws JobExecutionException {
45 try {
46
47
48 System.out.println("Executed at :"+Calendar.getInstance().getTime());
49 timeBlockSerializerService.serializeToCSV();
50 timeBlockSerializerService.serializeToXML();
51 } catch (Exception e) {
52
53 e.printStackTrace();
54
55 }
56
57 }
58
59
60 }