Package java.util.concurrent

Examples of java.util.concurrent.CancellationException


        }

        @Override
        public T get() throws InterruptedException, ExecutionException {
            if(canceled) {
                throw new CancellationException();
            }
           
            T object = null;

            try {
View Full Code Here


        }

        @Override
        public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
            if (canceled) {
                throw new CancellationException();
            }
           
            T object = null;

            try {
View Full Code Here

    if (this.stopped) return;
    this.stopped = true;
    String msg = "Stopping restore snapshot=" + SnapshotDescriptionUtils.toString(snapshot)
        + " because: " + why;
    LOG.info(msg);
    CancellationException ce = new CancellationException(why);
    this.monitor.receive(new ForeignException(masterServices.getServerName().toString(), ce));
  }
View Full Code Here

    if (finished) return;

    this.finished = true;
    LOG.info("Stop taking snapshot=" + SnapshotDescriptionUtils.toString(snapshot) + " because: "
        + why);
    CancellationException ce = new CancellationException(why);
    monitor.receive(new ForeignException(master.getServerName().toString(), ce));
  }
View Full Code Here

    if (this.stopped) return;
    this.stopped = true;
    String msg = "Stopping clone snapshot=" + snapshot + " because: " + why;
    LOG.info(msg);
    status.abort(msg);
    this.monitor.receive(new ForeignException(NAME, new CancellationException(why)));
  }
View Full Code Here

   /**
    * Throws exception, if any, associated with the given status.
    */
   private void reportException(int s) {
      if (s == CANCELLED)
         throw new CancellationException();
      if (s == EXCEPTIONAL)
         rethrow(getThrowableException());
   }
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

   public final V get() throws InterruptedException, ExecutionException {
      int s = (Thread.currentThread() instanceof ForkJoinWorkerThread) ?
            doJoin() : externalInterruptibleAwaitDone();
      Throwable ex;
      if ((s &= DONE_MASK) == CANCELLED)
         throw new CancellationException();
      if (s == EXCEPTIONAL && (ex = getThrowableException()) != null)
         throw new ExecutionException(ex);
      return getRawResult();
   }
View Full Code Here

            throw new InterruptedException();
      }
      if ((s &= DONE_MASK) != NORMAL) {
         Throwable ex;
         if (s == CANCELLED)
            throw new CancellationException();
         if (s != EXCEPTIONAL)
            throw new TimeoutException();
         if ((ex = getThrowableException()) != null)
            throw new ExecutionException(ex);
      }
View Full Code Here

         }
      }
     
      private V innerGet(long timeout, TimeUnit unit) throws ExecutionException, TimeoutException {
         if (isCancelled())
            throw new CancellationException("Task already cancelled");
        
         V response = null;
         try {
            long taskTimeout = getOwningTask().timeout();
            long futureTimeout = TimeUnit.MILLISECONDS.convert(timeout, unit);
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.