Package org.eclipse.jetty.io

Examples of org.eclipse.jetty.io.ClientConnectionFactory


        this.requestNotifier = new RequestNotifier(client);
        this.responseNotifier = new ResponseNotifier();

        ProxyConfiguration proxyConfig = client.getProxyConfiguration();
        proxy = proxyConfig.match(origin);
        ClientConnectionFactory connectionFactory = client.getTransport();
        if (proxy != null)
        {
            connectionFactory = proxy.newClientConnectionFactory(connectionFactory);
        }
        else
View Full Code Here


        {
            try
            {
                HttpDestination destination = (HttpDestination)context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);
                HttpClient client = destination.getHttpClient();
                ClientConnectionFactory connectionFactory = this.connectionFactory;
                if (HttpScheme.HTTPS.is(destination.getScheme()))
                    connectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
                org.eclipse.jetty.io.Connection connection = connectionFactory.newConnection(getEndPoint(), context);
                ClientConnectionFactory.Helper.replaceConnection(this, connection);
                if (LOG.isDebugEnabled())
                    LOG.debug("SOCKS4 tunnel established: {} over {}", this, connection);
            }
            catch (Throwable x)
View Full Code Here

                {
                    // Replace the promise back with the original
                    context.put(HttpClientTransport.HTTP_CONNECTION_PROMISE_CONTEXT_KEY, promise);
                    HttpDestination destination = (HttpDestination)context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);
                    HttpClient client = destination.getHttpClient();
                    ClientConnectionFactory sslConnectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
                    HttpConnectionOverHTTP oldConnection = (HttpConnectionOverHTTP)endPoint.getConnection();
                    org.eclipse.jetty.io.Connection newConnection = sslConnectionFactory.newConnection(endPoint, context);
                    Helper.replaceConnection(oldConnection, newConnection);
                    // Avoid setting fill interest in the old Connection,
                    // without closing the underlying EndPoint.
                    oldConnection.softClose();
                    if (LOG.isDebugEnabled())
View Full Code Here

            Map<String, Object> context = (Map<String, Object>)attachment;
            context.put(HTTP2ClientConnectionFactory.BYTE_BUFFER_POOL_CONTEXT_KEY, byteBufferPool);
            context.put(HTTP2ClientConnectionFactory.EXECUTOR_CONTEXT_KEY, getExecutor());
            context.put(HTTP2ClientConnectionFactory.SCHEDULER_CONTEXT_KEY, getScheduler());

            ClientConnectionFactory factory = new HTTP2ClientConnectionFactory();

            SslContextFactory sslContextFactory = (SslContextFactory)context.get(SslClientConnectionFactory.SSL_CONTEXT_FACTORY_CONTEXT_KEY);
            if (sslContextFactory != null)
            {
                ALPNClientConnectionFactory alpn = new ALPNClientConnectionFactory(getExecutor(), factory, "h2-14");
                factory = new SslClientConnectionFactory(sslContextFactory, byteBufferPool, getExecutor(), alpn);
            }

            return factory.newConnection(endpoint, context);
        }
View Full Code Here

        public SPDYClient newSPDYClient(short version, NegotiatingClientConnectionFactory negotiatingFactory)
        {
            SPDYClient client = new SPDYClient(version, this);

            ClientConnectionFactory connectionFactory = negotiatingFactory.getClientConnectionFactory();
            if (sslContextFactory != null)
                connectionFactory = new SslClientConnectionFactory(getSslContextFactory(), getByteBufferPool(), getExecutor(), negotiatingFactory);

            client.setClientConnectionFactory(connectionFactory);
            return client;
View Full Code Here

    public HttpClientTransportOverSPDY(SPDYClient client)
    {
        this.client = client;
        this.connectionFactory = client.getClientConnectionFactory();
        client.setClientConnectionFactory(new ClientConnectionFactory()
        {
            @Override
            public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException
            {
                HttpDestination destination = (HttpDestination)context.get(HTTP_DESTINATION_CONTEXT_KEY);
View Full Code Here

                {
                    // Replace the promise back with the original
                    context.put(HttpClientTransport.HTTP_CONNECTION_PROMISE_CONTEXT_KEY, promise);
                    HttpDestination destination = (HttpDestination)context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);
                    HttpClient client = destination.getHttpClient();
                    ClientConnectionFactory sslConnectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
                    HttpConnectionOverHTTP oldConnection = (HttpConnectionOverHTTP)endPoint.getConnection();
                    org.eclipse.jetty.io.Connection newConnection = sslConnectionFactory.newConnection(endPoint, context);
                    Helper.replaceConnection(oldConnection, newConnection);
                    // Avoid setting fill interest in the old Connection,
                    // without closing the underlying EndPoint.
                    oldConnection.softClose();
                    LOG.debug("HTTP tunnel established: {} over {}", oldConnection, newConnection);
View Full Code Here

        this.requestNotifier = new RequestNotifier(client);
        this.responseNotifier = new ResponseNotifier(client);

        ProxyConfiguration proxyConfig = client.getProxyConfiguration();
        proxy = proxyConfig.match(origin);
        ClientConnectionFactory connectionFactory = client.getTransport();
        if (proxy != null)
        {
            connectionFactory = proxy.newClientConnectionFactory(connectionFactory);
        }
        else
View Full Code Here

        {
            try
            {
                HttpDestination destination = (HttpDestination)context.get(HttpClientTransport.HTTP_DESTINATION_CONTEXT_KEY);
                HttpClient client = destination.getHttpClient();
                ClientConnectionFactory connectionFactory = this.connectionFactory;
                if (HttpScheme.HTTPS.is(destination.getScheme()))
                    connectionFactory = new SslClientConnectionFactory(client.getSslContextFactory(), client.getByteBufferPool(), client.getExecutor(), connectionFactory);
                org.eclipse.jetty.io.Connection connection = connectionFactory.newConnection(getEndPoint(), context);
                ClientConnectionFactory.Helper.replaceConnection(this, connection);
                LOG.debug("SOCKS4 tunnel established: {} over {}", this, connection);
            }
            catch (Throwable x)
            {
View Full Code Here

TOP

Related Classes of org.eclipse.jetty.io.ClientConnectionFactory

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.