mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 13:32:24 +00:00
fire a callback when a job configuration is updated.
This commit is contained in:
1 parent
6f32a227f1
commit
dc0bec172f
2 files changed
+15
No files matched your search
@@ -35,6 +35,7 @@ import hudson.model.Descriptor.FormException;
|
||||
import hudson.model.Fingerprint.Range;
|
||||
import hudson.model.Fingerprint.RangeSet;
|
||||
import hudson.model.PermalinkProjectAction.Permalink;
|
||||
import hudson.model.listeners.ItemListener;
|
||||
import hudson.search.QuickSilver;
|
||||
import hudson.search.SearchIndex;
|
||||
import hudson.search.SearchIndexBuilder;
|
||||
@@ -989,6 +990,7 @@ public abstract class Job<JobT extends Job<JobT, RunT>, RunT extends Run<JobT, R
|
||||
submit(req, rsp);
|
||||
|
||||
save();
|
||||
ItemListener.fireOnUpdated(this);
|
||||
|
||||
String newName = req.getParameter("name");
|
||||
final ProjectNamingStrategy namingStrategy = Jenkins.getInstance().getProjectNamingStrategy();
|
||||
|
||||
@@ -94,6 +94,14 @@ public class ItemListener implements ExtensionPoint {
|
||||
public void onRenamed(Item item, String oldName, String newName) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Called after a job has its configuration updated.
|
||||
*
|
||||
* @since 1.460
|
||||
*/
|
||||
public void onUpdated(Item item) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.446
|
||||
* Called at the begenning of the orderly shutdown sequence to
|
||||
@@ -128,4 +136,9 @@ public class ItemListener implements ExtensionPoint {
|
||||
for (ItemListener l : all())
|
||||
l.onCreated(item);
|
||||
}
|
||||
|
||||
public static void fireOnUpdated(Item item) {
|
||||
for (ItemListener l : all())
|
||||
l.onUpdated(item);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user