KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > model > TaskListener


1 package hudson.model;
2
3 import hudson.util.NullStream;
4 import hudson.util.StreamTaskListener;
5
6 import java.io.PrintStream JavaDoc;
7 import java.io.PrintWriter JavaDoc;
8
9 /**
10  * Receives events that happen during some task execution,
11  * such as a build or SCM change polling.
12  *
13  * @author Kohsuke Kawaguchi
14  */

15 public interface TaskListener {
16     /**
17      * This writer will receive the output of the build.
18      *
19      * @return
20      * must be non-null.
21      */

22     PrintStream JavaDoc getLogger();
23
24     /**
25      * An error in the build.
26      *
27      * @return
28      * A writer to receive details of the error. Not null.
29      */

30     PrintWriter JavaDoc error(String JavaDoc msg);
31
32     /**
33      * A fatal error in the build.
34      *
35      * @return
36      * A writer to receive details of the error. Not null.
37      */

38     PrintWriter JavaDoc fatalError(String JavaDoc msg);
39
40     /**
41      * {@link TaskListener} that discards the output.
42      */

43     public static final TaskListener NULL = new StreamTaskListener(new NullStream());
44 }
45
Popular Tags