@Test public void testWaitTimeout() throws Exception { final Retriable<Object> retriable = new Retriable<Object>() { @Override public Object retriableCall() throws NoSuchAlgorithmException { return null; } }; retriable.waitTimeout(0); retriable.waitTimeout(1); }
protected void waitTimeout(long timeout) throws RetriableException { if (timeout > 0) { try { Thread.sleep(timeout); } catch (InterruptedException interException) { LOGGER.debug("Interrupted during timeout", interException); } } }
Retriable { protected void waitTimeout(long timeout) throws RetriableException { if (timeout > 0) { try { Thread.sleep(timeout); } catch (InterruptedException interException) { LOGGER.debug("Interrupted during timeout", interException); } } } }
Retriable { protected void waitTimeout(long timeout) throws RetriableException { if (timeout > 0) { try { Thread.sleep(timeout); } catch (InterruptedException interException) { LOGGER.debug("Interrupted during timeout", interException); } } }  }
Retriable { protected void waitTimeout(long timeout) throws RetriableException { if (timeout > 0) { try { Thread.sleep(timeout); } catch (InterruptedException interException) { LOGGER.debug("Interrupted during timeout", interException); } } }  abstract T retriableCall(); T retryCallOnFail(int times, long timeout); }
Retriable { protected void waitTimeout(long timeout) throws RetriableException { if (timeout > 0) { try { Thread.sleep(timeout); } catch (InterruptedException interException) { LOGGER.debug("Interrupted during timeout", interException); } } }  abstract T retriableCall(); T retryCallOnFail(int times, long timeout);  }