}
public void onMessage(Message jmsMessage) {
try {
TextMessage text = (TextMessage) jmsMessage;
Notify notify = (Notify) jaxbContext.createUnmarshaller()
.unmarshal(new StringReader(text.getText()));
for (Iterator<NotificationMessageHolderType> ith = notify.getNotificationMessage().iterator();
ith.hasNext();) {
NotificationMessageHolderType h = ith.next();
Object content = h.getMessage().getAny();
if (!(content instanceof Element)) {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
Document doc = factory.newDocumentBuilder().newDocument();
jaxbContext.createMarshaller().marshal(content, doc);
content = doc.getDocumentElement();
}
if (!doFilter((Element) content)) {
ith.remove();
} else {
h.setTopic(topic);
h.setSubscriptionReference(getEpr());
}
}
if (!notify.getNotificationMessage().isEmpty()) {
doNotify(notify);
}
} catch (Exception e) {
LOGGER.log(Level.WARNING, "Error notifying consumer", e);
}