Examples of NotificationMessageHolderType


Examples of org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType

                                      new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                      String.class, "bar"));
            consumerCallback.notifications.wait(1000000);
        }
        assertEquals(1, consumerCallback.notifications.size());
        NotificationMessageHolderType message = consumerCallback.notifications.get(0);
        assertEquals(WSNHelper.getWSAAddress(subscription.getEpr()),
                     WSNHelper.getWSAAddress(message.getSubscriptionReference()));
        assertEquals(WSNHelper.getWSAAddress(publisher.getEpr()),
                     WSNHelper.getWSAAddress(message.getProducerReference()));

        subscription.unsubscribe();
        registration.destroy();
        publisher.stop();
        consumer.stop();
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType

                                      new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                      String.class, "bar"));
            consumerCallback.notifications.wait(1000000);
        }
        assertEquals(1, consumerCallback.notifications.size());
        NotificationMessageHolderType message = consumerCallback.notifications.get(0);
        assertEquals(WSNHelper.getWSAAddress(subscription.getEpr()),
                     WSNHelper.getWSAAddress(message.getSubscriptionReference()));

        subscription.unsubscribe();
        registration.destroy();
        publisher.stop();
        consumer.stop();
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType

                                      new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                          String.class, "bar"));
            callback.notifications.wait(1000000);
        }
        assertEquals(1, callback.notifications.size());
        NotificationMessageHolderType message = callback.notifications.get(0);
        assertEquals(WSNHelper.getInstance().getWSAAddress(subscription.getEpr()),
                     WSNHelper.getInstance().getWSAAddress(message.getSubscriptionReference()));

        subscription.unsubscribe();
        consumer.stop();
    }
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType

                                      new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                      String.class, "bar"));
            consumerCallback.notifications.wait(1000000);
        }
        assertEquals(1, consumerCallback.notifications.size());
        NotificationMessageHolderType message = consumerCallback.notifications.get(0);
        assertEquals(WSNHelper.getInstance().getWSAAddress(subscription.getEpr()),
                     WSNHelper.getInstance().getWSAAddress(message.getSubscriptionReference()));
        assertEquals(WSNHelper.getInstance().getWSAAddress(publisher.getEpr()),
                     WSNHelper.getInstance().getWSAAddress(message.getProducerReference()));

        subscription.unsubscribe();
        registration.destroy();
        publisher.stop();
        consumer.stop();
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType

                                      new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                      String.class, "bar"));
            consumerCallback.notifications.wait(1000000);
        }
        assertEquals(1, consumerCallback.notifications.size());
        NotificationMessageHolderType message = consumerCallback.notifications.get(0);
        assertEquals(WSNHelper.getInstance().getWSAAddress(subscription.getEpr()),
                     WSNHelper.getInstance().getWSAAddress(message.getSubscriptionReference()));

        subscription.unsubscribe();
        registration.destroy();
        publisher.stop();
        consumer.stop();
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType

        synchronized (consumerCallback.notifications) {
            notificationBroker.notify(publisher, "myTopic", new CustomType(1, 2));
            consumerCallback.notifications.wait(1000000);
        }
        assertEquals(1, consumerCallback.notifications.size());
        NotificationMessageHolderType message = consumerCallback.notifications.get(0);
        assertEquals(WSNHelper.getInstance().getWSAAddress(subscription.getEpr()),
                     WSNHelper.getInstance().getWSAAddress(message.getSubscriptionReference()));
        assertEquals(WSNHelper.getInstance().getWSAAddress(publisher.getEpr()),
                     WSNHelper.getInstance().getWSAAddress(message.getProducerReference()));
        assertTrue(message.getMessage().getAny() instanceof CustomType);

        subscription.unsubscribe();
        registration.destroy();
        publisher.stop();
        consumer.stop();
View Full Code Here

Examples of org.oasis_open.docs.wsn.b_2.NotificationMessageHolderType

            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);
            }
View Full Code Here

Examples of org.servicemix.ws.xmlbeans.notification.base.NotificationMessageHolderType

        ActiveMQTopic topic = new ActiveMQTopic("Test");
        MessageConsumer consumer = session.createConsumer(topic);
       
        NotifyDocument request = NotifyDocument.Factory.newInstance();
        Notify notify = request.addNewNotify();
        NotificationMessageHolderType messageHolder = notify.addNewNotificationMessage();
        messageHolder.setTopic( TopicExpressionConverter.toTopicExpression(topic) );
        XmlObject o = createMessage();
        messageHolder.setMessage(o);
       
        System.out.println(request);
        broker.notify(request);
       
        Message message = consumer.receive(3000);
View Full Code Here

Examples of org.servicemix.ws.xmlbeans.notification.base.NotificationMessageHolderType

    public void notify(NotifyDocument requestDoc) {
        try {
            Notify notify = requestDoc.getNotify();
            NotificationMessageHolderType[] messageHolders = notify.getNotificationMessageArray();
            for (int i = 0; i < messageHolders.length; i++) {
                NotificationMessageHolderType messageHolder = messageHolders[i];
                Topic topic = TopicExpressionConverter.toActiveMQTopic(messageHolder.getTopic());
                EndpointReferenceType producerReference = messageHolder.getProducerReference();
                ActiveMQPublisherRegistration publisher = getPublisher(producerReference);
                publisher.notify(topic, messageHolder.getMessage());
            }
        }
        catch (IOException e) {
            throw new NotificationException(e);
        }
View Full Code Here

Examples of org.servicemix.ws.xmlbeans.notification.base.NotificationMessageHolderType

   
    protected void sendNotification(ActiveMQNotificationBroker broker) {
        // START SNIPPET: notify
        NotifyDocument request = NotifyDocument.Factory.newInstance();
        NotifyDocument.Notify notify = request.addNewNotify();
        NotificationMessageHolderType messageHolder = notify.addNewNotificationMessage();
        messageHolder.setTopic( TopicExpressionConverter.toTopicExpression(topic) );

        // create some XMLBean for the payload
        XmlObject o = createMessage();
        messageHolder.setMessage(o);
        broker.notify(request);
        // END SNIPPET: notify

        assertValidMessage(request);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.