Examples of PullPoint


Examples of org.apache.cxf.wsn.client.PullPoint

        subscription.unsubscribe();
        consumer.stop();
    }

    public void testPullPoint() throws Exception {
        PullPoint pullPoint = createPullPoint.create();
        Subscription subscription = notificationBroker.subscribe(pullPoint, "myTopic");
        notificationBroker.notify("myTopic",
                                  new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                  String.class, "bar"));

        boolean received = false;
        for (int i = 0; i < 50; i++) {
            List<NotificationMessageHolderType> messages = pullPoint.getMessages(10);
            if (!messages.isEmpty()) {
                received = true;
                break;
            }
            Thread.sleep(100);
        }
        assertTrue(received);

        subscription.unsubscribe();
        pullPoint.destroy();
    }
View Full Code Here

Examples of org.apache.cxf.wsn.client.PullPoint

        subscription.unsubscribe();
        consumer.stop();
    }

    public void testPullPoint() throws Exception {
        PullPoint pullPoint = createPullPoint.create();
        Subscription subscription = notificationBroker.subscribe(pullPoint, "myTopic");
        notificationBroker.notify("myTopic",
                                  new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                  String.class, "bar"));

        boolean received = false;
        for (int i = 0; i < 50; i++) {
            List<NotificationMessageHolderType> messages = pullPoint.getMessages(10);
            if (!messages.isEmpty()) {
                received = true;
                break;
            }
            Thread.sleep(100);
        }
        assertTrue(received);

        subscription.unsubscribe();
        pullPoint.destroy();
    }
View Full Code Here

Examples of org.apache.cxf.wsn.client.PullPoint

        subscription.unsubscribe();
        consumer.stop();
    }

    public void testPullPoint() throws Exception {
        PullPoint pullPoint = createPullPoint.create();
        Subscription subscription = notificationBroker.subscribe(pullPoint, "myTopic");
        notificationBroker.notify("myTopic",
                                  new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                  String.class, "bar"));

        boolean received = false;
        for (int i = 0; i < 50; i++) {
            List<NotificationMessageHolderType> messages = pullPoint.getMessages(10);
            if (!messages.isEmpty()) {
                received = true;
                break;
            }
            Thread.sleep(100);
        }
        assertTrue(received);

        subscription.unsubscribe();
        pullPoint.destroy();
    }
View Full Code Here

Examples of org.apache.cxf.wsn.client.PullPoint

        consumer.stop();
    }

    @Test
    public void testPullPoint() throws Exception {
        PullPoint pullPoint = createPullPoint.create();
        Subscription subscription = notificationBroker.subscribe(pullPoint, "myTopic");
        notificationBroker.notify("myTopic",
                                  new JAXBElement<String>(new QName("urn:test:org", "foo"),
                                                  String.class, "bar"));

        boolean received = false;
        for (int i = 0; i < 50; i++) {
            List<NotificationMessageHolderType> messages = pullPoint.getMessages(10);
            if (!messages.isEmpty()) {
                received = true;
                break;
            }
            Thread.sleep(100);
        }
        assertTrue(received);

        subscription.unsubscribe();
        pullPoint.destroy();
    }
View Full Code Here

Examples of org.apache.muse.ws.notification.PullPoint

            throw new UnableToCreatePullPointFault(error);
        }
       
        EndpointReference epr = pullPoint.getEndpointReference();
       
        PullPoint pullPointCap = (PullPoint)pullPoint.getCapability(WsnConstants.PULL_POINT_URI);
        Filter filter = pullPointCap.getFilter();
       
        //
        // create subscription that will send messages to the pullpoint
        //
        NotificationProducer wsn = (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);
        WsResource sub = null;
       
        try
        {
            sub = wsn.subscribe(epr, filter, null, null);
        }
       
        catch (BaseFault error)
        {
            throw new UnableToCreatePullPointFault(error);
        }
       
        pullPointCap.setSubscription(sub);
       
        //
        // initialize pullpoint to complete creation process
        //
        try
View Full Code Here

Examples of org.apache.muse.ws.notification.PullPoint

            throw new UnableToCreatePullPointFault(error);
        }
       
        EndpointReference epr = pullPoint.getEndpointReference();
       
        PullPoint pullPointCap = (PullPoint)pullPoint.getCapability(WsnConstants.PULL_POINT_URI);
        Filter filter = pullPointCap.getFilter();
       
        //
        // create subscription that will send messages to the pullpoint
        //
        NotificationProducer wsn = (NotificationProducer)getResource().getCapability(WsnConstants.PRODUCER_URI);
        WsResource sub = null;
       
        try
        {
            sub = wsn.subscribe(epr, filter, null, null);
        }
       
        catch (BaseFault error)
        {
            throw new UnableToCreatePullPointFault(error);
        }
       
        pullPointCap.setSubscription(sub);
       
        //
        // initialize pullpoint to complete creation process
        //
        try
View Full Code Here

Examples of org.apache.servicemix.wsn.client.PullPoint

        Thread.sleep(150);
    }

    public void testUnsubscribe() throws Exception {
        // 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());

        // Wait for acks to be processed
        Thread.sleep(150);
    }
View Full Code Here

Examples of org.apache.servicemix.wsn.client.PullPoint

        // Wait for acks to be processed
        Thread.sleep(150);
    }

    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());

        // Wait for acks to be processed
        Thread.sleep(150);
    }
View Full Code Here

Examples of org.apache.servicemix.wsn.client.PullPoint

        // Wait for acks to be processed
        Thread.sleep(150);
    }

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

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

        List<NotificationMessageHolderType> msgs = pullPoint.getMessages(0);
        assertNotNull(msgs);
        assertEquals(1, msgs.size());

        // Wait for acks to be processed
        Thread.sleep(150);
View Full Code Here

Examples of org.apache.servicemix.wsn.client.PullPoint

        // Wait for acks to be processed
        Thread.sleep(150);
    }

    public void testPullWithFilter() throws Exception {
        PullPoint pullPoint1 = wsnCreatePullPoint.createPullPoint();
        PullPoint pullPoint2 = wsnCreatePullPoint.createPullPoint();
        wsnBroker.subscribe(pullPoint1.getEndpoint(), "myTopic", "@type = 'a'");
        wsnBroker.subscribe(pullPoint2.getEndpoint(), "myTopic", "@type = 'b'");

        wsnBroker.notify("myTopic", parse("<msg type='a'/>"));
        // Wait for notification
        Thread.sleep(500);

        assertEquals(1, pullPoint1.getMessages(0).size());
        assertEquals(0, pullPoint2.getMessages(0).size());

        wsnBroker.notify("myTopic", parse("<msg type='b'/>"));
        // Wait for notification
        Thread.sleep(500);

        assertEquals(0, pullPoint1.getMessages(0).size());
        assertEquals(1, pullPoint2.getMessages(0).size());

        wsnBroker.notify("myTopic", parse("<msg type='c'/>"));
        // Wait for notification
        Thread.sleep(500);

        assertEquals(0, pullPoint1.getMessages(0).size());
        assertEquals(0, pullPoint2.getMessages(0).size());
    }
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.