Package java.util.concurrent

Examples of java.util.concurrent.CancellationException


   * returns normally otherwise.
   * @throws CancellationException If progress monitor was canceled.
   */
  protected final void checkCancel() {
    if(monitor != null && monitor.isCanceled())
      throw new CancellationException("Crystal flow analysis was canceled");
  }
View Full Code Here


        }
        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);
        if (supervisor == null || !supervisor.isOwnerNode()) {
            return false;
        }
        Exception exception = new CancellationException("Operation was cancelled by the user");
        cancelled = supervisor.cancelAndNotify(exception);
        return cancelled;
    }
View Full Code Here

        if (supervisor == null) {
            // Supervisor was cancelled prior to creation
            AbstractJobTracker jobTracker = (AbstractJobTracker) mapReduceService.getJobTracker(name);
            TrackableJobFuture future = jobTracker.unregisterTrackableJob(jobId);
            if (future != null) {
                Exception exception = new CancellationException("Operation was cancelled by the user");
                future.setResult(exception);
            }
        }
    }
View Full Code Here

        final Future f = invokeCancelRequest(mayInterruptIfRunning);
        try {
            final Boolean b = context.getSerializationService().toObject(f.get());
            if (b != null && b) {
                setError(new CancellationException());
                cancelled = true;
                return true;
            }
            return false;
        } catch (Exception e) {
View Full Code Here

            if (mapReduceService.unregisterJobSupervisorCancellation(name, jobId)) {
                // Supervisor was cancelled prior to creation
                AbstractJobTracker jobTracker = (AbstractJobTracker) mapReduceService.getJobTracker(name);
                TrackableJobFuture future = jobTracker.unregisterTrackableJob(jobId);
                if (future != null) {
                    Exception exception = new CancellationException("Operation was cancelled by the user");
                    future.setResult(exception);
                }
            }
            return;
        }
View Full Code Here

        Future f = invokeCancelOperation(mayInterruptIfRunning);
        try {
            Boolean b = (Boolean) f.get();
            if (b != null && b) {
                setError(new CancellationException());
                cancelled = true;
                return true;
            }
            return false;
        } catch (Exception e) {
View Full Code Here

    }

    public boolean cancel(String uuid, boolean interrupt) {
        CallableProcessor processor = submittedTasks.remove(uuid);
        if (processor != null && processor.cancel(interrupt)) {
            processor.sendResponse(new CancellationException());
            getLocalExecutorStats(processor.name).cancelExecution();
            return true;
        }
        return false;
    }
View Full Code Here

        Address jobOwner = mapReduceService.getLocalAddress();
        mapReduceService.registerJobSupervisorCancellation(name, jobId, jobOwner);

        JobSupervisor supervisor = mapReduceService.getJobSupervisor(name, jobId);
        if (supervisor != null && supervisor.isOwnerNode()) {
            Exception exception = new CancellationException("Operation was cancelled by the user");
            supervisor.cancelAndNotify(exception);
        }
        endpoint.sendResponse(Boolean.TRUE, getCallId());
    }
View Full Code Here

   /**
    * Throws exception, if any, associated with the given status.
    */
   private void reportException(int s) {
      Throwable ex = ((s == CANCELLED) new CancellationException() :
                            (s == EXCEPTIONAL) ? getThrowableException() :
                                  null);
      if (ex != null)
         U.throwException(ex);
   }
View Full Code Here

    * @return the exception, or {@code null} if none
    */
   public final Throwable getException() {
      int s = status & DONE_MASK;
      return ((s >= NORMAL)    ? null :
                    (s == CANCELLED) ? new CancellationException() :
                          getThrowableException());
   }
View Full Code Here

TOP

Related Classes of java.util.concurrent.CancellationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.