@Override public boolean cancel(boolean mayInterruptIfRunning) { executor.shutdownNow(); return super.cancel(mayInterruptIfRunning); } }
@Override public boolean cancel(boolean mayInterruptIfRunning) { interrupted[0] = mayInterruptIfRunning; return super.cancel(mayInterruptIfRunning); } };
@Override public boolean cancel(boolean mayInterruptIfRunning) { interrupted[0] = mayInterruptIfRunning; return super.cancel(mayInterruptIfRunning); } };
@Override public boolean cancel(boolean mayInterruptIfRunning) { interrupted[0] = mayInterruptIfRunning; return super.cancel(mayInterruptIfRunning); } };
@Override public boolean cancel(boolean mayInterruptIfRunning) { interrupted[0] = mayInterruptIfRunning; return super.cancel(mayInterruptIfRunning); } };
@Override public boolean cancel(boolean mayInterruptIfRunning) { interrupted[0] = mayInterruptIfRunning; return super.cancel(mayInterruptIfRunning); } };
@Override public boolean cancel(boolean mayInterruptIfRunning) { interrupted[0] = mayInterruptIfRunning; return super.cancel(mayInterruptIfRunning); } };
@Override public boolean cancel(boolean mayInterruptIfRunning) { interrupted[0] = mayInterruptIfRunning; return super.cancel(mayInterruptIfRunning); } };
public final boolean cancel(boolean mayInterruptIfRunning) { return mFuture.cancel(mayInterruptIfRunning); }
@Override public boolean cancel(boolean mayInterruptIfRunning) { boolean result = super.cancel(mayInterruptIfRunning); if (this.timer != null) { this.timer.cancel(); } this.cancelled = true; return result; }
@Override public boolean cancel(boolean mayInterruptIfRunning) { delegate.cancel(true); return super.cancel(mayInterruptIfRunning); }
@Implementation protected boolean cancel(boolean mayInterruptIfRunning) { return future.cancel(mayInterruptIfRunning); }
public <T> boolean cancel(List<FutureTask<T>> task) { boolean hasAFalse = task.stream().map(f -> f.cancel(true)).anyMatch(b -> b.equals(false)); return !hasAFalse; }
@Override public boolean cancel(boolean mayInterruptIfRunning) { boolean result = super.cancel(mayInterruptIfRunning); if (this.timer != null) { this.timer.cancel(); } this.cancelled = true; return result; }
public boolean cancel(boolean mayInterruptIfRunning) { boolean cancelled = super.cancel(mayInterruptIfRunning); if (cancelled && removeOnCancel && heapIndex >= 0) remove(this); return cancelled; }
/** * @param operation the operation to run - the executing thread will be interrupted when the operation is cancelled * @param canBeCancelled true if the operation is aborted when the {@link Thread#isInterrupted()} flag is set * @throws NullPointerException if operation is null * @throws IllegalArgumentException if startOperation() was called before */ public void startOperation(Callable<T> operation, boolean canBeCancelled) { Preconditions.checkState(parallelTask == null, "startOperation() cannot be called twice"); cancelButton.setVisible(canBeCancelled); parallelTask = new FutureTask<>(operation); thread = new Thread(parallelTask, "Parallel Operation"); thread.start(); WidgetUtil.trySubscribe(this, "cancel", button -> parallelTask.cancel(true)); }
@Override public boolean cancel(boolean mayInterruptIfRunning) { boolean result = cancellable == null ? true : cancellable.cancel(); if (result) { boolean taskCancelled = task.cancel(); boolean superCancel = super.cancel(mayInterruptIfRunning); //must call both! result = taskCancelled && superCancel; } return result; }
futureTask.cancel(true); } finally { executor.shutdownNow();
@Override public boolean cancel(boolean mayInterruptIfRunning) { // FIXME there is a race condition here as the job may complete successfully before we // call cancelJob() below. There isn't an easy way to fix that right now. RunningState runState = fetchRunningState(); if (runState.isCancelled()) { return true; } else if (runState.isDone()) { return false; } try { // No special processing of callbacks necessary getLegacyLauncher().cancelJob(new AbstractJobListener(){}); } catch (JobException e) { throw new RuntimeException("Unable to cancel job " + _jobSpec + ": " + e, e); } return super.cancel(mayInterruptIfRunning); }