*
* @param context the context to rebuild.
* @see ToGerritRunListener#isBuilding(GerritTriggeredEvent)
*/
public void retriggerAllBuilds(TriggerContext context) {
DependencyQueueTaskDispatcher dependencyQueueTaskDispatcher = DependencyQueueTaskDispatcher.getInstance();
if (dependencyQueueTaskDispatcher != null) {
ToGerritRunListener listener = ToGerritRunListener.getInstance();
if (listener != null) {
if (!listener.isBuilding(context.getEvent())) {
dependencyQueueTaskDispatcher.onTriggeringAll(context.getEvent());
retrigger(context.getThisBuild().getProject(), context.getEvent());
for (AbstractBuild build : context.getOtherBuilds()) {
GerritTrigger trigger = (GerritTrigger)build.getProject().getTrigger(GerritTrigger.class);
if (trigger != null) {
trigger.retrigger(build.getProject(), context.getEvent());
}
}
dependencyQueueTaskDispatcher.onDoneTriggeringAll(context.getEvent());
}
}
}
}