public void recover(ConnectionContext context, Topic topic, SubscriptionRecovery sub) throws Exception {
// Re-dispatch the messages from the buffer.
List copy = buffer.getMessages(sub.getActiveMQDestination());
if (!copy.isEmpty()) {
for (Iterator iter = copy.iterator(); iter.hasNext();) {
MessageReference node = (MessageReference)iter.next();
sub.addRecoveredMessage(context, node);
}
}
}