// AF: TODO we should parse each message for each subscription
// see ClientSubscription.browseNewMessages
List messages = new ArrayList();
for (Iterator msgs = rep.getMessages().iterator(); msgs.hasNext();) {
Message message = new Message((org.objectweb.joram.shared.messages.Message) msgs.next());
// Setting the arrival order of the messages
message.order = arrivalsCounter++;
messages.add(message);
}
for (Iterator names = tSub.getNames(); names.hasNext();) {
subName = (String) names.next();
sub = (ClientSubscription) subsTable.get(subName);
if (sub == null) continue;
// Browsing the delivered messages.
sub.browseNewMessages(messages);
}
// Save message if it is delivered to a durable subscription.
for (Iterator msgs = messages.iterator(); msgs.hasNext();) {
Message message = (Message) msgs.next();
if (message.durableAcksCounter > 0) {
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, " -> save message " + message);
setSave();
// Persisting the message.
setMsgTxName(message);
message.save();
message.releaseFullMessage();
}
}
for (Iterator names = tSub.getNames(); names.hasNext();) {
subName = (String) names.next();