Package java.util.concurrent

Examples of java.util.concurrent.CancellationException


            }

            V innerGet() throws InterruptedException, ExecutionException {
                acquireSharedInterruptibly(0);
                if (getState() == CANCELLED)
                    throw new CancellationException();
                if (exception != null)
                    throw new ExecutionException(exception);
                return result;
            }
View Full Code Here


            V innerGet(long nanosTimeout) throws InterruptedException, ExecutionException, TimeoutException {
                if (!tryAcquireSharedNanos(0, nanosTimeout))
                    throw new TimeoutException();
                if (getState() == CANCELLED)
                    throw new CancellationException();
                if (exception != null)
                    throw new ExecutionException(exception);
                return result;
            }
View Full Code Here

        taskProgress = taskLength;
    }
   
    protected void checkCancelled() {
        if ( isCancelled() )
            throw new CancellationException();
    }
View Full Code Here

          } else {
            return value;
          }

        case CANCELLED:
          throw new CancellationException("Task was cancelled.");

        default:
          throw new IllegalStateException(
              "Error, synchronizer in invalid state: " + state);
      }
View Full Code Here

    @Override
    public void run() {
      CustomConcurrentHashMap<?, ?> map = mapReference.get();
      if (map == null) {
        throw new CancellationException();
      }

      for (Segment<?, ?> segment : map.segments) {
        segment.runCleanup();
      }
View Full Code Here

        }
    }
   
    protected void checkCancelled() {
        if ( isCancelled() )
            throw new CancellationException();
    }
View Full Code Here

    @Override
    public void run() {
      CustomConcurrentHashMap<?, ?> map = mapReference.get();
      if (map == null) {
        throw new CancellationException();
      }

      for (Segment<?, ?> segment : map.segments) {
        segment.runCleanup();
      }
View Full Code Here

      if (_exception != null)
        throw new ExecutionException(_exception);
      else if (_isDone)
        return _value;
      else if (_isCancelled)
        throw new CancellationException();
      else
        throw new TimeoutException();
    }
View Full Code Here

      if (_exception != null)
        throw new ExecutionException(_exception);
      else if (_isDone || count != _alarmCount)
        return _value;
      else if (_isCancelled)
        throw new CancellationException();
      else
        throw new TimeoutException();
    }
View Full Code Here

    synchronized(this) {
      while (! _done && ! _cancelled)
        wait();

      if (_cancelled)
        throw new CancellationException();

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

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