result |= delegate().cancel(mode.isAllowedToInterruptTask()); if (mode.isAllowedToInterruptDependentSubmittedTasks()) { int subtasksFound=0; int subtasksReallyCancelled=0;
@Override protected boolean doCancel(org.apache.brooklyn.util.core.task.TaskInternal.TaskCancellationMode mode) { boolean result = false; if (mode.isAllowedToInterruptDependentSubmittedTasks()) { for (Task<?> t: getChildren()) { if (!t.isDone()) { result = ((TaskInternal<?>)t).cancel(mode) || result; } } } result = super.doCancel(mode) || result; return result; // returns true if anything is successfully cancelled }
@Override protected boolean doCancel(TaskCancellationMode mode) { boolean result = false; if (mode.isAllowedToInterruptDependentSubmittedTasks()) { for (Task<?> t: secondaryJobsAll) { // secondary jobs are dependent result = ((TaskInternal<?>)t).cancel(mode) || result; } } return super.doCancel(mode) || result; // returns true if anything is successfully cancelled }