1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package com.xpn.xwiki.plugin.scheduler.internal; |
21 |
|
|
22 |
|
import org.quartz.JobDetail; |
23 |
|
import org.quartz.JobExecutionContext; |
24 |
|
import org.quartz.JobExecutionException; |
25 |
|
import org.quartz.JobKey; |
26 |
|
import org.quartz.JobListener; |
27 |
|
import org.quartz.SchedulerException; |
28 |
|
import org.quartz.SchedulerListener; |
29 |
|
import org.quartz.Trigger; |
30 |
|
import org.quartz.TriggerKey; |
31 |
|
import org.slf4j.Logger; |
32 |
|
import org.slf4j.LoggerFactory; |
33 |
|
|
34 |
|
|
35 |
|
@version |
36 |
|
@since |
37 |
|
|
|
|
| 57.6% |
Uncovered Elements: 14 (33) |
Complexity: 24 |
Complexity Density: 2.67 |
|
38 |
|
public class StatusListener implements SchedulerListener, JobListener |
39 |
|
{ |
40 |
|
|
41 |
|
|
42 |
|
|
43 |
|
private static final Logger LOGGER = LoggerFactory.getLogger(StatusListener.class); |
44 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
45 |
6 |
@Override... |
46 |
|
public void jobScheduled(Trigger trigger) |
47 |
|
{ |
48 |
6 |
LOGGER.info("Task [{}] scheduled", trigger.getKey()); |
49 |
|
} |
50 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
51 |
1 |
@Override... |
52 |
|
public void jobUnscheduled(TriggerKey key) |
53 |
|
{ |
54 |
1 |
LOGGER.info("Task [{}] unscheduled", key); |
55 |
|
} |
56 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
57 |
2 |
@Override... |
58 |
|
public void triggerFinalized(Trigger trigger) |
59 |
|
{ |
60 |
|
} |
61 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
62 |
0 |
@Override... |
63 |
|
public void triggerPaused(TriggerKey triggerKey) |
64 |
|
{ |
65 |
|
} |
66 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
67 |
0 |
@Override... |
68 |
|
public void triggerResumed(TriggerKey triggerKey) |
69 |
|
{ |
70 |
|
} |
71 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
72 |
1 |
@Override... |
73 |
|
public void jobPaused(JobKey jobKey) |
74 |
|
{ |
75 |
1 |
LOGGER.info("Task [{}] paused", jobKey); |
76 |
|
} |
77 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
78 |
1 |
@Override... |
79 |
|
public void jobResumed(JobKey jobKey) |
80 |
|
{ |
81 |
1 |
LOGGER.info("Task [{}] resumed", jobKey); |
82 |
|
} |
83 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
84 |
0 |
@Override... |
85 |
|
public void schedulerError(String message, SchedulerException error) |
86 |
|
{ |
87 |
0 |
LOGGER.error(message, error); |
88 |
|
} |
89 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
90 |
0 |
@Override... |
91 |
|
public void schedulerShutdown() |
92 |
|
{ |
93 |
0 |
LOGGER.warn("Scheduler is shutting down"); |
94 |
|
} |
95 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
96 |
12 |
@Override... |
97 |
|
public String getName() |
98 |
|
{ |
99 |
12 |
return "StatusListener"; |
100 |
|
} |
101 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
102 |
2 |
@Override... |
103 |
|
public void jobToBeExecuted(JobExecutionContext context) |
104 |
|
{ |
105 |
2 |
LOGGER.info("Task [{}] is about to be executed", context.getJobDetail().getKey()); |
106 |
|
} |
107 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
108 |
0 |
@Override... |
109 |
|
public void jobExecutionVetoed(JobExecutionContext context) |
110 |
|
{ |
111 |
|
} |
112 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
113 |
2 |
@Override... |
114 |
|
public void jobWasExecuted(JobExecutionContext context, JobExecutionException e) |
115 |
|
{ |
116 |
2 |
LOGGER.info("Task [{}] executed: ", context.getJobDetail().getKey(), e); |
117 |
|
} |
118 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
119 |
0 |
@Override... |
120 |
|
public void triggersPaused(String triggerGroup) |
121 |
|
{ |
122 |
|
|
123 |
|
|
124 |
|
} |
125 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
126 |
0 |
@Override... |
127 |
|
public void triggersResumed(String triggerGroup) |
128 |
|
{ |
129 |
|
|
130 |
|
|
131 |
|
} |
132 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
133 |
4 |
@Override... |
134 |
|
public void jobAdded(JobDetail jobDetail) |
135 |
|
{ |
136 |
|
|
137 |
|
|
138 |
|
} |
139 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
140 |
1 |
@Override... |
141 |
|
public void jobDeleted(JobKey jobKey) |
142 |
|
{ |
143 |
|
|
144 |
|
|
145 |
|
} |
146 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
147 |
0 |
@Override... |
148 |
|
public void jobsPaused(String jobGroup) |
149 |
|
{ |
150 |
|
|
151 |
|
|
152 |
|
} |
153 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
154 |
0 |
@Override... |
155 |
|
public void jobsResumed(String jobGroup) |
156 |
|
{ |
157 |
|
|
158 |
|
|
159 |
|
} |
160 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
161 |
0 |
@Override... |
162 |
|
public void schedulerInStandbyMode() |
163 |
|
{ |
164 |
|
|
165 |
|
|
166 |
|
} |
167 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
168 |
2 |
@Override... |
169 |
|
public void schedulerStarted() |
170 |
|
{ |
171 |
|
|
172 |
|
|
173 |
|
} |
174 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
175 |
2 |
@Override... |
176 |
|
public void schedulerStarting() |
177 |
|
{ |
178 |
|
|
179 |
|
|
180 |
|
} |
181 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
182 |
0 |
@Override... |
183 |
|
public void schedulerShuttingdown() |
184 |
|
{ |
185 |
|
|
186 |
|
|
187 |
|
} |
188 |
|
|
|
|
| - |
Uncovered Elements: 0 (0) |
Complexity: 1 |
Complexity Density: - |
|
189 |
0 |
@Override... |
190 |
|
public void schedulingDataCleared() |
191 |
|
{ |
192 |
|
|
193 |
|
|
194 |
|
} |
195 |
|
} |