Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
jenkins
提交
7156e447
J
jenkins
项目概览
xxadev
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
J
jenkins
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7156e447
编写于
8月 18, 2014
作者:
J
Jesse Glick
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'JENKINS-24110' of github.com:synopsys-arc-oss/jenkins
上级
cd33cdd8
128344dd
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
7 deletion
+22
-7
core/src/main/java/hudson/model/AbstractProject.java
core/src/main/java/hudson/model/AbstractProject.java
+1
-1
core/src/main/java/hudson/model/Executor.java
core/src/main/java/hudson/model/Executor.java
+7
-0
core/src/main/java/hudson/model/Queue.java
core/src/main/java/hudson/model/Queue.java
+1
-1
core/src/main/java/hudson/model/ResourceController.java
core/src/main/java/hudson/model/ResourceController.java
+2
-1
core/src/main/java/hudson/model/queue/QueueTaskFilter.java
core/src/main/java/hudson/model/queue/QueueTaskFilter.java
+2
-1
core/src/main/java/hudson/model/queue/SubTask.java
core/src/main/java/hudson/model/queue/SubTask.java
+6
-1
core/src/main/java/hudson/model/queue/WorkUnit.java
core/src/main/java/hudson/model/queue/WorkUnit.java
+3
-2
未找到文件。
core/src/main/java/hudson/model/AbstractProject.java
浏览文件 @
7156e447
...
...
@@ -1183,7 +1183,7 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
return
r
;
}
public
R
createExecutable
()
throws
IOException
{
public
@CheckForNull
R
createExecutable
()
throws
IOException
{
if
(
isDisabled
())
return
null
;
return
newBuild
();
}
...
...
core/src/main/java/hudson/model/Executor.java
浏览文件 @
7156e447
...
...
@@ -220,6 +220,13 @@ public class Executor extends Thread implements ModelObject {
try
{
workUnit
.
context
.
synchronizeStart
();
// this code handles the behavior of null Executables returned
// by tasks. In such case Jenkins starts the workUnit in order
// to report results to console outputs.
if
(
executable
==
null
)
{
throw
new
Error
(
"The null Executable has been created for "
+
workUnit
+
". The task cannot be executed"
);
}
if
(
executable
instanceof
Actionable
)
{
for
(
Action
action:
workUnit
.
context
.
actions
)
{
((
Actionable
)
executable
).
addAction
(
action
);
...
...
core/src/main/java/hudson/model/Queue.java
浏览文件 @
7156e447
...
...
@@ -1892,7 +1892,7 @@ public class Queue extends ResourceController implements Saveable {
* the primary executable (such as {@link AbstractBuild}) that created out of it.
*/
@Exported
public
Executable
getExecutable
()
{
public
@CheckForNull
Executable
getExecutable
()
{
return
outcome
!=
null
?
outcome
.
getPrimaryWorkUnit
().
getExecutable
()
:
null
;
}
...
...
core/src/main/java/hudson/model/ResourceController.java
浏览文件 @
7156e447
...
...
@@ -30,6 +30,7 @@ import java.util.Collection;
import
java.util.AbstractCollection
;
import
java.util.Iterator
;
import
java.util.concurrent.CopyOnWriteArraySet
;
import
javax.annotation.Nonnull
;
/**
* Controls mutual exclusion of {@link ResourceList}.
...
...
@@ -73,7 +74,7 @@ public class ResourceController {
* @throws InterruptedException
* the thread can be interrupted while waiting for the available resources.
*/
public
void
execute
(
Runnable
task
,
ResourceActivity
activity
)
throws
InterruptedException
{
public
void
execute
(
@Nonnull
Runnable
task
,
ResourceActivity
activity
)
throws
InterruptedException
{
ResourceList
resources
=
activity
.
getResourceList
();
synchronized
(
this
)
{
while
(
inUse
.
isCollidingWith
(
resources
))
...
...
core/src/main/java/hudson/model/queue/QueueTaskFilter.java
浏览文件 @
7156e447
...
...
@@ -33,6 +33,7 @@ import hudson.model.ResourceList;
import
java.io.IOException
;
import
java.util.Collection
;
import
javax.annotation.CheckForNull
;
/**
* Base class for defining filter {@link hudson.model.Queue.Task}.
...
...
@@ -79,7 +80,7 @@ public abstract class QueueTaskFilter implements Queue.Task {
return
base
.
getEstimatedDuration
();
}
public
Executable
createExecutable
()
throws
IOException
{
public
@CheckForNull
Executable
createExecutable
()
throws
IOException
{
return
base
.
createExecutable
();
}
...
...
core/src/main/java/hudson/model/queue/SubTask.java
浏览文件 @
7156e447
...
...
@@ -23,6 +23,7 @@
*/
package
hudson.model.queue
;
import
hudson.model.AbstractProject
;
import
hudson.model.Executor
;
import
hudson.model.Label
;
import
hudson.model.Node
;
...
...
@@ -32,6 +33,7 @@ import hudson.model.ResourceActivity;
import
javax.annotation.Nonnull
;
import
java.io.IOException
;
import
javax.annotation.CheckForNull
;
/**
* A component of {@link Task} that represents a computation carried out by a single {@link Executor}.
...
...
@@ -70,8 +72,11 @@ public interface SubTask extends ResourceActivity {
/**
* Creates {@link Executable}, which performs the actual execution of the task.
* @return {@link Executable} to be launched or null if the executable cannot be
* created (e.g. {@link AbstractProject} is disabled)
* @exception IOException {@link Executable} cannot be created
*/
Executable
createExecutable
()
throws
IOException
;
@CheckForNull
Executable
createExecutable
()
throws
IOException
;
/**
* Gets the {@link Task} that this subtask belongs to.
...
...
core/src/main/java/hudson/model/queue/WorkUnit.java
浏览文件 @
7156e447
...
...
@@ -27,6 +27,7 @@ import hudson.model.Executor;
import
hudson.model.Queue
;
import
hudson.model.Queue.Executable
;
import
hudson.model.Queue.Task
;
import
javax.annotation.CheckForNull
;
import
org.kohsuke.accmod.Restricted
;
import
org.kohsuke.accmod.restrictions.NoExternalUse
;
import
org.kohsuke.stapler.export.ExportedBean
;
...
...
@@ -63,11 +64,11 @@ public final class WorkUnit {
* {@link Executor#getCurrentWorkUnit()} and {@link WorkUnit#getExecutor()}
* form a bi-directional reachability between them.
*/
public
Executor
getExecutor
()
{
public
@CheckForNull
Executor
getExecutor
()
{
return
executor
;
}
public
void
setExecutor
(
Executor
e
)
{
public
void
setExecutor
(
@CheckForNull
Executor
e
)
{
executor
=
e
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录