Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
LinuxSuRen
jenkins
提交
70fde5f7
J
jenkins
项目概览
LinuxSuRen
/
jenkins
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
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,发现更多精彩内容 >>
提交
70fde5f7
编写于
12月 29, 2010
作者:
K
Kohsuke Kawaguchi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
added a callback to be notified when a child is removed
上级
46a033a9
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
38 addition
and
14 deletion
+38
-14
core/src/main/java/hudson/matrix/MatrixProject.java
core/src/main/java/hudson/matrix/MatrixProject.java
+4
-0
core/src/main/java/hudson/model/AbstractItem.java
core/src/main/java/hudson/model/AbstractItem.java
+13
-2
core/src/main/java/hudson/model/Hudson.java
core/src/main/java/hudson/model/Hudson.java
+12
-12
core/src/main/java/hudson/model/ItemGroup.java
core/src/main/java/hudson/model/ItemGroup.java
+5
-0
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
+4
-0
未找到文件。
core/src/main/java/hudson/matrix/MatrixProject.java
浏览文件 @
70fde5f7
...
...
@@ -467,6 +467,10 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
throw
new
UnsupportedOperationException
();
}
public
void
onDeleted
(
MatrixConfiguration
item
)
throws
IOException
{
// noop
}
public
File
getRootDirFor
(
Combination
combination
)
{
File
f
=
getConfigurationsDir
();
for
(
Entry
<
String
,
String
>
e
:
combination
.
entrySet
())
...
...
core/src/main/java/hudson/model/AbstractItem.java
浏览文件 @
70fde5f7
...
...
@@ -412,12 +412,23 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
checkPermission
(
DELETE
);
performDelete
();
if
(
this
instanceof
TopLevelItem
)
Hudson
.
getInstance
().
deleteJob
((
TopLevelItem
)
this
);
try
{
invokeOnDeleted
();
}
catch
(
AbstractMethodError
e
)
{
// ignore
}
Hudson
.
getInstance
().
rebuildDependencyGraph
();
}
/**
* A pointless function to work around what appears to be a HotSpot problem. See HUDSON-5756 and bug 6933067
* on BugParade for more details.
*/
private
void
invokeOnDeleted
()
throws
IOException
{
getParent
().
onDeleted
(
this
);
}
/**
* Does the real job of deleting the item.
*/
...
...
core/src/main/java/hudson/model/Hudson.java
浏览文件 @
70fde5f7
...
...
@@ -2153,28 +2153,28 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
}
/**
* Called in response to {@link Job#doDoDelete(StaplerRequest, StaplerResponse)}
* Called by {@link Job#renameTo(String)} to update relevant data structure.
* assumed to be synchronized on Hudson by the caller.
*/
/*package*/
void
deleteJob
(
TopLevelItem
item
)
throws
IOException
{
for
(
ItemListener
l
:
ItemListener
.
all
())
l
.
onDeleted
(
item
);
public
void
onRenamed
(
TopLevelItem
job
,
String
oldName
,
String
newName
)
throws
IOException
{
items
.
remove
(
oldName
);
items
.
put
(
newName
,
job
);
items
.
remove
(
item
.
getName
());
for
(
View
v
:
views
)
v
.
onJobRenamed
(
item
,
item
.
getName
(),
null
);
v
.
onJobRenamed
(
job
,
oldName
,
newName
);
save
();
}
/**
* Called by {@link Job#renameTo(String)} to update relevant data structure.
* assumed to be synchronized on Hudson by the caller.
* Called in response to {@link Job#doDoDelete(StaplerRequest, StaplerResponse)}
*/
public
void
on
Renamed
(
TopLevelItem
job
,
String
oldName
,
String
newName
)
throws
IOException
{
items
.
remove
(
oldName
);
items
.
put
(
newName
,
job
);
public
void
on
Deleted
(
TopLevelItem
item
)
throws
IOException
{
for
(
ItemListener
l
:
ItemListener
.
all
())
l
.
onDeleted
(
item
);
items
.
remove
(
item
.
getName
());
for
(
View
v
:
views
)
v
.
onJobRenamed
(
job
,
oldName
,
newName
);
v
.
onJobRenamed
(
item
,
item
.
getName
(),
null
);
save
();
}
...
...
core/src/main/java/hudson/model/ItemGroup.java
浏览文件 @
70fde5f7
...
...
@@ -77,4 +77,9 @@ public interface ItemGroup<T extends Item> extends PersistenceRoot, ModelObject
* Internal method. Called by {@link Item}s when they are renamed by users.
*/
void
onRenamed
(
T
item
,
String
oldName
,
String
newName
)
throws
IOException
;
/**
* Internal method. Called by {@link Item}s when they are deleted by users.
*/
void
onDeleted
(
T
item
)
throws
IOException
;
}
maven-plugin/src/main/java/hudson/maven/MavenModuleSet.java
浏览文件 @
70fde5f7
...
...
@@ -449,6 +449,10 @@ public final class MavenModuleSet extends AbstractMavenProject<MavenModuleSet,Ma
throw
new
UnsupportedOperationException
();
}
public
void
onDeleted
(
MavenModule
item
)
throws
IOException
{
// noop
}
public
Collection
<
Job
>
getAllJobs
()
{
Set
<
Job
>
jobs
=
new
HashSet
<
Job
>(
getItems
());
jobs
.
add
(
this
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录