Package java.util.concurrent

Examples of java.util.concurrent.TimeoutException


                // deliberately ignore
                millis -= System.currentTimeMillis() - startedAt;
            }
        }
        if (!done) {
            throw new TimeoutException(new Message("ASYNC_HANDLER_TIMEDOUT_EXC",
                                                                    LOG).toString());
        }
    }
View Full Code Here


        // Check that this method is called exactly once, by the first
        // thread to synchronize.
        long t0 = System.nanoTime();
        while (waitingThreads() != numThreads - 1) {
          if (System.nanoTime() - t0 > timeout) {
            thrown.set(new TimeoutException(
                "timed out waiting for other threads to block" +
                " synchronizing on supplier"));
            break;
          }
          Thread.yield();
View Full Code Here

    if(this.exception!=null) {
      throw new ExecutionException(this.exception);
    }else if(this.target!=null) {
      return this.target;
    }else {
      throw new TimeoutException();
    }
  }
View Full Code Here

    V get(long nanos) throws TimeoutException, CancellationException,
        ExecutionException, InterruptedException {

      // Attempt to acquire the shared lock with a timeout.
      if (!tryAcquireSharedNanos(-1, nanos)) {
        throw new TimeoutException("Timeout waiting for task.");
      }

      return getValue();
    }
View Full Code Here

    public State get(long timeout, TimeUnit unit)
        throws InterruptedException, TimeoutException, ExecutionException {
      try {
        return super.get(timeout, unit);
      } catch (TimeoutException e) {
        throw new TimeoutException(AbstractService.this.toString());
      }
    }
View Full Code Here

        // If our listener was scheduled to run on an executor we may
        // need to wait for our listener to finish running before the
        // outputFuture has been constructed by the function.
        long start = System.nanoTime();
        if (!outputCreated.await(timeout, unit)) {
          throw new TimeoutException();
        }
        timeout -= Math.max(0, System.nanoTime() - start);

        // Like above with the inputFuture, we have a listener on
        // the outputFuture that will set our own value when its
View Full Code Here

     */
  public IHttpResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
      try {
            return getResponse(timeout, unit);
        } catch (SocketTimeoutException stoe) {
            throw new TimeoutException(stoe.toString());
        } catch (IOException ioe) {
            throw new ExecutionException(ioe.toString(), ioe);
        }
  }
View Full Code Here

     */
  public IHttpResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
      try {
            return getResponse(timeout, unit);
        } catch (SocketTimeoutException stoe) {
            throw new TimeoutException(stoe.toString());
        } catch (IOException ioe) {
            throw new ExecutionException(ioe.toString(), ioe);
        }
  }
View Full Code Here

     */
  public IHttpResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
      try {
            return getResponse(timeout, unit);
        } catch (SocketTimeoutException stoe) {
            throw new TimeoutException(stoe.toString());
        } catch (IOException ioe) {
            throw new ExecutionException(ioe.toString(), ioe);
        }
  }
View Full Code Here

     */
  public IHttpResponse get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
      try {
            return getResponse(timeout, unit);
        } catch (SocketTimeoutException stoe) {
            throw new TimeoutException(stoe.toString());
        } catch (IOException ioe) {
            throw new ExecutionException(ioe.toString(), ioe);
        }
  }
View Full Code Here

TOP

Related Classes of java.util.concurrent.TimeoutException

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.