Package org.cometd.client.transport

Examples of org.cometd.client.transport.LongPollingTransport


        }

        HttpClient httpClient = new HttpClient();
        httpClient.start();

        client = new BayeuxClient(url, new LongPollingTransport(null, httpClient));
        client.getChannel(Channel.META_HANDSHAKE).addListener(new InitializerListener());
        client.getChannel(Channel.META_CONNECT).addListener(new ConnectionListener());

        client.handshake();
        boolean success = client.waitFor(1000, BayeuxClient.State.CONNECTED);
View Full Code Here


    }

    @Before
    public void init()
    {
        bayeuxClient = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient));
        processor = new ClientAnnotationProcessor(bayeuxClient);
    }
View Full Code Here

    @Test
    public void testHandshakeFailsConcurrentDisconnect() throws Exception
    {
        final CountDownLatch latch = new CountDownLatch(1);
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected boolean sendHandshake()
            {
                disconnect();
View Full Code Here

    @Test
    public void testConnectFailsConcurrentDisconnect() throws Exception
    {
        final CountDownLatch latch = new CountDownLatch(1);
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected boolean sendConnect()
            {
                disconnect();
View Full Code Here

    }

    @Test
    public void testSubscribeFailsConcurrentDisconnect() throws Exception
    {
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected void enqueueSend(Message.Mutable message)
            {
                disconnect();
View Full Code Here

    @Test
    public void testPublishFailsConcurrentDisconnect() throws Exception
    {
        final String channelName = "/test";
        BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected void enqueueSend(Message.Mutable message)
            {
                if (channelName.equals(message.getChannel()))
View Full Code Here

    @Test
    public void testPublishFailsConcurrentNetworkDown() throws Exception
    {
        final String channelName = "/test";
        final AtomicInteger connects = new AtomicInteger();
        final BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected boolean sendConnect()
            {
                try
View Full Code Here

    }

    @Test
    public void testHandshakeListenersAreNotifiedBeforeConnectListeners() throws Exception
    {
        final BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient));
        final int sleep = 1000;
        final AtomicBoolean handshaken = new AtomicBoolean();
        client.getChannel(Channel.META_HANDSHAKE).addListener(new ClientSessionChannel.MessageListener()
        {
            public void onMessage(ClientSessionChannel channel, Message message)
View Full Code Here

    @Test
    public void testConcurrentHandshakeAndBatch() throws Exception
    {
        final CountDownLatch sendLatch = new CountDownLatch(1);
        final BayeuxClient client = new BayeuxClient(cometdURL, new LongPollingTransport(null, httpClient))
        {
            @Override
            protected boolean sendMessages(List<Message.Mutable> messages)
            {
                sendLatch.countDown();
View Full Code Here

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

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

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

        // Wait for the long poll
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.