1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.core.provisioning.java.job;
20
21 import org.apache.syncope.core.provisioning.api.job.JobDelegate;
22 import org.quartz.DisallowConcurrentExecution;
23 import org.quartz.InterruptableJob;
24 import org.quartz.UnableToInterruptJobException;
25
26 @DisallowConcurrentExecution
27 public abstract class AbstractInterruptableJob implements InterruptableJob {
28
29 private final JobDelegate embeddedDelegate = new JobDelegate() {
30
31 @Override
32 public void interrupt() {
33 }
34
35 @Override
36 public boolean isInterrupted() {
37 return false;
38 }
39 };
40
41 public JobDelegate getDelegate() {
42 return embeddedDelegate;
43 }
44
45 @Override
46 public void interrupt() throws UnableToInterruptJobException {
47 getDelegate().interrupt();
48 }
49 }