File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\hudson\model\TransientBuildActionFactory.java.html

1 package hudson.model;
2
3 import hudson.Extension;
4 import hudson.ExtensionList;
5 import hudson.ExtensionPoint;
6 import jenkins.model.Jenkins;
7 import java.util.Collection;
8 import java.util.Collections;
9
10 /**
11 * Extension point for inserting transient {@link Action}s into {@link Run}s.
12 *
13 * To register your implementation, put {@link Extension} on your subtype.
14 *
15 * @author Lucie Votypkova
16 * @since 1.458
17 * @see Action
18 */
19
20 public abstract class TransientBuildActionFactory implements ExtensionPoint {
21 /**
22 * Creates actions for the given build.
23 *
24 * @param target for which the action objects are requested. Never null.
25 * @return Can be empty but must not be null.
26 */
27 public Collection<? extends Action> createFor(Run target) {
28 if (target instanceof AbstractBuild)
29 return createFor((AbstractBuild)target);
30 else
31 return Collections.emptyList();
32 }
33
34 /**
35 * @deprecated as of 1.461
36 * Override and call {@link #createFor(Run)} instead.
37 */
38 public Collection<? extends Action> createFor(AbstractBuild target) {
39 return Collections.emptyList();
40 }
41
42 /**
43 * Returns all the registered {@link TransientBuildActionFactory}s.
44 */
45 public static ExtensionList<TransientBuildActionFactory> all() {
46 return Jenkins.getInstance().getExtensionList(TransientBuildActionFactory.class);
47 }
48 }