Package org.eclipse.jetty.websocket

Examples of org.eclipse.jetty.websocket.WebSocketClientFactory


  private final WebSocketClientFactory factory;


  public JettyMtgoxClient(Broadcaster broadcaster) {
    super(broadcaster);
    this.factory = new WebSocketClientFactory();
  }
View Full Code Here


        {
            _threadPool = new QueuedThreadPool();
        }
        if(context != null)
        {
            WebSocketClientFactory factory = new WebSocketClientFactory(_threadPool);
            SslContextFactory sslContextFactory = factory.getSslContextFactory();


            sslContextFactory.setSslContext(context);

            factory.start();

            return factory;
        }
        else
        {
            if(_factory == null)
            {
                _factory = new WebSocketClientFactory(_threadPool);
                _factory.start();
            }
            _connections++;
            return _factory;
        }
View Full Code Here

                        final SSLContext sslContext, final ExceptionHandler exceptionHandler) throws ConnectionException
    {

        try
        {
            final WebSocketClientFactory webSocketClientFactory = getWebSocketClientFactory(sslContext);
            WebSocketClient client = webSocketClientFactory.newWebSocketClient();
            // Configure the client
            client.setProtocol(AMQP_WEBSOCKET_SUBPROTOCOL);


            ConnectionHandler.FrameOutput<FrameBody> out = new ConnectionHandler.FrameOutput<FrameBody>(conn);
View Full Code Here

        {
            _threadPool = new QueuedThreadPool();
        }
        if(context != null)
        {
            WebSocketClientFactory factory = new WebSocketClientFactory(_threadPool);
            SslContextFactory sslContextFactory = factory.getSslContextFactory();


            sslContextFactory.setSslContext(context);

            factory.start();

            return factory;
        }
        else
        {
            if(_factory == null)
            {
                _factory = new WebSocketClientFactory(_threadPool);
                _factory.start();
            }
            _connections++;
            return _factory;
        }
View Full Code Here

                        final SSLContext sslContext, final ExceptionHandler exceptionHandler) throws ConnectionException
    {

        try
        {
            final WebSocketClientFactory webSocketClientFactory = getWebSocketClientFactory(sslContext);
            WebSocketClient client = webSocketClientFactory.newWebSocketClient();
            // Configure the client
            client.setProtocol(AMQP_WEBSOCKET_SUBPROTOCOL);


            ConnectionHandler.FrameOutput<FrameBody> out = new ConnectionHandler.FrameOutput<FrameBody>(conn);
View Full Code Here

    }

    public void startWebsocket() throws Exception {
        if (ui == null) throw new IllegalAccessError("start() must be called before");

        final WebSocketClientFactory factory = new WebSocketClientFactory();
        factory.start();

        final String sessionID = jsessionID.split("=")[1];

        websocketClient = factory.newWebSocketClient();
        websocketClient.getCookies().put("JSESSIONID", sessionID);
        websocketClient.setMaxTextMessageSize(Integer.MAX_VALUE);
        websocketClient.setMaxBinaryMessageSize(Integer.MAX_VALUE);

        final URI uri = new URI(url.replaceFirst("http", "ws") + "/ws" + "?" + APPLICATION.VIEW_ID + "=" + ui.viewID);
View Full Code Here

    public String getProtocol() {
        return "CNWS";
    }
    @Override
    protected CNWSPeerImpl createPeerImpl(CNPeer peer,Object... args) throws Exception {
        factory = new WebSocketClientFactory();
        factory.start();

        String id = peer.getID();
        String internalID = CNUtil.getInternalIDFromID(id);
        CNWSPeerImpl peerImpl = new CNWSPeerImpl(internalID,peer,this);
View Full Code Here

        {
            _threadPool = new QueuedThreadPool();
        }
        if(context != null)
        {
            WebSocketClientFactory factory = new WebSocketClientFactory(_threadPool);
            SslContextFactory sslContextFactory = factory.getSslContextFactory();


            sslContextFactory.setSslContext(context);
            sslContextFactory.addExcludeProtocols(SSLUtil.SSLV3_PROTOCOL);
            factory.start();

            return factory;
        }
        else
        {
            if(_factory == null)
            {
                _factory = new WebSocketClientFactory(_threadPool);
                _factory.start();
            }
            _connections++;
            return _factory;
        }
View Full Code Here

                        final SSLContext sslContext, final ExceptionHandler exceptionHandler) throws ConnectionException
    {

        try
        {
            final WebSocketClientFactory webSocketClientFactory = getWebSocketClientFactory(sslContext);
            WebSocketClient client = webSocketClientFactory.newWebSocketClient();
            // Configure the client
            client.setProtocol(AMQP_WEBSOCKET_SUBPROTOCOL);


            ConnectionHandler.FrameOutput<FrameBody> out = new ConnectionHandler.FrameOutput<FrameBody>(conn);
View Full Code Here

    return bayeuxClient;
  }

  private static WebSocketTransport createWebSocketTransport() {
    HashMap<String, Object> webSocketOptions = new HashMap<>()
    WebSocketClientFactory webSocketClientFactory = new WebSocketClientFactory();
    try {
      webSocketClientFactory.start();
    } catch (Exception e) {
      // Can't happen as WebSocketClientFactory.start() doesn't throw exceptions.
      throw new AssertionError(e);
    }
    ScheduledExecutorService scheduler = null;
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.websocket.WebSocketClientFactory

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.