Examples of TimeoutException


Examples of com.netflix.astyanax.connectionpool.exceptions.TimeoutException

                    Assert.assertEquals(0,     pool.getIdleConnectionCount());
                   
                    connection.execute(new TestOperation() {
                        @Override
                        public String execute(TestClient client, ConnectionContext context) throws ConnectionException {
                            throw new TimeoutException("Test");
                        }
                    });
                   
                    Assert.fail();
                }
                catch (Throwable t) {
                }
                finally {
                    pool.returnConnection(connection);
                }
                Assert.assertEquals(i+1,     pool.getErrorsSinceLastSuccess());
                Assert.assertEquals(0,     pool.getActiveConnectionCount());
                Assert.assertEquals(false, pool.isReconnecting());
                Assert.assertEquals(0,     pool.getIdleConnectionCount());
            }
           
            Connection<TestClient> connection = pool.borrowConnection(WAIT_TIMEOUT);
            try {
                Assert.assertEquals(1,     pool.getActiveConnectionCount());
                Assert.assertEquals(false, pool.isReconnecting());
                Assert.assertEquals(0,     pool.getIdleConnectionCount());
               
                connection.execute(new TestOperation() {
                    @Override
                    public String execute(TestClient client, ConnectionContext context) throws ConnectionException {
                        throw new TimeoutException("Test");
                    }
                });
            }
            catch (Throwable t) {
            }
View Full Code Here

Examples of de.zib.scalaris.TimeoutException

            throw new ConnectionException(e);
        } catch (final TimeoutException e) {
            System.out.println("      write(" + otpKey.stringValue() + ", "
                    + otpValue.stringValue() + ") failed with timeout: "
                    + e.getMessage());
            throw new TimeoutException(e);
        } catch (final UnknownException e) {
            System.out.println("      write(" + otpKey.stringValue() + ", "
                    + otpValue.stringValue() + ") failed with unknown: "
                    + e.getMessage());
            throw new UnknownException(e);
View Full Code Here

Examples of etch.util.TimeoutException

    try
    {
      int timeout = disableTimeout ? 0 : responseType.getTimeout();
      Mailbox.Element mbe = mb.read( timeout);
      if (mbe == null)
        throw new TimeoutException( "timeout waiting for "+responseType );
      Message rmsg = mbe.msg;
      rmsg.checkType( responseType );
      Object r = rmsg.get( responseType.getResponseField() );
      if (r instanceof Exception)
      {
View Full Code Here

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

Examples of java.util.concurrent.TimeoutException

 
  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

Examples of java.util.concurrent.TimeoutException

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

Examples of java.util.concurrent.TimeoutException

                        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

Examples of java.util.concurrent.TimeoutException

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

Examples of java.util.concurrent.TimeoutException

    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

Examples of java.util.concurrent.TimeoutException

        }
        finally {
            lock.unlock();
        }
        if(!ok)
            throw new TimeoutException();
        return getResults();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.