out.writeObject(messages);
out.writeObject(deliveredMsgs);
}
protected void handleExpiredNot(AgentId from, ExpiredNot not) {
Notification expiredNot = not.getExpiredNot();
List messages;
// ClientMessages and TopicMsgsReply are the notifications which can expire in the networks.
// QueueMsgReply can't expire due to protocol limitations
if (expiredNot instanceof ClientMessages) {
messages = ((ClientMessages) expiredNot).getMessages();
} else if (expiredNot instanceof TopicMsgsReply) {
messages = ((TopicMsgsReply) expiredNot).getMessages();
} else {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR,
"Expired notification holds an unknown notification: " + expiredNot.getClass().getName());
return;
}
// Let senderId to null because we want to explicitly send messages to the queue itself.
DMQManager dmqManager = new DMQManager(getId(), null);