Package org.activemq.ws.xmlbeans.notification.base

Examples of org.activemq.ws.xmlbeans.notification.base.NotifyDocument$Notify


        };

        addSubscription(broker);
        sendNotification(broker);

        NotifyDocument subNotifyDoc = (NotifyDocument) service.getResult().poll(2000);
        System.out.println("Got Notify: "+subNotifyDoc);
       
        assertValidMessage(subNotifyDoc);
    }
View Full Code Here


        ActiveMQConnection connection = broker.getConnection();
        Session session = connection.createSession(false, 0);
        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);
       
View Full Code Here

        };

        addSubscription(broker);
        sendNotification(broker);

        NotifyDocument subNotifyDoc = (NotifyDocument) result.poll(2000);
        System.out.println("Got Notify: "+subNotifyDoc);

        assertValidMessage(subNotifyDoc);
    }
View Full Code Here

        EndpointReferenceType subRef = addSubscription(broker);
       
        // The sub should be running and we should be getting notifed now.
        sendNotification(broker);
        NotifyDocument subNotifyDoc = (NotifyDocument) result.poll(2000);
        assertNotNull(subNotifyDoc);
       
        // Pause the subscription.
        PauseSubscriptionDocument pauseRequest = PauseSubscriptionDocument.Factory.newInstance();
        pauseRequest.addNewPauseSubscription();
View Full Code Here

        return subresponse.getSubscribeResponse().getSubscriptionReference();
    }
   
    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();
View Full Code Here

        notificationConsumer = consumer;
       
    }

    private void dispatch(TopicExpressionType topic, XmlObject xml) {
        NotifyDocument request = NotifyDocument.Factory.newInstance();
        Notify notify = request.addNewNotify();
        NotificationMessageHolderType messageHolder = notify.addNewNotificationMessage();
        if( producerReference!=null )
            messageHolder.setProducerReference((EndpointReferenceType) producerReference.copy());
        messageHolder.setTopic(topic);
        messageHolder.setMessage(xml);
View Full Code Here

    @Override
    protected synchronized void store(NotificationMessageHolderType messageHolder) {
        try {
            initSession();
            Notify notify = new Notify();
            notify.getNotificationMessage().add(messageHolder);
            StringWriter writer = new StringWriter();
            jaxbContext.createMarshaller().marshal(notify, writer);
            Message message = session.createTextMessage(writer.toString());
            producer.send(message);
        } catch (JMSException e) {
View Full Code Here

                if (msg == null) {
                    break;
                }
                TextMessage txtMsg = (TextMessage) msg;
                StringReader reader = new StringReader(txtMsg.getText());
                Notify notify = (Notify) jaxbContext.createUnmarshaller().unmarshal(reader);
                messages.addAll(notify.getNotificationMessage());
            }
            return messages;
        } catch (JMSException e) {
            log.info("Error retrieving messages", e);
            if (jmsSession != null) {
View Full Code Here

        // START SNIPPET: sub
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);
        // END SNIPPET: sub

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.unsubscribe();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(0, pullPoint.getMessages(0).size());
View Full Code Here

    public void testPauseResume() throws Exception {
        PullPoint pullPoint = wsnCreatePullPoint.createPullPoint();
        Subscription subscription = wsnBroker.subscribe(pullPoint.getEndpoint(), "myTopic", null);

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());

        subscription.pause();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(0, pullPoint.getMessages(0).size());

        subscription.resume();

        wsnBroker.notify("myTopic", new Notify());
        // Wait for notification
        Thread.sleep(150);

        assertEquals(1, pullPoint.getMessages(0).size());
View Full Code Here

TOP

Related Classes of org.activemq.ws.xmlbeans.notification.base.NotifyDocument$Notify

Copyright © 2018 www.massapicom. 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.