* valid subscriptions by sending a <code>TopicMsgsReply</code> notification
* to the valid subscribers.
*/
protected void processMessages(ClientMessages not) {
List messages = not.getMessages();
AgentId subscriber;
boolean local;
String selector;
List deliverables;
Message message;
nbMsgsReceiveSinceCreation = nbMsgsReceiveSinceCreation + messages.size();
// interceptors process
if (interceptorsAvailable()) {
DMQManager dmqManager = null;
List newMessages = new ArrayList();
Iterator it = messages.iterator();
while (it.hasNext()) {
Message m = (Message) it.next();
// set the destination name to the message
m.setProperty("JoramDestinationName", getName());
message = processInterceptors(m);
if (message != null) {
newMessages.add(message);
} else {
//send message to the DMQ
if (dmqManager == null)
dmqManager = new DMQManager(dmqId, getId());
nbMsgsSentToDMQSinceCreation++;
dmqManager.addDeadMessage(m, MessageErrorConstants.INTERCEPTORS);
}
}
if (dmqManager != null)
dmqManager.sendToDMQ();
if (!newMessages.isEmpty()) {
messages = newMessages;
} else {
return;
}
}
setNoSave();
boolean persistent = false;
for (Iterator subs = subscribers.iterator(); subs.hasNext();) {
// Browsing the subscribers.
subscriber = (AgentId) subs.next();
local = (subscriber.getTo() == AgentServer.getServerId());
selector = (String) selectors.get(subscriber);
if (selector == null || selector.equals("")) {
// Current subscriber does not filter messages: all messages
// will be sent.