1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.ole.gl.batch;
17
18 import org.kuali.ole.gl.service.ScrubberService;
19 import org.kuali.ole.sys.batch.AbstractWrappedBatchStep;
20 import org.kuali.ole.sys.batch.service.WrappedBatchExecutorService.CustomBatchExecutor;
21 import org.springframework.util.StopWatch;
22
23
24
25
26 public class DemergerStep extends AbstractWrappedBatchStep {
27 private ScrubberService scrubberService;
28 private static org.apache.log4j.Logger LOG = org.apache.log4j.Logger.getLogger(DemergerStep.class);
29
30
31
32
33
34 @Override
35 protected CustomBatchExecutor getCustomBatchExecutor() {
36 return new CustomBatchExecutor() {
37 public boolean execute() {
38 final String jobName = "demerger";
39 StopWatch stopWatch = new StopWatch();
40 stopWatch.start(jobName);
41 scrubberService.performDemerger();
42
43 stopWatch.stop();
44 LOG.info("scrubber step of " + jobName + " took " + (stopWatch.getTotalTimeSeconds() / 60.0) + " minutes to complete");
45 if (LOG.isDebugEnabled()) {
46 LOG.debug("scrubber step of " + jobName + " took " + (stopWatch.getTotalTimeSeconds() / 60.0) + " minutes to complete");
47 }
48 return true;
49 }
50 };
51 }
52
53
54
55
56
57
58
59 public void setScrubberService(ScrubberService ss) {
60 scrubberService = ss;
61 }
62 }