@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public boolean hasNext() { return this.origin.hasNext(); }
/** * Waits certain time before returning. * @param rof RetryOnFailure parameters. * @param attempt Attempt number. * @throws InterruptedException If wait has been interrupted. */ private void delay(final RetryOnFailure rof, final int attempt) throws InterruptedException { final long delay; if (rof.randomize()) { delay = Repeater.RAND.nextInt(2 << attempt) * rof.delay(); } else { delay = rof.delay() * attempt; } rof.unit().sleep(delay); }
int attempt = 0; final long begin = System.nanoTime(); final Class<? extends Throwable>[] types = rof.types(); final ImprovedJoinPoint joinpoint = new ImprovedJoinPoint(point); while (true) { if (Repeater.matches(ex.getClass(), rof.ignore())) { throw ex; if (rof.verbose()) { Logger.warn( joinpoint.targetize(), attempt, rof.attempts(), System.nanoTime() - start, System.nanoTime() - begin, ex ); attempt, rof.attempts(), ex, System.nanoTime() - start, System.nanoTime() - begin, Repeater.message(ex) ); if (attempt >= rof.attempts()) { throw ex; if (rof.delay() > 0L) { this.delay(rof, attempt);
int attempt = 0; final long begin = System.nanoTime(); final Class<? extends Throwable>[] types = rof.types(); final ImprovedJoinPoint joinpoint = new ImprovedJoinPoint(point); while (true) { if (Repeater.matches(ex.getClass(), rof.ignore())) { throw ex; if (rof.verbose()) { Logger.warn( joinpoint.targetize(), attempt, rof.attempts(), System.nanoTime() - start, System.nanoTime() - begin, ex ); attempt, rof.attempts(), ex, System.nanoTime() - start, System.nanoTime() - begin, Repeater.message(ex) ); if (attempt >= rof.attempts()) { throw ex; if (rof.delay() > 0L) { this.delay(rof, attempt);
@Override @RetryOnFailure ( verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS, ignore = NoSuchElementException.class ) public T next() { return this.origin.next(); }
/** * Waits certain time before returning. * @param rof RetryOnFailure parameters. * @param attempt Attempt number. * @throws InterruptedException If wait has been interrupted. */ private void delay(final RetryOnFailure rof, final int attempt) throws InterruptedException { final long delay; if (rof.randomize()) { delay = Repeater.RAND.nextInt(2 << attempt) * rof.delay(); } else { delay = rof.delay() * attempt; } rof.unit().sleep(delay); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public void remove() { this.origin.remove(); } }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public boolean hasNext() { return this.origin.hasNext(); }
@Override @RetryOnFailure ( verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS, ignore = NoSuchElementException.class ) public T next() { return this.origin.next(); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public boolean hasNext() { return this.origin.hasNext(); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public boolean isEmpty() { return this.origin.isEmpty(); }
@Override @RetryOnFailure ( verbose = false, attempts = Tv.TWENTY, delay = Tv.TWENTY, unit = TimeUnit.SECONDS ) public void delete(final String name) throws IOException { this.origin.delete(name); }
@Override @RetryOnFailure ( verbose = false, attempts = Tv.TWENTY, delay = Tv.TWENTY, unit = TimeUnit.SECONDS ) public String name() { return this.origin.name(); }
@Override @RetryOnFailure ( verbose = false, attempts = Tv.TWENTY, delay = Tv.TWENTY, unit = TimeUnit.SECONDS ) public boolean unlock(final String label) throws IOException { return this.origin.unlock(label); } }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public Item put(final Map<String, AttributeValue> attributes) throws IOException { return this.origin.put(attributes); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public int size() { return this.origin.size(); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public boolean addAll(final Collection<? extends Item> list) { return this.origin.addAll(list); }
@Override @RetryOnFailure(verbose = false, delay = Tv.FIVE, unit = TimeUnit.SECONDS) public boolean retainAll(final Collection<?> list) { return this.origin.retainAll(list); }
@Override @RetryOnFailure ( verbose = false, attempts = Tv.TWENTY, delay = Tv.TWENTY, unit = TimeUnit.SECONDS ) public Iterable<String> names() throws IOException { return this.origin.names(); }
@Override @RetryOnFailure ( verbose = false, attempts = Tv.TWENTY, delay = Tv.TWENTY, unit = TimeUnit.SECONDS ) public Counter create(final String name) throws IOException { return this.origin.create(name); }