class JustRetryFailoverHandler extends ComparableFailoverHandler {

  @Override
  public <T> Response<T> handle(final Invocation<T> invocation, final Response<T> response) {
    logger.debug("Handle {} with {}", response.getError(), this);

    Response<T> next = response;
    int countDown = this.count;
    while (null != next.getError() && 0 < countDown) {
      try {
        logger.debug("Just retry with {} after sleep {}ms (count left: {})", invocation,
            this.interval, countDown);
        Thread.sleep(this.interval);
      } catch (Exception e) {
        throw new HerajException("Unexpected error", e);
      }

      try {
        final T ret = invocation.invoke();
        next = Response.success(ret);
      } catch (Exception e) {
        next = Response.fail(e);
      }
      --countDown;
    }
    return next;
  }

    JustRetryFailoverHandler(final int count, final Time interval);

}