Package java.util.concurrent

Examples of java.util.concurrent.CancellationException


        while (! _done && ! _cancelled && Alarm.getCurrentTime() < expire)
          wait(expire - Alarm.getCurrentTime());
      }

      if (_cancelled)
        throw new CancellationException();

      if (_exception != null)
        throw new ExecutionException(_exception);

      return _value;
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

  @Override
  public void cancel(String why) {
    if (this.stopped) return;
    this.stopped = true;
    LOG.info("Stopping clone snapshot=" + snapshot + " because: " + why);
    this.monitor.receive(new ForeignException(NAME, new CancellationException(why)));
  }
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

            // ignore
        }

        @Override
        public CancellationException cancel() {
            return new CancellationException();
        }
View Full Code Here

        }

        @Override
        public CancellationException cancel() {
            canceled = true;
            return new CancellationException();
        }
View Full Code Here

                        try {
                            final int s = status.get();
                            switch (s) {
                                case 1: return executeMultiOperation(resolved, operation, handler, operationExecutionContext);
                                case 2: handler.handleFailed(failureResult); return new BasicOperationResult();
                                case 3: throw new CancellationException();
                            }
                            failureResult.wait();
                        } catch(InterruptedException e) {
                            intr = true;
                            result.getCancellable().cancel();
View Full Code Here

                                if(handlerResult.getCompensatingOperation() != null) {
                                   finalResult.get(COMPENSATING_OPERATION).set(handlerResult.getCompensatingOperation());
                                }
                                return finalResult;
                            case 2: finalResult.get(OUTCOME).set(CANCELLED);
                                throw new CancellationException();
                            case 3: finalResult.get(OUTCOME).set(FAILED);
                                if (!finalResult.hasDefined(RESULT)) {
                                    // Remove the undefined node
                                    finalResult.remove(RESULT);
                                }
View Full Code Here

    assertEquals("testConcurrentClassLiteral ConcurrentHashMap", ConcurrentHashMap.class, map.getClass());
  }

  public void testException() {
    try {
      throw new CancellationException();
    } catch (CancellationException e) {
      assertNotNull("testException", e);
    }
  }
View Full Code Here

    if (this.stopped) return;
    this.stopped = true;
    String msg = "Stopping restore snapshot=" + ClientSnapshotDescriptionUtils.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

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.