File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\tasks\BuildStepMonitor.java.html

1 package hudson.tasks;
2
3 import hudson.model.AbstractBuild;
4 import hudson.model.BuildListener;
5 import hudson.model.CheckPoint;
6 import hudson.Launcher;
7
8 import java.io.IOException;
9
10 /**
11 * Used by {@link BuildStep#getRequiredMonitorService()}.
12 *
13 * @author Kohsuke Kawaguchi
14 * @since 1.319
15 */
16 public enum BuildStepMonitor {
17 NONE {
18 public boolean perform(BuildStep bs, AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
19 return bs.perform(build,launcher,listener);
20 }
21 },
22 STEP {
23 public boolean perform(BuildStep bs, AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
24 CheckPoint cp = new CheckPoint(bs.getClass().getName(),bs.getClass());
25 cp.block();
26 try {
27 return bs.perform(build,launcher,listener);
28 } finally {
29 cp.report();
30 }
31 }
32 },
33 BUILD {
34 public boolean perform(BuildStep bs, AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException {
35 CheckPoint.COMPLETED.block();
36 return bs.perform(build,launcher,listener);
37 }
38 };
39
40 /**
41 * Calls {@link BuildStep#perform(AbstractBuild, Launcher, BuildListener)} with the proper synchronization.
42 */
43 public abstract boolean perform(BuildStep bs, AbstractBuild build, Launcher launcher, BuildListener listener) throws IOException, InterruptedException;
44 }
45