public void onMessage(Message jmsMessage) { try { TextMessage text = (TextMessage) jmsMessage; XMLStreamReader reader = StaxUtils.createXMLStreamReader(new StringReader(text.getText())); Notify notify = (Notify) jaxbContext.createUnmarshaller() .unmarshal(reader); reader.close(); for (Iterator<NotificationMessageHolderType> ith = notify.getNotificationMessage().iterator(); ith.hasNext();) { NotificationMessageHolderType h = ith.next(); Object content = h.getMessage().getAny(); if (!(content instanceof Element)) { DocumentFragment doc = DOMUtils.getEmptyDocument().createDocumentFragment(); jaxbContext.createMarshaller().marshal(content, doc); content = DOMUtils.getFirstElement(doc); } 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); } }
notificationMessage.setSubscriptionReference(createW3cEndpointReference(subscriptionReference)); if (simpleTopicExpression) { notificationMessage.setTopic(createTopicExpressionTypeWithSimpleExpressionType(topic));
NotificationMessageHolderType notificationMessage = translator.translate(event); notificationMessage.setSubscriptionReference(createW3cEndpointReference(subscriptionReference)); if (event.getGraph().getURI().endsWith( WsnConstants.SIMPLE_TOPIC_EXPRESSION_MARKER)) {
new NotificationMessageHolderType(); notificationMessage.setSubscriptionReference(createW3cEndpointReference(subscriptionReference));