protected void updateDeliveryCountForCanceledRef(MessageReference ref, boolean failed) { // We first update the deliveryCount at the protocol callback... // if that wasn't updated (if there is no specific logic, then we apply the default logic used on most protocols if (!callback.updateDeliveryCountAfterCancel(this, ref, failed)) { if (!failed) { // We don't decrement delivery count if the client failed, since there's a possibility that refs // were actually delivered but we just didn't get any acks for them // before failure ref.decrementDeliveryCount(); } } }