Package java.util.concurrent

Examples of java.util.concurrent.TimeoutException


                    }
                }
            });
            startLevel.setStartLevel(level);
            if (latch.await(timeout, units) == false)
                throw new TimeoutException("Timeout changing start level");
        }
    }
View Full Code Here


                    timeout -= 100;
                }
            }

            if (!serversAvailable) {
                throw new TimeoutException(String.format("Managed servers were not started within [%d] seconds", configuration.getStartupTimeoutInSeconds()));
            }

            log.info("All servers started in " + (System.currentTimeMillis() - start) + " ms");
        } catch (Exception e) {
            throw new RuntimeException("Could not start container", e);
View Full Code Here

            retryCount --;
            try {
                Thread.sleep(retryDelay);
            } catch (InterruptedException ioe) {}
        }
        throw new TimeoutException();       
    }
View Full Code Here

        assertNotClosed(is);
    }

    @Test
    public void testTimeoutException() throws IOException {
        ServerDeploymentManager sdm = new MockServerDeploymentManager(new TimeoutException());
        DeploymentPlanBuilder builder = sdm.newDeploymentPlan();
        builder = builder.add("test", createTempFile());
        DeploymentPlanImpl planImpl = getDeploymentPlanImpl(builder);
        safeGetWithTimeout(sdm, planImpl);
        InputStream is = getInputStream(planImpl);
View Full Code Here

        }

        @Override
        public T get(long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException {
            assertEquals( "Should use the configured timeout", expectedTimeout, l);
            throw new TimeoutException();
        }
View Full Code Here

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

      return initState == flushWaitGateCount.get() ? SyncResponse.STATE_PREEXISTED : SyncResponse.STATE_ACHIEVED;
View Full Code Here

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

View Full Code Here

   public void acquireProcessingLock(boolean exclusive, long timeout, TimeUnit timeUnit) throws TimeoutException {
      Lock lock = exclusive ? processingLock.writeLock() : processingLock.readLock();
      try {
         if (!lock.tryLock(timeout, timeUnit))
            throw new TimeoutException(format("%s could not obtain %s processing lock after %s.  Locks in question are %s and %s", currentThread().getName(), exclusive ? "exclusive" : "shared", prettyPrintTime(timeout, timeUnit), processingLock.readLock(), processingLock.writeLock()));
//         log.info("Acquired processing lock xcl = %s.  Locks are %s and %s", exclusive, processingLock.readLock(), processingLock.writeLock());
      } catch (InterruptedException ie) {
         currentThread().interrupt();
      }
   }
View Full Code Here

   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

   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

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.