本文整理了Java中hudson.model.Job.isBuilding()
方法的一些代码示例,展示了Job.isBuilding()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Job.isBuilding()
方法的具体详情如下:
包路径:hudson.model.Job
类名称:Job
方法名:isBuilding
暂无
代码示例来源:origin: jenkinsci/jenkins
/**
* {@inheritDoc}
*/
@Override
protected void checkRename(String newName) throws Failure {
if (isBuilding()) {
throw new Failure(Messages.Job_NoRenameWhileBuilding());
}
}
代码示例来源:origin: jenkinsci/jenkins
if (j.isBuilding()) {
LOGGER.log(Level.FINE, "Job {0} is building, so not deleting", item.getFullDisplayName());
return false;
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
public boolean superIsBuilding() {
return super.isBuilding();
}
代码示例来源:origin: org.jenkins-ci.plugins/cloudbees-folder
/**
* Allows a subclass to block renames under dynamic conditions.
* @return a message if rename should currently be prohibited, or null to allow
*/
@CheckForNull
protected String renameBlocker() {
for (Job<?,?> job : getAllJobs()) {
if (job.isBuilding()) {
return "Unable to rename a folder while a job inside it is building.";
}
}
return null;
}
代码示例来源:origin: jenkinsci/ghprb-plugin
public void onScheduleBuild(Job<?, ?> project, GhprbCause cause) {
if (project == null || cause == null) {
return;
}
if (project.isBuilding() || project.isInQueue()) {
cancelCurrentBuilds(project, cause.getPullID());
}
}
代码示例来源:origin: org.jenkins-ci.plugins/python-wrapper
@Override
public boolean isBuilding() {
initPython();
if (pexec.isImplemented(8)) {
return pexec.execPythonBool("is_building");
} else {
return super.isBuilding();
}
}
代码示例来源:origin: jenkinsci/cloudbees-folder-plugin
/**
* {@inheritDoc}
*/
@Override
protected void checkRename(String newName) {
for (Job<?,?> job : getAllJobs()) {
if (job.isBuilding()) {
throw new Failure("Unable to rename a folder while a job inside it is building.");
}
}
String blocker = renameBlocker();
if (blocker != null) {
throw new Failure(blocker);
}
}
代码示例来源:origin: org.jenkins-ci.main/jenkins-core
/**
* Renames this job.
*/
@RequirePOST
public/* not synchronized. see renameTo() */void doDoRename(
StaplerRequest req, StaplerResponse rsp) throws IOException,
ServletException {
if (!hasPermission(CONFIGURE)) {
// rename is essentially delete followed by a create
checkPermission(CREATE);
checkPermission(DELETE);
}
String newName = req.getParameter("newName");
Jenkins.checkGoodName(newName);
if (isBuilding()) {
// redirect to page explaining that we can't rename now
rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
return;
}
renameTo(newName);
// send to the new job page
// note we can't use getUrl() because that would pick up old name in the
// Ancestor.getUrl()
rsp.sendRedirect2("../" + newName);
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
if (item instanceof Job<?, ?>) {
job = (Job) item;
if (job.isBuilding()) {
return new TeamUtils.ErrorHttpResponse(job.getName() + " is building.");
代码示例来源:origin: org.jvnet.hudson.main/hudson-core
/**
* Renames this job.
*/
public/* not synchronized. see renameTo() */void doDoRename(
StaplerRequest req, StaplerResponse rsp) throws IOException,
ServletException {
requirePOST();
// rename is essentially delete followed by a create
checkPermission(CREATE);
checkPermission(DELETE);
String newName = req.getParameter("newName");
Hudson.checkGoodName(newName);
if (isBuilding()) {
// redirect to page explaining that we can't rename now
rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
return;
}
renameTo(newName);
// send to the new job page
// note we can't use getUrl() because that would pick up old name in the
// Ancestor.getUrl()
rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl()
+ getShortUrl());
}
代码示例来源:origin: org.eclipse.hudson.main/hudson-core
/**
* Renames this job.
*/
public/* not synchronized. see renameTo() */ void doDoRename(
StaplerRequest req, StaplerResponse rsp) throws IOException,
ServletException {
requirePOST();
// rename is essentially delete followed by a create
checkPermission(CREATE);
checkPermission(DELETE);
String newName = req.getParameter("newName");
Hudson.checkGoodName(newName);
if (isBuilding()) {
// redirect to page explaining that we can't rename now
rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
return;
}
renameTo(newName);
// send to the new job page
// note we can't use getUrl() because that would pick up old name in the
// Ancestor.getUrl()
rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl()
+ getShortUrl());
}
代码示例来源:origin: hudson/hudson-2.x
/**
* Renames this job.
*/
public/* not synchronized. see renameTo() */void doDoRename(
StaplerRequest req, StaplerResponse rsp) throws IOException,
ServletException {
requirePOST();
// rename is essentially delete followed by a create
checkPermission(CREATE);
checkPermission(DELETE);
String newName = req.getParameter("newName");
Hudson.checkGoodName(newName);
if (isBuilding()) {
// redirect to page explaining that we can't rename now
rsp.sendRedirect("rename?newName=" + URLEncoder.encode(newName, "UTF-8"));
return;
}
renameTo(newName);
// send to the new job page
// note we can't use getUrl() because that would pick up old name in the
// Ancestor.getUrl()
rsp.sendRedirect2(req.getContextPath() + '/' + getParent().getUrl()
+ getShortUrl());
}
代码示例来源:origin: org.eclipse.hudson/hudson-core
String checkName = newName;
if (isBuilding()) {
内容来源于网络,如有侵权,请联系作者删除!