private void handleDataNotAvailable(DataNotAvailableException e) throws BlockedException { if (e.getWaitUntil() != null) { long timeDiff = e.getWaitUntil().getTime() - System.currentTimeMillis(); if (timeDiff <= 0) { //already met the time return; } if (e.isStrict()) { this.waitUntil = e.getWaitUntil().getTime(); } scheduleMoreWork(timeDiff); } else if (e.getRetryDelay() >= 0) { if (e.isStrict()) { this.waitUntil = System.currentTimeMillis() + e.getRetryDelay(); } scheduleMoreWork(e.getRetryDelay()); } else if (this.cwi.isDataAvailable()) { return; //no polling, but data is already available } else if (e.isStrict()) { //no polling, wait indefinitely this.waitUntil = Long.MAX_VALUE; } throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on DataNotAvailableException", aqr.getAtomicRequestID()); //$NON-NLS-1$ }
private void handleDataNotAvailable(DataNotAvailableException e) throws BlockedException { if (e.getWaitUntil() != null) { long timeDiff = e.getWaitUntil().getTime() - System.currentTimeMillis(); if (timeDiff <= 0) { //already met the time return; } if (e.isStrict()) { this.waitUntil = e.getWaitUntil().getTime(); } scheduleMoreWork(timeDiff); } else if (e.getRetryDelay() >= 0) { if (e.isStrict()) { this.waitUntil = System.currentTimeMillis() + e.getRetryDelay(); } scheduleMoreWork(e.getRetryDelay()); } else if (this.cwi.isDataAvailable()) { return; //no polling, but data is already available } else if (e.isStrict()) { //no polling, wait indefinitely this.waitUntil = Long.MAX_VALUE; } throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on DataNotAvailableException", aqr.getAtomicRequestID()); //$NON-NLS-1$ }
private void handleDataNotAvailable(DataNotAvailableException e) throws BlockedException { if (e.getWaitUntil() != null) { long timeDiff = e.getWaitUntil().getTime() - System.currentTimeMillis(); if (timeDiff <= 0) { //already met the time return; } if (e.isStrict()) { this.waitUntil = e.getWaitUntil().getTime(); } scheduleMoreWork(timeDiff); } else if (e.getRetryDelay() >= 0) { if (e.isStrict()) { this.waitUntil = System.currentTimeMillis() + e.getRetryDelay(); } scheduleMoreWork(e.getRetryDelay()); } else if (this.cwi.isDataAvailable()) { return; //no polling, but data is already available } else if (e.isStrict()) { //no polling, wait indefinitely this.waitUntil = Long.MAX_VALUE; } throw BlockedException.block(aqr.getAtomicRequestID(), "Blocking on DataNotAvailableException", aqr.getAtomicRequestID()); //$NON-NLS-1$ }