@Override public void check() { boolean retry = true; while (retry) { try { for (CriticalComponent component : components) { if (component.isExpired(timeoutNanoSeconds)) { fireAction(component); // no need to keep running if there's already a component failed return; } } retry = false; // got to the end of the list, no need to retry } catch (ConcurrentModificationException dontCare) { // lets retry on the loop } } }
@Override public void check() { boolean retry = true; while (retry) { try { for (CriticalComponent component : components) { if (component.isExpired(timeoutNanoSeconds)) { fireAction(component); // no need to keep running if there's already a component failed return; } } retry = false; // got to the end of the list, no need to retry } catch (ConcurrentModificationException dontCare) { // lets retry on the loop } } }
@Override public void check() { boolean retry = true; while (retry) { try { for (CriticalComponent component : components) { if (component.isExpired(timeoutNanoSeconds)) { fireAction(component); // no need to keep running if there's already a component failed return; } } retry = false; // got to the end of the list, no need to retry } catch (ConcurrentModificationException dontCare) { // lets retry on the loop } } }
@Override public void check() { boolean retry = true; while (retry) { try { for (CriticalComponent component : components) { if (component.isExpired(timeoutNanoSeconds)) { fireAction(component); // no need to keep running if there's already a component failed return; } } retry = false; // got to the end of the list, no need to retry } catch (ConcurrentModificationException dontCare) { // lets retry on the loop } } }
@Override public void check() { boolean retry = true; while (retry) { try { for (CriticalComponent component : components) { if (component.isExpired(timeoutNanoSeconds)) { fireAction(component); // no need to keep running if there's already a component failed return; } } retry = false; // got to the end of the list, no need to retry } catch (ConcurrentModificationException dontCare) { // lets retry on the loop } } }
@Override public void check() { boolean retry = true; while (retry) { try { for (CriticalComponent component : components) { if (component.isExpired(timeoutNanoSeconds)) { fireAction(component); // no need to keep running if there's already a component failed return; } } retry = false; // got to the end of the list, no need to retry } catch (ConcurrentModificationException dontCare) { // lets retry on the loop } } }
@Override public void check() { boolean retry = true; while (retry) { try { for (CriticalComponent component : components) { if (component.isExpired(timeoutNanoSeconds)) { fireAction(component); // no need to keep running if there's already a component failed return; } } retry = false; // got to the end of the list, no need to retry } catch (ConcurrentModificationException dontCare) { // lets retry on the loop } } }