Package org.cometd.client

Examples of org.cometd.client.BayeuxClient.addExtension()


    {
        bayeux.addExtension(new AcknowledgedMessagesExtension());

        final String channelName = "/service/test";
        BayeuxClient client = newBayeuxClient();
        client.addExtension(new AckExtension());

        final CountDownLatch latch = new CountDownLatch(1);
        client.getChannel(channelName).addListener(new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
View Full Code Here


        bayeux.addExtension(new AcknowledgedMessagesExtension());

        final BayeuxClient client = newBayeuxClient();
        final String channelName = "/test";
        final AtomicReference<CountDownLatch> rcv = new AtomicReference<CountDownLatch>(new CountDownLatch(1));
        client.addExtension(new AckExtension());
        client.addExtension(new ClientSession.Extension.Adapter()
        {
            @Override
            public boolean rcv(ClientSession session, Message.Mutable message)
            {
View Full Code Here

        final BayeuxClient client = newBayeuxClient();
        final String channelName = "/test";
        final AtomicReference<CountDownLatch> rcv = new AtomicReference<CountDownLatch>(new CountDownLatch(1));
        client.addExtension(new AckExtension());
        client.addExtension(new ClientSession.Extension.Adapter()
        {
            @Override
            public boolean rcv(ClientSession session, Message.Mutable message)
            {
                if (channelName.equals(message.getChannel()))
View Full Code Here

    public void testWebSocketWithAckExtension() throws Exception
    {
        final BayeuxClient client = newBayeuxClient();

        bayeux.addExtension(new AcknowledgedMessagesExtension());
        client.addExtension(new AckExtension());

        final String channelName = "/chat/demo";
        final BlockingQueue<Message> messages = new BlockingArrayQueue<>();
        client.getChannel(Channel.META_HANDSHAKE).addListener(new ClientSessionChannel.MessageListener()
        {
View Full Code Here

                return true;
            }
        });

        final BayeuxClient client = newBayeuxClient();
        client.addExtension(new AckExtension());
        client.setOption(ClientTransport.MAX_NETWORK_DELAY_OPTION, maxNetworkDelay);
        client.setOption(BayeuxClient.BACKOFF_INCREMENT_OPTION, 0);

        final CountDownLatch messageLatch1 = new CountDownLatch(1);
        final CountDownLatch messageLatch2 = new CountDownLatch(1);
View Full Code Here

    public void testAck() throws Exception
    {
        final BayeuxClient client = newBayeuxClient();

        bayeux.addExtension(new AcknowledgedMessagesExtension());
        client.addExtension(new AckExtension());

        final String channelName = "/chat/demo";
        final BlockingQueue<Message> messages = new BlockingArrayQueue<>();
        client.getChannel(Channel.META_HANDSHAKE).addListener(new ClientSessionChannel.MessageListener()
        {
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.