Package org.apache.http.impl.conn

Examples of org.apache.http.impl.conn.ProxySelectorRoutePlanner


    System.setProperty("http.proxyPort", "8888");

    //          HttpHost proxy = new HttpHost("localhost", 8080);
    //          result.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);

    ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
        result.getConnectionManager().getSchemeRegistry(),
        ProxySelector.getDefault());
    result.setRoutePlanner(routePlanner);

    return result;
View Full Code Here


    client.removeRequestInterceptorByClass(RequestAddCookies.class);
    client.removeResponseInterceptorByClass(ResponseProcessCookies.class);

    // Use Java's built-in proxy logic in case no proxy set via guice.
    if (Strings.isNullOrEmpty(basicHttpFetcherProxy)) {
      ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
          client.getConnectionManager().getSchemeRegistry(),
          ProxySelector.getDefault());
      client.setRoutePlanner(routePlanner);
    }
View Full Code Here

        case MANUAL:
            HttpHost proxy = new HttpHost(componentConfig.getProxyHost(), componentConfig.getProxyPort());
            httpParams.setParameter(ConnRoutePNames.DEFAULT_PROXY, proxy);
            break;
        case SYS_PROPS:
            ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(client.getConnectionManager()
                .getSchemeRegistry(), ProxySelector.getDefault());
            client.setRoutePlanner(routePlanner);
            break;
        default:
        }
View Full Code Here

      }
    });
    client.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler() );

    // Use Java's built-in proxy logic
    ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
            client.getConnectionManager().getSchemeRegistry(),
            ProxySelector.getDefault());
    client.setRoutePlanner(routePlanner);

    FETCHER = client;
View Full Code Here

    client.removeRequestInterceptorByClass(RequestAddCookies.class);
    client.removeResponseInterceptorByClass(ResponseProcessCookies.class);

    // Use Java's built-in proxy logic in case no proxy set via guice.
    if (Strings.isNullOrEmpty(basicHttpFetcherProxy)) {
      ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
          client.getConnectionManager().getSchemeRegistry(),
          ProxySelector.getDefault());
      client.setRoutePlanner(routePlanner);
    }
View Full Code Here

    client.removeRequestInterceptorByClass(RequestAddCookies.class);
    client.removeResponseInterceptorByClass(ResponseProcessCookies.class);

    // Use Java's built-in proxy logic in case no proxy set via guice.
    if (Strings.isNullOrEmpty(basicHttpFetcherProxy)) {
      ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
          client.getConnectionManager().getSchemeRegistry(),
          ProxySelector.getDefault());
      client.setRoutePlanner(routePlanner);
    }
View Full Code Here

   * @param selector     Proxy configuration
   * @return ProxySelectorRoutePlanner configured with schemeRegistry and selector
   */
  protected HttpRoutePlanner createDefaultRoutePlanner(SchemeRegistry schemeRegistry, ProxySelector selector)
  {
    return new ProxySelectorRoutePlanner(schemeRegistry, selector);
  }
View Full Code Here

        return connmgr;
    }

    @Override
    protected HttpRoutePlanner createHttpRoutePlanner() {
        return new ProxySelectorRoutePlanner(getConnectionManager().getSchemeRegistry(),
                ProxySelector.getDefault());
    }
View Full Code Here

   @Provides
   @Singleton
   HttpClient newDefaultHttpClient(ProxyConfig config, BasicHttpParams params, ClientConnectionManager cm) {
      DefaultHttpClient client = new DefaultHttpClient(cm, params);
      if (config.useSystem()) {
         ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(client.getConnectionManager()
                  .getSchemeRegistry(), ProxySelector.getDefault());
         client.setRoutePlanner(routePlanner);
      }
      return client;
   }
View Full Code Here

        return connmgr;
    }

    @Override
    protected HttpRoutePlanner createHttpRoutePlanner() {
        return new ProxySelectorRoutePlanner(getConnectionManager().getSchemeRegistry(),
                ProxySelector.getDefault());
    }
View Full Code Here

TOP

Related Classes of org.apache.http.impl.conn.ProxySelectorRoutePlanner

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.