/** * * Checks if the given task knows the reasons to be blocked or it needs some unavailable resources * * @param task the task. * @return the reason of blockage if it exists null otherwise. */ @CheckForNull private CauseOfBlockage getCauseOfBlockageForTask(Task task) { CauseOfBlockage causeOfBlockage = task.getCauseOfBlockage(); if (causeOfBlockage != null) { return task.getCauseOfBlockage(); } if (!canRun(task.getResourceList())) { ResourceActivity r = getBlockingActivity(task); if (r != null) { if (r == task) // blocked by itself, meaning another build is in progress return CauseOfBlockage.fromMessage(Messages._Queue_InProgress()); return CauseOfBlockage.fromMessage(Messages._Queue_BlockedBy(r.getDisplayName())); } } return null; }
/** * Checks if the given task is blocked. */ private boolean isBuildBlocked(Task t) { return t.isBuildBlocked() || !canRun(t.getResourceList()); }
/** * Checks if the given task is blocked. */ private boolean isBuildBlocked(Task t) { return t.isBuildBlocked() || !canRun(t.getResourceList()); }
/** * Checks if the given task is blocked. */ private boolean isBuildBlocked(Task t) { return t.isBuildBlocked() || !canRun(t.getResourceList()); }
/** * Checks if the given task is blocked. */ private boolean isBuildBlocked(Item i) { if (i.task.isBuildBlocked() || !canRun(i.task.getResourceList())) { return true; } for (QueueTaskDispatcher d : QueueTaskDispatcher.all()) { if (d.canRun(i) != null) { return true; } } return false; }
/** * * Checks if the given task knows the reasons to be blocked or it needs some unavailable resources * * @param task the task. * @return the reason of blockage if it exists null otherwise. */ @CheckForNull private CauseOfBlockage getCauseOfBlockageForTask(Task task) { CauseOfBlockage causeOfBlockage = task.getCauseOfBlockage(); if (causeOfBlockage != null) { return task.getCauseOfBlockage(); } if (!canRun(task.getResourceList())) { ResourceActivity r = getBlockingActivity(task); if (r != null) { if (r == task) // blocked by itself, meaning another build is in progress return CauseOfBlockage.fromMessage(Messages._Queue_InProgress()); return CauseOfBlockage.fromMessage(Messages._Queue_BlockedBy(r.getDisplayName())); } } return null; }