Package org.cometd.websocket.client

Examples of org.cometd.websocket.client.WebSocketTransport$Configurator


    private ClientTransport newWebSocketTransport()
    {
        switch (wsTransportClass)
        {
            case JSR_WS_TRANSPORT:
                return new WebSocketTransport(null, null, wsClientContainer);
            case JETTY_WS_TRANSPORT:
                return new JettyWebSocketTransport(null, null, wsClient);
            default:
                throw new AssertionError();
        }
View Full Code Here


                options.put(ClientTransport.JSON_CONTEXT_OPTION, new Jackson1JSONContextClient());
                options.put(ClientTransport.MAX_NETWORK_DELAY_OPTION, Config.MAX_NETWORK_DELAY);
                // Differently from HTTP where the idle timeout is adjusted if it is a /meta/connect
                // for WebSocket we need an idle timeout that is longer than the /meta/connect timeout.
                options.put(WebSocketTransport.IDLE_TIMEOUT_OPTION, Config.META_CONNECT_TIMEOUT + httpClient.getIdleTimeout());
                return new WebSocketTransport(options, scheduler, webSocketContainer);
            }
            case JETTY_WEBSOCKET:
            {
                Map<String, Object> options = new HashMap<>();
                options.put(ClientTransport.JSON_CONTEXT_OPTION, new Jackson1JSONContextClient());
View Full Code Here

    // Transports are set the cookieProvider *after* creating the bayeuxClient, because
    // BayeuxClient invariably sets its own cookieProvider inside the constructor.
    BayeuxClient bayeuxClient;   
    if (builder.webSocketEnabled) {
      WebSocketTransport webSocketTransport = createWebSocketTransport();
      bayeuxClient = new BayeuxClient(builder.client.serverUri + "/api/v2/notifications", webSocketTransport, longPollingTransport);
      webSocketTransport.setCookieProvider(builder.cookieSession.getCookieProvider());
    } else {
      bayeuxClient = new BayeuxClient(builder.client.serverUri + "/api/v2/notifications", longPollingTransport);
    }
    longPollingTransport.setCookieProvider(builder.cookieSession.getCookieProvider());
   
View Full Code Here

    } catch (Exception e) {
      // Can't happen as WebSocketClientFactory.start() doesn't throw exceptions.
      throw new AssertionError(e);
    }
    ScheduledExecutorService scheduler = null;
    WebSocketTransport webSocketTransport = new WebSocketTransport(webSocketOptions, webSocketClientFactory, scheduler);
    return webSocketTransport;
  }
View Full Code Here

TOP

Related Classes of org.cometd.websocket.client.WebSocketTransport$Configurator

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.