-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from zittix/zittix/rebuilddispatcher
Add RebuildDispatcher extension point to allow other plugins to propagate action
- Loading branch information
Showing
3 changed files
with
161 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/com/sonyericsson/rebuild/RebuildActionDispatcher.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package com.sonyericsson.rebuild; | ||
|
||
import hudson.ExtensionList; | ||
import hudson.ExtensionPoint; | ||
import hudson.model.Action; | ||
import hudson.model.Run; | ||
import jenkins.model.Jenkins; | ||
|
||
import java.util.Collection; | ||
|
||
/** | ||
* Extension point to propagate additional actions to the rebuild. | ||
*/ | ||
public abstract class RebuildActionDispatcher implements ExtensionPoint { | ||
|
||
/** | ||
* @return the actions to include in the rebuild. | ||
*/ | ||
public abstract Collection<Action> getPropagatingActions(Run r); | ||
|
||
/** | ||
* All registered {@link RebuildActionDispatcher}s. | ||
* TODO: use ExtensionList.lookup() once the Jenkins dependency is upgraded >= 1.572 | ||
*/ | ||
public static ExtensionList<RebuildActionDispatcher> all() { | ||
Jenkins j = Jenkins.getInstance(); | ||
return j == null ? ExtensionList.create((Jenkins) null, RebuildActionDispatcher.class) : j.getExtensionList(RebuildActionDispatcher.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters