/** {@inheritDoc} */ @Override protected void cancelQuery() throws GridException { if (fut != null) fut.cancel(); }
/** {@inheritDoc} */ @Override public boolean cancel() throws GridException { return embedded.cancel(); }
/** {@inheritDoc} */ @Override public boolean cancel() throws GridException { if (onCancelled()) { for (GridFuture<T> fut : futs) fut.cancel(); return true; } return false; }
/** {@inheritDoc} */ @Override public boolean cancel(boolean mayInterruptIfRunning) { try { fut.cancel(); } catch (GridException e) { U.error(log, "Failed to cancel task: " + fut, e); } return true; }
/** * Cancels given future. * * @param fut Future to cancel. */ private void cancelFuture(GridFuture<?> fut) { try { fut.cancel(); } catch (GridException e) { U.error(log, "Failed to cancel task: " + fut, e); } }
/** {@inheritDoc} */ @Override public List<Runnable> shutdownNow() { List<GridFuture<?>> cpFuts; // Cancel all tasks. synchronized (mux) { cpFuts = new ArrayList<>(futs); isBeingShutdown = true; } for (GridFuture<?> task : cpFuts) { try { task.cancel(); } catch (GridException e) { U.error(log, "Failed to cancel task: " + task, e); } } return Collections.emptyList(); }
/** * Adds a future to this compound future. * * @param fut Future to add. */ public void add(GridFuture<T> fut) { assert fut != null; pending.add(fut); futs.add(fut); fut.listenAsync(new Listener()); if (isCancelled()) try { fut.cancel(); } catch (GridException e) { onDone(e); } }