}
}
public synchronized void recoverSubscription(Subscription subscription, MessageIdentity lastDispatchedMessage) throws JMSException {
try {
MessageIdentity lastAcked = getLastAcknowledgedMessageIdentity(subscription);
if (lastAcked == null) {
// for a new durable subscription lets write the last ack messageID
// as the previous one that the container delivered to ensure that
// if we go down before acking anything, we will recover to the right point
setLastAcknowledgedMessageIdentity(subscription, lastDispatchedMessage);
lastAcked = lastDispatchedMessage;
}
Object lastAckedSequenceNumber = lastAcked.getSequenceNumber();
// lets iterate through all IDs from the
//Tuple tuple = new Tuple();
Tuple tuple = getOrderedIndex().findGreaterOrEqual(lastAckedSequenceNumber);