@Override public void awaitSettlement(int... flags) throws MessagingException { _pending.waitUntilFalse(); if (_state == DeliveryState.LINK_FAILED) { throw new MessagingException( "The link has failed due to the underlying network connection failure. The message associated with this delivery is in-doubt"); } }
@Override public void awaitSettlement(long timeout, TimeUnit unit, int... flags) throws MessagingException, TimeoutException { try { _pending.waitUntilFalse(unit.toMillis(timeout)); if (_state == DeliveryState.LINK_FAILED) { throw new MessagingException( "The link has failed due to the underlying network connection failure. The message associated with this delivery is in-doubt"); } } catch (ConditionManagerTimeoutException e) { throw new TimeoutException("The delivery was not settled within the given time period", e); } }
void markLinkFailed() { _state = DeliveryState.LINK_FAILED; _pending.setValueAndNotify(false); }
void markSettled() { _settled = true; _pending.setValueAndNotify(false); }