Made RoutedRequest a simple class

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@645846 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2008-04-08 10:53:39 +00:00
parent f2ef6c15a6
commit 21705fdb9c
2 changed files with 20 additions and 46 deletions

View File

@ -264,7 +264,7 @@ public class DefaultClientRequestDirector
origWrapper.setParams(params);
HttpRoute origRoute = determineRoute(target, origWrapper, context);
RoutedRequest roureq = new RoutedRequest.Impl(origWrapper, origRoute);
RoutedRequest roureq = new RoutedRequest(origWrapper, origRoute);
long timeout = HttpClientParams.getConnectionManagerTimeout(params);
@ -822,7 +822,7 @@ public class DefaultClientRequestDirector
wrapper.setParams(params);
HttpRoute newRoute = determineRoute(newTarget, wrapper, context);
RoutedRequest newRequest = new RoutedRequest.Impl(wrapper, newRoute);
RoutedRequest newRequest = new RoutedRequest(wrapper, newRoute);
if (LOG.isDebugEnabled()) {
LOG.debug("Redirecting to '" + uri + "' via " + newRoute);

View File

@ -45,55 +45,29 @@ import org.apache.http.conn.routing.HttpRoute;
*
* @since 4.0
*/
public interface RoutedRequest {
public class RoutedRequest {
protected final RequestWrapper request;
protected final HttpRoute route;
/**
* Obtains the request.
* Creates a new routed request.
*
* @return the request
* @param req the request
* @param route the route
*/
RequestWrapper getRequest()
;
public RoutedRequest(final RequestWrapper req, final HttpRoute route) {
super();
this.request = req;
this.route = route;
}
public final RequestWrapper getRequest() {
return request;
}
/**
* Obtains the route.
*
* @return the route
*/
HttpRoute getRoute()
;
/**
* Trivial default implementation of a routed request.
*/
public static class Impl implements RoutedRequest {
protected final RequestWrapper request;
protected final HttpRoute route;
/**
* Creates a new routed request.
*
* @param req the request
* @param rou the route
*/
public Impl(RequestWrapper req, HttpRoute rou) {
this.request = req;
this.route = rou;
}
// non-javadoc, see interface
public final RequestWrapper getRequest() {
return request;
}
// non-javadoc, see interface
public final HttpRoute getRoute() {
return route;
}
} // class Impl
public final HttpRoute getRoute() {
return route;
}
} // interface RoutedRequest