mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-17 07:26:47 +00:00
HTTPCLIENT-669: moved DefaultRoutePlanner from client to conn
git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@571808 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
63c5064f31
commit
2084e14af9
@ -162,15 +162,6 @@ public class HttpClientParams {
|
|||||||
* </p>
|
* </p>
|
||||||
*/
|
*/
|
||||||
public static final String DEFAULT_HOST = "http.default-host";
|
public static final String DEFAULT_HOST = "http.default-host";
|
||||||
|
|
||||||
/**
|
|
||||||
* Defines the default proxy. The default value will be used if the proxy
|
|
||||||
* information is not explicitly specified in the request route.
|
|
||||||
* <p>
|
|
||||||
* This parameter expects a value of type {@link org.apache.http.HttpHost}.
|
|
||||||
* </p>
|
|
||||||
*/
|
|
||||||
public static final String DEFAULT_PROXY = "http.default-proxy";
|
|
||||||
|
|
||||||
private HttpClientParams() {
|
private HttpClientParams() {
|
||||||
super();
|
super();
|
||||||
|
@ -0,0 +1,64 @@
|
|||||||
|
/*
|
||||||
|
* $HeadURL$
|
||||||
|
* $Revision$
|
||||||
|
* $Date$
|
||||||
|
*
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
* this work for additional information regarding copyright ownership.
|
||||||
|
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||||
|
* (the "License"); you may not use this file except in compliance with
|
||||||
|
* the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
* ====================================================================
|
||||||
|
*
|
||||||
|
* This software consists of voluntary contributions made by many
|
||||||
|
* individuals on behalf of the Apache Software Foundation. For more
|
||||||
|
* information on the Apache Software Foundation, please see
|
||||||
|
* <http://www.apache.org/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.apache.http.conn.params;
|
||||||
|
|
||||||
|
import org.apache.http.HttpHost;
|
||||||
|
import org.apache.http.params.HttpParams;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* An adaptor for accessing HTTP connection parameters in {@link HttpParams}.
|
||||||
|
*
|
||||||
|
* @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
|
||||||
|
*
|
||||||
|
* @version $Revision$
|
||||||
|
*
|
||||||
|
* @since 4.0
|
||||||
|
*/
|
||||||
|
public class HttpConnParams {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines the default proxy. The default value will be used
|
||||||
|
* by some {@link org.apache.http.conn.HttpRoutePlanner HttpRoutePlanner}
|
||||||
|
* implementations, in particular the default implementation.
|
||||||
|
* <p>
|
||||||
|
* This parameter expects a value of type {@link org.apache.http.HttpHost}.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
|
public static final String DEFAULT_PROXY = "http.default-proxy";
|
||||||
|
|
||||||
|
|
||||||
|
/** Disabled default constructor. */
|
||||||
|
private HttpConnParams() {
|
||||||
|
// no body
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -63,7 +63,7 @@
|
|||||||
import org.apache.http.impl.DefaultConnectionReuseStrategy;
|
import org.apache.http.impl.DefaultConnectionReuseStrategy;
|
||||||
import org.apache.http.impl.auth.BasicSchemeFactory;
|
import org.apache.http.impl.auth.BasicSchemeFactory;
|
||||||
import org.apache.http.impl.auth.DigestSchemeFactory;
|
import org.apache.http.impl.auth.DigestSchemeFactory;
|
||||||
import org.apache.http.impl.client.DefaultHttpRoutePlanner; //@@@ move to conn
|
import org.apache.http.impl.conn.DefaultHttpRoutePlanner;
|
||||||
import org.apache.http.impl.conn.SingleClientConnManager;
|
import org.apache.http.impl.conn.SingleClientConnManager;
|
||||||
import org.apache.http.impl.cookie.BrowserCompatSpecFactory;
|
import org.apache.http.impl.cookie.BrowserCompatSpecFactory;
|
||||||
import org.apache.http.impl.cookie.NetscapeDraftSpecFactory;
|
import org.apache.http.impl.cookie.NetscapeDraftSpecFactory;
|
||||||
@ -294,9 +294,9 @@ protected RoutedRequest determineRoute(HttpHost target,
|
|||||||
|
|
||||||
return new RoutedRequest.Impl(request, route);
|
return new RoutedRequest.Impl(request, route);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//non-javadoc, see base class AbstractHttpClient
|
// non-javadoc, see base class AbstractHttpClient
|
||||||
protected HttpRoutePlanner createHttpRoutePlanner() {
|
protected HttpRoutePlanner createHttpRoutePlanner() {
|
||||||
return new DefaultHttpRoutePlanner(getConnectionManager());
|
return new DefaultHttpRoutePlanner(getConnectionManager());
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.apache.http.impl.client;
|
package org.apache.http.impl.conn;
|
||||||
|
|
||||||
import org.apache.http.HttpException;
|
import org.apache.http.HttpException;
|
||||||
import org.apache.http.HttpHost;
|
import org.apache.http.HttpHost;
|
||||||
@ -41,8 +41,7 @@
|
|||||||
import org.apache.http.conn.HttpRoutePlanner;
|
import org.apache.http.conn.HttpRoutePlanner;
|
||||||
import org.apache.http.conn.Scheme;
|
import org.apache.http.conn.Scheme;
|
||||||
|
|
||||||
//@@@ move this class to conn when this dependency is gone:
|
import org.apache.http.conn.params.HttpConnParams;
|
||||||
import org.apache.http.client.params.HttpClientParams; //@@@
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -83,7 +82,7 @@ public HttpRoute determineRoute(HttpHost target,
|
|||||||
}
|
}
|
||||||
|
|
||||||
HttpHost proxy = (HttpHost)
|
HttpHost proxy = (HttpHost)
|
||||||
request.getParams().getParameter(HttpClientParams.DEFAULT_PROXY);
|
request.getParams().getParameter(HttpConnParams.DEFAULT_PROXY);
|
||||||
|
|
||||||
Scheme schm = this.connectionManager.getSchemeRegistry().
|
Scheme schm = this.connectionManager.getSchemeRegistry().
|
||||||
getScheme(target.getSchemeName());
|
getScheme(target.getSchemeName());
|
Loading…
x
Reference in New Issue
Block a user