Package java.util.concurrent

Examples of java.util.concurrent.TimeoutException


            if (!future.isSuccess()) {
              throw new ExecutionException(future.getCause());
            }
            return null;
          }
          throw new TimeoutException();
        }

        @Override
        public boolean isCancelled() {
          return future.isCancelled();
View Full Code Here


 
  private void onTimeout() {
    logger.debug("Pending operation (connect, read or write) timed out...");
    AsyncResult<HttpResponse> cb = responseCallback;
    responseCallback = nopAsyncResult;
    cb.onFailure(new TimeoutException("Connection timed out"));
    close();
  }
View Full Code Here

      if (!future.isDone()) {
        long now = System.currentTimeMillis();
        timeoutMillis -= now - start;
        start = now;
        if (timeoutMillis <= 0) {
          throw new TimeoutException();
        }
      }
    }
    }
View Full Code Here

                        monitor.setTaskName("waiting for remote content store to get available");
                        List<String> dbkeys = new ArrayList<String>();
                        long startTime = System.currentTimeMillis();
                        while (!dbkeys.contains(_webApplication)) {
                            if ((System.currentTimeMillis() - startTime) > 1000 * 60) {
                                throw new TimeoutException("Timeout waiting for remote content store.");
                            }
                            Thread.sleep(2000);
                            dbkeys = _remoteServer.getServices().getConnectedContentDatabases(_remoteServer.getSession());
                        }
                        monitor.worked(1);
View Full Code Here

        }
        finally {
            lock.unlock();
        }
        if(!ok)
            throw new TimeoutException();
        return getResults();
    }
View Full Code Here

    long millis = unit.toMillis(timeout);
    long start = System.currentTimeMillis();
    while (!this.done) {
      long waitTill = start + millis - System.currentTimeMillis();
      if (waitTill <= 0) {
        throw new TimeoutException();
      }
      this.wait(waitTill);
    }
    return convertResult();
  }
View Full Code Here

        }
        finally {
            lock.unlock();
        }
        if(!ok)
            throw new TimeoutException();
        return getResults();
    }
View Full Code Here

                    else if (active == 0)
                        break;
                    else if (timed) {
                        f = ecs.poll(nanos, TimeUnit.NANOSECONDS);
                        if (f == null)
                            throw new TimeoutException();
                        long now = System.nanoTime();
                        nanos -= now - lastTime;
                        lastTime = now;
                    }
                    else
View Full Code Here

        }
        finally {
            lock.unlock();
        }
        if(!ok)
            throw new TimeoutException();
        return result.getValue();
    }
View Full Code Here

                return result;
            }

            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

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.