KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > hudson > maven > MavenBuildProxy


1 package hudson.maven;
2
3 import hudson.FilePath;
4 import hudson.model.Result;
5
6 import java.io.Serializable JavaDoc;
7 import java.io.IOException JavaDoc;
8
9 /**
10  * Remoting proxy interface for {@link MavenReporter}s to talk to {@link MavenBuild}
11  * during the build.
12  *
13  * @author Kohsuke Kawaguchi
14  */

15 public interface MavenBuildProxy {
16     /**
17      * Executes the given {@link BuildCallable} on the master, where one
18      * has access to {@link MavenBuild} and all the other Hudson objects.
19      *
20      * <p>
21      * The parameter, return value, and exception are all transfered by using
22      * Java serialization.
23      *
24      * @return
25      * the value that {@link BuildCallable} returned.
26      * @throws T
27      * if {@link BuildCallable} throws this exception.
28      * @throws IOException
29      * if the remoting failed.
30      * @throws InterruptedException
31      * if the remote execution is aborted.
32      */

33     <V,T extends Throwable JavaDoc> V execute( BuildCallable<V,T> program ) throws T, IOException JavaDoc, InterruptedException JavaDoc;
34
35     /**
36      * Root directory of the build.
37      *
38      * @see MavenBuild#getRootDir()
39      */

40     FilePath getRootDir();
41
42     /**
43      * Root directory of the parent of this build.
44      */

45     FilePath getProjectRootDir();
46
47     /**
48      * @see MavenBuild#getArtifactsDir()
49      */

50     FilePath getArtifactsDir();
51
52     /**
53      * @see MavenBuild#setResult(Result)
54      */

55     void setResult(Result result);
56
57     /**
58      * Nominates that the reporter will contribute a project action
59      * for this build by using {@link MavenReporter#getProjectAction(MavenModule)}.
60      *
61      * <p>
62      * The specified {@link MavenReporter} object will be transfered to the master
63      * and will become a persisted part of the {@link MavenBuild}.
64      */

65     void registerAsProjectAction(MavenReporter reporter);
66
67     public interface BuildCallable<V,T extends Throwable JavaDoc> extends Serializable JavaDoc {
68         /**
69          * Performs computation and returns the result,
70          * or throws some exception.
71          *
72          * @throws InterruptedException
73          * if the processing is interrupted in the middle. Exception will be
74          * propagated to the caller.
75          * @throws IOException
76          * if the program simply wishes to propage the exception, it may throw
77          * {@link IOException}.
78          */

79         V call(MavenBuild build) throws T, IOException JavaDoc, InterruptedException JavaDoc;
80     }
81 }
82
Popular Tags