}
link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.UNINITIALIZED, ProtonProtocolManager.INITIALIZED);
}
//handle any deliveries
DeliveryImpl delivery;
Iterator<DeliveryImpl> iterator = protonConnection.getWorkSequence();
while (iterator.hasNext())
{
delivery = iterator.next();
ProtonDeliveryHandler handler = (ProtonDeliveryHandler) delivery.getLink().getContext();
try
{
handler.onMessage(delivery);
}
catch (HornetQAMQPException e)
{
delivery.getLink().setCondition(new ErrorCondition(e.getAmqpError(), e.getMessage()));
}
}
link = (LinkImpl) protonConnection.linkHead(ProtonProtocolManager.ACTIVE, ProtonProtocolManager.ANY_ENDPOINT_STATE);
while (link != null)