@Override public synchronized boolean handleError() { if (delegate.isAvailable()) { final long time = System.currentTimeMillis(); // If the timeout is reached reset the error count if (time >= timeout) { count = 1; timeout = time + interval; } else { if (count++ == 1) { timeout = time + interval; } } if (count >= errorCount) { return delegate.handleError(); } return true; } else { count = 0; // if in error reset the successful count return false; } }
@Override public synchronized boolean handleError() { if (delegate.isAvailable()) { final long time = System.currentTimeMillis(); // If the timeout is reached reset the error count if (time >= timeout) { count = 1; timeout = time + interval; } else { if (count++ == 1) { timeout = time + interval; } } if (count >= errorCount) { return delegate.handleError(); } return true; } else { count = 0; // if in error reset the successful count return false; } }
@Override public synchronized boolean handleError() { if (delegate.isAvailable()) { final long time = System.currentTimeMillis(); // If the timeout is reached reset the error count if (time >= timeout) { count = 1; timeout = time + interval; } else { if (count++ == 1) { timeout = time + interval; } } if (count >= errorCount) { return delegate.handleError(); } return true; } else { count = 0; // if in error reset the successful count return false; } }