@Test public void waitBeforeRetry() throws InterruptedException { final ConstantTimeBackoff backoff = new ConstantTimeBackoff(); backoff.setTimeToWait(0); Assert.assertTrue(backoff.getWaiters().isEmpty()); backoff.waitBeforeRetry(); Assert.assertTrue(backoff.getWaiters().isEmpty()); }
@Override public void waitBeforeRetry() { final Thread current = Thread.currentThread(); try { _asleep.put(current.getName(), current); Thread.sleep(_time); } catch (final InterruptedException e) { LOG.info("Thread " + current.getName() + " interrupted while waiting for retry"); } finally { _asleep.remove(current.getName()); } return; }
ConstantTimeBackoff extends AdapterBase implements BackoffAlgorithm, ConstantTimeBackoffMBean { @Override public void waitBeforeRetry() { final Thread current = Thread.currentThread(); try { _asleep.put(current.getName(), current); Thread.sleep(_time); } catch (final InterruptedException e) { LOG.info("Thread " + current.getName() + " interrupted while waiting for retry"); } finally { _asleep.remove(current.getName()); } return; } }
ConstantTimeBackoff extends AdapterBase implements BackoffAlgorithm, ConstantTimeBackoffMBean { @Override public void waitBeforeRetry() { final Thread current = Thread.currentThread(); try { _asleep.put(current.getName(), current); Thread.sleep(_time); } catch (final InterruptedException e) { LOG.info("Thread " + current.getName() + " interrupted while waiting for retry"); } finally { _asleep.remove(current.getName()); } return; }  }
ConstantTimeBackoff extends AdapterBase implements BackoffAlgorithm, ConstantTimeBackoffMBean { @Override public void waitBeforeRetry() { final Thread current = Thread.currentThread(); try { _asleep.put(current.getName(), current); Thread.sleep(_time); } catch (final InterruptedException e) { LOG.info("Thread " + current.getName() + " interrupted while waiting for retry"); } finally { _asleep.remove(current.getName()); } return; }  @Override void waitBeforeRetry(); @Override void reset(); @Override boolean configure(final String name, final Map<String, Object> params); @Override long getTimeToWait(); @Override void setTimeToWait(final long seconds); @Override Collection<String> getWaiters(); @Override boolean wakeup(final String threadName); }
ConstantTimeBackoff extends AdapterBase implements BackoffAlgorithm, ConstantTimeBackoffMBean { @Override public void waitBeforeRetry() { final Thread current = Thread.currentThread(); try { _asleep.put(current.getName(), current); Thread.sleep(_time); } catch (final InterruptedException e) { LOG.info("Thread " + current.getName() + " interrupted while waiting for retry"); } finally { _asleep.remove(current.getName()); } return; }  @Override void waitBeforeRetry(); @Override void reset(); @Override boolean configure(final String name, final Map<String, Object> params); @Override long getTimeToWait(); @Override void setTimeToWait(final long seconds); @Override Collection<String> getWaiters(); @Override boolean wakeup(final String threadName);  }