switched ManagedClientConnection interface to HttpRoute

git-svn-id: https://svn.apache.org/repos/asf/jakarta/httpcomponents/httpclient/trunk@505682 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Roland Weber 2007-02-10 12:20:45 +00:00
parent b8e6a0558a
commit d41a365bf5
5 changed files with 13 additions and 24 deletions

View File

@ -112,7 +112,7 @@ public final static void main(String[] args)
ManagedClientConnection conn = clcm.getConnection(route);
try {
System.out.println("opening connection");
conn.open(route.toHostConfig(), ctx, getParams());
conn.open(route, ctx, getParams());
System.out.println("sending request");
conn.sendRequestHeader(req);

View File

@ -118,7 +118,7 @@ public final static void main(String[] args)
ManagedClientConnection conn = clcm.getConnection(route);
try {
System.out.println("opening connection");
conn.open(route.toHostConfig(), ctx, getParams());
conn.open(route, ctx, getParams());
HttpRequest connect = createConnect(target);
System.out.println("opening tunnel to " + target);

View File

@ -47,7 +47,7 @@
*
*
* <!-- empty lines to avoid svn diff problems -->
* @version $Revision$ $Date$
* @version $Revision$
*
* @since 4.0
*/
@ -87,7 +87,7 @@ HttpRoute getRoute()
*
* @throws IOException in case of a problem
*/
void open(HostConfiguration route, HttpContext context, HttpParams params)
void open(HttpRoute route, HttpContext context, HttpParams params)
throws IOException
;

View File

@ -229,7 +229,7 @@ protected void establishRoute(HttpRoute route, HttpContext context)
case RouteDirector.CONNECT_TARGET:
case RouteDirector.CONNECT_PROXY:
managedConn.open(route.toHostConfig(), context, defaultParams);
managedConn.open(route, context, defaultParams);
break;
case RouteDirector.CREATE_TUNNEL:

View File

@ -1125,13 +1125,13 @@ private TrackingPoolEntry(OperatedClientConnection occ) {
*
* @throws IOException in case of a problem
*/
private void open(HostConfiguration route,
private void open(HttpRoute route,
HttpContext context, HttpParams params)
throws IOException {
if (route == null) {
throw new IllegalArgumentException
("HostConfiguration must not be null.");
("Route must not be null.");
}
//@@@ is context allowed to be null? depends on operator?
if (params == null) {
@ -1148,30 +1148,19 @@ private void open(HostConfiguration route,
// In this order, we can be sure that only a successful
// opening of the connection will be tracked.
final HttpHost target = route.getHost();
if (target == null) {
throw new IllegalStateException
("Target host must not be null.");
}
final HttpHost proxy = route.getProxyHost();
//@@@ verify route against planned route?
//@@@ verify against planned route?
if (LOG.isDebugEnabled()) {
if (proxy == null) {
LOG.debug("Open connection to " + target);
} else {
LOG.debug("Open connection to " + target +
" via proxy " + proxy);
}
LOG.debug("Open connection for " + route);
}
this.tracker = new RouteTracker
(route.getHost(), route.getLocalAddress());
this.tracker = new RouteTracker(route);
final HttpHost proxy = route.getProxyHost();
ThreadSafeClientConnManager.this.connectionOperator.openConnection
(this.connection,
(proxy != null) ? proxy : target,
(proxy != null) ? proxy : route.getTargetHost(),
context, params);
if (proxy == null)
@ -1343,7 +1332,7 @@ public HttpRoute getRoute() {
}
// non-javadoc, see interface ManagedHttpConnection
public void open(HostConfiguration route,
public void open(HttpRoute route,
HttpContext context, HttpParams params)
throws IOException {