// If client is not a reader, sending an exception.
if (! isReader(from))
throw new AccessException("READ right not granted");
// Building the reply:
BrowseReply rep = new BrowseReply(not);
// Cleaning the possibly expired messages.
DMQManager dmqManager = cleanPendingMessage(System.currentTimeMillis());
// Adding the deliverable messages to it:
Message message;
for (int i = 0; i < messages.size(); i++) {
message = (Message) messages.get(i);
if (Selector.matches(message.getHeaderMessage(), not.getSelector())) {
// Matching selector: adding the message:
rep.addMessage(message.getFullMessage());
}
}
// Sending the dead messages to the DMQ, if needed:
if (dmqManager != null)