提交 7acc5887 编写于 作者: K kohsuke

moved one more method.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1580 71c3de6d-444a-0410-be80-ed276b4c234a
上级 44f444e2
......@@ -11,6 +11,11 @@ import java.io.IOException;
import java.io.PrintStream;
import java.util.Calendar;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import javax.servlet.ServletException;
/**
* Base implementation of {@link Run}s that build software.
*
......@@ -103,4 +108,20 @@ public abstract class AbstractBuild<P extends AbstractProject<P,R>,R extends Abs
protected abstract Result doRun(BuildListener listener) throws Exception;
}
/**
* Stops this build if it's still going.
*
* If we use this/executor/stop URL, it causes 404 if the build is already killed,
* as {@link #getExecutor()} returns null.
*/
public synchronized void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
Executor e = getExecutor();
if(e!=null)
e.doStop(req,rsp);
else
// nothing is building
rsp.forwardToPreviousPage(req);
}
}
......@@ -15,11 +15,8 @@ import hudson.tasks.Fingerprinter.FingerprintAction;
import hudson.tasks.Publisher;
import hudson.tasks.test.AbstractTestResultAction;
import hudson.triggers.SCMTrigger;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.xml.sax.SAXException;
import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
......@@ -321,21 +318,6 @@ public final class Build extends AbstractBuild<Project,Build> {
// actions
//
//
/**
* Stops this build if it's still going.
*
* If we use this/executor/stop URL, it causes 404 if the build is already killed,
* as {@link #getExecutor()} returns null.
*/
public synchronized void doStop( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
Executor e = getExecutor();
if(e!=null)
e.doStop(req,rsp);
else
// nothing is building
rsp.forwardToPreviousPage(req);
}
/**
* Performs a build.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册