Examples of TimeoutException


Examples of java.util.concurrent.TimeoutException

    }

    if (!_shutdownRequest)
    {
      LOG.error("timeout waiting for a shutdown request");
      throw new TimeoutException("timeout waiting for shutdown request");
    }

    _controlLock.lock();
    try
    {
      long waitTime;
      while (!_shutdown && (waitTime = endTs - System.currentTimeMillis()) > 0)
      {
        LOG.info("Waiting for shutdown complete for serving container: " + _containerStaticConfig.getId());
        if (!_shutdownFinishedCondition.await(waitTime, TimeUnit.MILLISECONDS)) break;
      }
    }
    finally
    {
      _controlLock.unlock();
    }

    if (!_shutdown)
    {
      LOG.error("timeout waiting for shutdown");
      throw new TimeoutException("timeout waiting for shutdown to complete");
    }
  }
View Full Code Here

Examples of java.util.concurrent.TimeoutException

        }

        executor.shutdown();
        if (!executor.awaitTermination(10,
            TimeUnit.MINUTES)) {
                throw new TimeoutException();
        }
        final long endTime = System.currentTimeMillis();
        int count = 0;
        for (int i = 0; i < taskList.size(); ++i) {
            try {
View Full Code Here

Examples of java.util.concurrent.TimeoutException

                StringBuilder sb = new StringBuilder("");
                for ( Message message : responses_ )
                {
                    sb.append(message.getFrom());                   
                }               
                throw new TimeoutException("Operation timed out - received only " +  responses_.size() + " responses from " + sb.toString() + " .");
            }
        }
        finally
        {
            lock_.unlock();
View Full Code Here

Examples of java.util.concurrent.TimeoutException

                    String errorMessage = String.format("Timeout while checking out resource (%s). Configured time (%d) ns NonBlocking time (%d) ns Blocking time (%d) ns ",
                                                        key,
                                                        resourcePoolConfig.getTimeout(TimeUnit.NANOSECONDS),
                                                        nonBlockingElapsedNs,
                                                        blockingElapsedNs);
                    throw new TimeoutException(errorMessage);
                }
            }

            if(!objectFactory.validate(key, resource))
                throw new ExcessiveInvalidResourcesException(1);
View Full Code Here

Examples of java.util.concurrent.TimeoutException

            }

            for (long i = 0; i < Long.MAX_VALUE; i++) {
                // First check for timeout
                if (hasTimedOut.get()) {
                    throw new TimeoutException(
                                               String.format("Could not find order and matching for key set in alloted time with specified parameters (m=%d;k=%d;q=%d)",
                                                             m, k, q));
                }

                hasher = new BloomierHasher<K>(hashSeed, m, k, q);
View Full Code Here

Examples of java.util.concurrent.TimeoutException

          return null;
        } else {
          throw new ExecutionException(exception);
        }
      } else {
        throw new TimeoutException();
      }
    }
  }
View Full Code Here

Examples of java.util.concurrent.TimeoutException

   public SyncResponse blockUntilAcquired(long timeout, TimeUnit timeUnit) throws TimeoutException {
      int initState = flushWaitGateCount.get();
      while (true) {
         try {
            if (!flushWaitGate.await(timeout, timeUnit))
               throw new TimeoutException("Timed out waiting for a cluster-wide sync to be acquired. (timeout = " + Util.prettyPrintTime(timeout) + ")");

            return initState == flushWaitGateCount.get() ? SyncResponse.STATE_PREEXISTED : SyncResponse.STATE_ACHIEVED;
         } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
         }
View Full Code Here

Examples of java.util.concurrent.TimeoutException

   public SyncResponse blockUntilReleased(long timeout, TimeUnit timeUnit) throws TimeoutException {
      int initState = flushBlockGateCount.get();
      while (true) {
         try {
            if (!flushBlockGate.await(timeout, timeUnit))
               throw new TimeoutException("Timed out waiting for a cluster-wide sync to be released. (timeout = " + Util.prettyPrintTime(timeout) + ")");

            return initState == flushWaitGateCount.get() ? SyncResponse.STATE_PREEXISTED : SyncResponse.STATE_ACHIEVED;
         } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
         }
View Full Code Here

Examples of java.util.concurrent.TimeoutException

   public void acquireProcessingLock(boolean exclusive, long timeout, TimeUnit timeUnit) throws TimeoutException {
      while (true) {
         try {
            Lock lock = exclusive ? processingLock.writeLock() : processingLock.readLock();
            if (!lock.tryLock(timeout, timeUnit))
               throw new TimeoutException("Could not obtain " + (exclusive ? "exclusive" : "shared") + " processing lock");
            break;
         } catch (InterruptedException ie) {
            Thread.currentThread().interrupt();
         }
      }
View Full Code Here

Examples of net.sf.swtbot.widgets.TimeoutException

      } catch (Throwable e) {
        // do nothing
      }
      sleep(interval);
      if (System.currentTimeMillis() > limit)
        throw new TimeoutException("Timeout after: " + timeout + " ms.: " + condition.getFailureMessage());
    }
  }
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.