Package org.apache.http.impl.conn

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


        return connmgr;
    }

    @Override
    protected HttpRoutePlanner createHttpRoutePlanner() {
        return new ProxySelectorRoutePlanner(getConnectionManager().getSchemeRegistry(),
                ProxySelector.getDefault());
    }
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

   @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

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

    // Use Java's built-in proxy logic in case no proxy set via guice.
    if (StringUtils.isEmpty(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 (StringUtils.isEmpty(basicHttpFetcherProxy)) {
      ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
          client.getConnectionManager().getSchemeRegistry(),
          ProxySelector.getDefault());
      client.setRoutePlanner(routePlanner);
    }
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

            // do not use Apache's retry handler
            httpClient.setHttpRequestRetryHandler(new DefaultHttpRequestRetryHandler(0, false));

            // use a RoutePlanner/ProxySelector that fits our requirements
            SchemeRegistry registry = httpClient.getConnectionManager().getSchemeRegistry();
            httpClient.setRoutePlanner(new ProxySelectorRoutePlanner(registry, proxySelector));

            JerseyUtil.addFilters(client, config);

            return client;
        } catch (Exception e) {
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 (StringUtils.isEmpty(basicHttpFetcherProxy)) {
      ProxySelectorRoutePlanner routePlanner = new ProxySelectorRoutePlanner(
          client.getConnectionManager().getSchemeRegistry(),
          ProxySelector.getDefault());
      client.setRoutePlanner(routePlanner);
    }
View Full Code Here

    this.httpClient = new DefaultHttpClient();

    // this means you can set a proxy through
    // java.net.ProxySelector.setDefault(), or by simply starting the
    // jvm with -Dhttp.proxyHost=foo.com -Dhttp.proxyPort=8080
    httpClient.setRoutePlanner(new ProxySelectorRoutePlanner(
        httpClient.getConnectionManager().getSchemeRegistry(),
        null));
  }
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.