Package org.cometd.client.transport

Examples of org.cometd.client.transport.ClientTransport$Factory


                    }
                });
            }
            else
            {
                final ClientTransport newTransport = negotiatedTransports.get(0);
                updateBayeuxClientState(new BayeuxClientStateUpdater()
                {
                    public BayeuxClientState create(BayeuxClientState oldState)
                    {
                        if (newTransport != oldState.transport)
View Full Code Here


    {
        options.put(qualifiedName, value);
        // Forward the option to the transports.
        for (String name : transportRegistry.getKnownTransports())
        {
            ClientTransport transport = transportRegistry.getTransport(name);
            transport.setOption(qualifiedName, value);
        }
    }
View Full Code Here

                    }
                });
            }
            else
            {
                final ClientTransport newTransport = transports.get(0);
                updateBayeuxClientState(new BayeuxClientStateUpdater()
                {
                    @Override
                    public BayeuxClientState create(BayeuxClientState oldState)
                    {
                        if (newTransport != oldState.transport)
                            prepareTransport(oldState.transport, newTransport);
                        onTransportFailure(oldState.transport.getName(), newTransport.getName(), failure);
                        return new RehandshakingState(oldState.handshakeFields, oldState.callback, newTransport, oldState.nextBackoff());
                    }
                });
            }
            super.onFailure(failure, messages);
View Full Code Here

  public void init() throws Exception {
    // Prepare the HTTP transport
    HttpClient httpClient = new HttpClient();
    httpClient.start();
    ClientTransport  httpTransport = new LongPollingTransport(null, httpClient);

    // Configure the BayeuxClient, with the websocket transport listed before the http transport
    BayeuxClient client = new BayeuxClient("http://localhost:8080/cometd", httpTransport);

    // Handshake
View Full Code Here

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

        final Map<String, Object> options = new HashMap<String, Object>();
        final ClientTransport transport = LongPollingTransport.create(options, httpClient);

        final BayeuxClient client = new BayeuxClient("http://localhost:8090/ajax/cometd", transport);

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

TOP

Related Classes of org.cometd.client.transport.ClientTransport$Factory

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.