Package org.cometd.client.transport

Examples of org.cometd.client.transport.LongPollingTransport


    {
        final String channelName = "/service/test";
        final AtomicReference<CountDownLatch> connectLatch = new AtomicReference<>(new CountDownLatch(1));
        final CountDownLatch publishLatch = new CountDownLatch(1);
        final CountDownLatch failureLatch = new CountDownLatch(1);
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected AbstractSessionChannel newChannel(ChannelId channelId)
            {
                return new BayeuxClientChannel(channelId)
View Full Code Here


    {
        final String channelName = "/test";
        final AtomicBoolean abort = new AtomicBoolean(false);
        final AtomicReference<CountDownLatch> connectLatch = new AtomicReference<>(new CountDownLatch(1));
        final AtomicReference<CountDownLatch> publishLatch = new AtomicReference<>(new CountDownLatch(1));
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected boolean sendMessages(List<Message.Mutable> messages)
            {
                abort();
View Full Code Here

    {
        final BlockingArrayQueue<Object> results = new BlockingArrayQueue<>();

        final AtomicBoolean failHandShake = new AtomicBoolean(true);

        LongPollingTransport transport = new LongPollingTransport(null, httpClient)
        {
            @Override
            protected void customize(Request request)
            {
                if (failHandShake.compareAndSet(true, false))
View Full Code Here

    @Test
    public void testCustomTransportURL() throws Exception
    {
        startServer(null);

        LongPollingTransport transport = new LongPollingTransport(cometdURL, null, httpClient);
        // Pass a bogus URL that must not be used
        BayeuxClient client = new BayeuxClient("http://foo/bar", transport);

        client.handshake();
        Assert.assertTrue(client.waitFor(5000, State.CONNECTED));
View Full Code Here

        startServer(null);

        Map<String, Object> options = new HashMap<>();
        int maxBufferSize = 1024;
        options.put(LongPollingTransport.MAX_BUFFER_SIZE_OPTION, maxBufferSize);
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(options, httpClient));

        final CountDownLatch metaConnectLatch = new CountDownLatch(1);
        client.getChannel(Channel.META_CONNECT).addListener(new ClientSessionChannel.MessageListener()
        {
            @Override
View Full Code Here

        startServer(null);

        Map<String, Object> options = new HashMap<>();
        int maxBufferSize = 1024;
        options.put(LongPollingTransport.MAX_BUFFER_SIZE_OPTION, maxBufferSize);
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(options, httpClient));

        client.handshake();
        Assert.assertTrue(client.waitFor(5000, State.CONNECTED));

        String channelName = "/max_message_size";
View Full Code Here

    protected BayeuxClient startClient(Oort oort, Map<String, Object> handshakeFields) throws Exception
    {
        HttpClient httpClient = new HttpClient();
        httpClient.start();
        BayeuxClient client = new BayeuxClient(oort.getURL(), new LongPollingTransport(null, httpClient));
        client.setAttribute(HttpClient.class.getName(), httpClient);
        client.handshake(handshakeFields);
        clients.add(client);
        return client;
    }
View Full Code Here

                Assert.assertEquals(content, extra.content);
                latch.countDown();
            }
        });

        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(clientOptions, httpClient));
        client.addExtension(new ExtraExtension(content));

        client.handshake();
        Assert.assertTrue(client.waitFor(5000, BayeuxClient.State.CONNECTED));
        // Wait for the connect to establish
View Full Code Here

        serverOptions.put(AbstractServerTransport.JSON_CONTEXT_OPTION, jacksonContextServerClassName);
        startServer(serverOptions);

        Map<String, Object> clientOptions = new HashMap<>();
        clientOptions.put(ClientTransport.JSON_CONTEXT_OPTION, jacksonContextClientClassName);
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(clientOptions, httpClient));

        testClient(client);
    }
View Full Code Here

        httpClient = new HttpClient(sslContextFactory);
        httpClient.getProxyConfiguration().getProxies().add(new HttpProxy("localhost", proxyConnector.getLocalPort()));
        httpClient.start();

        String url = "https://localhost:" + sslConnector.getLocalPort() + cometdServletPath;
        BayeuxClient client = new BayeuxClient(url, new LongPollingTransport(null, httpClient));
        testClient(client);
    }
View Full Code Here

TOP

Related Classes of org.cometd.client.transport.LongPollingTransport

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.