Java 8 TimeoutException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 TimeoutException class.

This code example shows how to use the following methods:getMessage
    @Override 
    public V txGet(long timeout, TimeUnit unit) throws ElasticSearchException {
        try { 
            return get(timeout, unit);
        } catch (TimeoutException e) {
            throw new ElasticSearchTimeoutException(e.getMessage());
        } catch (InterruptedException e) {
            throw new ElasticSearchInterruptedException(e.getMessage());
        } catch (ExecutionException e) {
            if (e.getCause() instanceof ElasticSearchException) {
                throw (ElasticSearchException) e.getCause();
            } else { 
                throw new TransportException("Failed execution", e);
            } 
        } 
    } 
 
    @Override 
    public V newInstance() { 
        return handler.newInstance();
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    _timeout.addTimeoutTask(new Runnable() 
    { 
      @Override 
      public void run() 
      { 
        callback.onError(new TimeoutException(timeoutMessage)); 
      } 
    }); 
  } 
 
  @Override 
  public void onSuccess(T t) 
  { 
    Callback<T> callback = _timeout.getItem(); 
    if (callback != null) 
    { 
      callback.onSuccess(t); 
    } 
  } 
 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMessage
    @Override 
    public T actionGet(long timeout, TimeUnit unit) throws ElasticSearchException {
        try { 
            return get(timeout, unit);
        } catch (TimeoutException e) {
            throw new ElasticSearchTimeoutException(e.getMessage());
        } catch (InterruptedException e) {
            throw new ElasticSearchInterruptedException(e.getMessage());
        } catch (ExecutionException e) {
            throw rethrowExecutionException(e);
        } 
    } 
 
    static ElasticSearchException rethrowExecutionException(ExecutionException e) {
        if (e.getCause() instanceof ElasticSearchException) {
            ElasticSearchException esEx = (ElasticSearchException) e.getCause();
            Throwable root = esEx.unwrapCause();
            if (root instanceof ElasticSearchException) {
                return (ElasticSearchException) root;
            } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            throw new AssertionError(ex);
        } 
 
        if (!success)
        { 
            throw new TimeoutException("Truncate timed out - received only " + responses.get() + " responses");
        } 
    } 
 
    public void response(MessageIn message)
    { 
        responses.incrementAndGet();
        if (responses.get() >= responseCount)
            condition.signalAll();
    } 
 
    public boolean isLatencyForSnitch() 
    { 
        return false; 
    } 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    } 
 
    public void put(Thread t, long timeoutMS) throws InterruptedException, TimeoutException
    { 
        if (!queue.offer(new WeightedQueue.Entry(t), timeoutMS, TimeUnit.MILLISECONDS))
            throw new TimeoutException("Failed to acquire request scheduler slot for '" + key + "'");
    } 
 
    public Thread poll()
    { 
        Entry e = queue.poll();
        if (e == null)
            return null; 
        metric.addNano(System.nanoTime() - e.creationTime);
        return e.thread;
    } 
 
    @Override 
    public String toString()
    { 
7
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
 
   @Test(expectedExceptions = UncheckedExecutionException.class) 
   void testDoesntCatchOtherExceptions() { 
      BackoffOnNotFoundWhenGetBucketACL backoff = new BackoffOnNotFoundWhenGetBucketACL(mock); 
 
      expect(mock.getBucketACL("foo")).andThrow(new UncheckedExecutionException(new TimeoutException())); 
 
      replay(mock); 
      backoff.load("foo"); 
      verify(mock); 
   } 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
            if (cause == null) { 
                return getNow(); 
            } 
            throw new ExecutionException(cause); 
        } 
        throw new TimeoutException(); 
    } 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
    join(millisJoinTimeout);
    if (isAlive()) {
      interrupt();
      join(millisInterruptTimeout);
      if (isAlive()) {
        throw new TimeoutException("Thread refused to die");
      } 
    } 
    if (trackedTarget.getThrowable() != null) {
      throw new Throwable("Underlying thread had exception", trackedTarget.getThrowable());
    } 
  } 
 
  public Object getResult(long millisJoinTimeout, long millisInterruptTimeout) throws Throwable {
    joinOrInterrupt(millisJoinTimeout, millisInterruptTimeout);
    return trackedTarget.getResult();
  } 
 
  public Object getResult() throws Throwable {
    return getResult(10000, 1000); 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
			this.next.evaluate();
		} 
		finally { 
			long elapsed = System.currentTimeMillis() - startTime;
			if (elapsed > this.timeout) {
				throw new TimeoutException(String.format("Test took %s ms; limit was %s ms.", elapsed, this.timeout));
			} 
		} 
	} 
 
} 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
                    js = this.fileToString("total-conversion-build.user.js", true);
                } catch (ExecutionException e) {
                    e.printStackTrace();
                    js = this.fileToString("total-conversion-build.user.js", true);
                } catch (TimeoutException e) {
                    e.printStackTrace();
                    js = this.fileToString("total-conversion-build.user.js", true);
                } 
            } else { 
                js = this.fileToString("total-conversion-build.user.js", true);
            } 
        } 
 
        PackageManager pm = mContext.getPackageManager();
        boolean hasMultitouch = pm
                .hasSystemFeature(PackageManager.FEATURE_TOUCHSCREEN_MULTITOUCH);
        boolean forcedZoom = sharedPref.getBoolean("pref_user_zoom", false);
        if (hasMultitouch && !forcedZoom) {
            js = js.replace("window.showZoom = true;",
                    "window.showZoom = false;"); 
6
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Java 8 TimeoutException Questions & Answers:

See Code Examples for Java 8 TimeoutException Methods: