hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r558119 - in /jakarta/httpcomponents/httpclient/trunk/module-client/src: main/java/org/apache/http/client/protocol/ main/java/org/apache/http/impl/client/ test/java/org/apache/http/impl/conn/ test/java/org/apache/http/localserver/
Date Fri, 20 Jul 2007 20:21:24 GMT
Author: rolandw
Date: Fri Jul 20 13:21:22 2007
New Revision: 558119

URL: http://svn.apache.org/viewvc?view=rev&rev=558119
Log:
adapted to HTTPCORE-100

Added:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ClientContext.java
      - copied, changed from r558089, jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/HttpClientContext.java
Removed:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/HttpClientContext.java
Modified:
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ExecReqThread.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/Helper.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestLocalServer.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/LocalTestServer.java
    jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/ServerTestBase.java

Copied: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ClientContext.java
(from r558089, jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/HttpClientContext.java)
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ClientContext.java?view=diff&rev=558119&p1=jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/HttpClientContext.java&r1=558089&p2=jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ClientContext.java&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/HttpClientContext.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ClientContext.java
Fri Jul 20 13:21:22 2007
@@ -31,10 +31,12 @@
 
 package org.apache.http.client.protocol;
 
-import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
 
-public class HttpClientContext extends HttpExecutionContext {
+/**
+ * {@link org.apache.http.protocol.HttpContext Context}
+ * attribute names for client.
+ */
+public interface ClientContext {
     
     public static final String COOKIESPEC_REGISTRY   = "http.cookiespec-registry"; 
     public static final String AUTHSCHEME_REGISTRY   = "http.authscheme-registry"; 
@@ -43,9 +45,4 @@
     public static final String COOKIE_ORIGIN         = "http.cookie-origin"; 
     public static final String TARGET_AUTH_STATE     = "http.auth.target-scope"; 
     public static final String PROXY_AUTH_STATE      = "http.auth.proxy-scope"; 
-    
-    public HttpClientContext(final HttpContext parentContext) {
-        super(parentContext);
-    }
-    
 }

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestAddCookies.java
Fri Jul 20 13:21:22 2007
@@ -54,7 +54,7 @@
 import org.apache.http.cookie.CookieSpec;
 import org.apache.http.cookie.CookieSpecRegistry;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.ExecutionContext;
 
 /**
  * Request interceptor that matches cookies available in the current
@@ -86,7 +86,7 @@
         
         // Obtain HTTP state
         HttpState state = (HttpState) context.getAttribute(
-                HttpClientContext.HTTP_STATE);
+                ClientContext.HTTP_STATE);
         if (state == null) {
             LOG.info("HTTP state not available in HTTP context");
             return;
@@ -94,7 +94,7 @@
         
         // Obtain the registry of cookie specs
         CookieSpecRegistry registry= (CookieSpecRegistry) context.getAttribute(
-                HttpClientContext.COOKIESPEC_REGISTRY);
+                ClientContext.COOKIESPEC_REGISTRY);
         if (registry == null) {
             LOG.info("CookieSpec registry not available in HTTP context");
             return;
@@ -102,14 +102,14 @@
         
         // Obtain the target host (required)
         HttpHost targetHost = (HttpHost) context.getAttribute(
-                HttpExecutionContext.HTTP_TARGET_HOST);
+                ExecutionContext.HTTP_TARGET_HOST);
         if (targetHost == null) {
             throw new IllegalStateException("Target host not specified in HTTP context");
         }
         
         // Obtain the client connection (required)
         ManagedClientConnection conn = (ManagedClientConnection) context.getAttribute(
-                HttpExecutionContext.HTTP_CONNECTION);
+                ExecutionContext.HTTP_CONNECTION);
         if (conn == null) {
             throw new IllegalStateException("Client connection not specified in HTTP context");
         }
@@ -169,8 +169,8 @@
         
         // Stick the CookieSpec and CookieOrigin instances to the HTTP context
         // so they could be obtained by the response interceptor
-        context.setAttribute(HttpClientContext.COOKIE_SPEC, cookieSpec);
-        context.setAttribute(HttpClientContext.COOKIE_ORIGIN, cookieOrigin);
+        context.setAttribute(ClientContext.COOKIE_SPEC, cookieSpec);
+        context.setAttribute(ClientContext.COOKIE_ORIGIN, cookieOrigin);
     }
     
 }

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestProxyAuthentication.java
Fri Jul 20 13:21:22 2007
@@ -75,7 +75,7 @@
         
         // Obtain authentication state
         AuthState authState = (AuthState) context.getAttribute(
-                HttpClientContext.PROXY_AUTH_STATE);
+                ClientContext.PROXY_AUTH_STATE);
         if (authState == null) {
             return;
         }

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/RequestTargetAuthentication.java
Fri Jul 20 13:21:22 2007
@@ -75,7 +75,7 @@
         
         // Obtain authentication state
         AuthState authState = (AuthState) context.getAttribute(
-                HttpClientContext.TARGET_AUTH_STATE);
+                ClientContext.TARGET_AUTH_STATE);
         if (authState == null) {
             return;
         }

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/client/protocol/ResponseProcessCookies.java
Fri Jul 20 13:21:22 2007
@@ -76,21 +76,21 @@
         
         // Obtain HTTP state
         HttpState state = (HttpState) context.getAttribute(
-                HttpClientContext.HTTP_STATE);
+                ClientContext.HTTP_STATE);
         if (state == null) {
             LOG.info("HTTP state not available in HTTP context");
             return;
         }
         // Obtain actual CookieSpec instance
         CookieSpec cookieSpec = (CookieSpec) context.getAttribute(
-                HttpClientContext.COOKIE_SPEC);
+                ClientContext.COOKIE_SPEC);
         if (cookieSpec == null) {
             LOG.info("CookieSpec not available in HTTP context");
             return;
         }
         // Obtain actual CookieOrigin instance
         CookieOrigin cookieOrigin = (CookieOrigin) context.getAttribute(
-                HttpClientContext.COOKIE_ORIGIN);
+                ClientContext.COOKIE_ORIGIN);
         if (cookieOrigin == null) {
             LOG.info("CookieOrigin not available in HTTP context");
             return;

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
Fri Jul 20 13:21:22 2007
@@ -51,12 +51,12 @@
 import org.apache.http.client.RedirectHandler;
 import org.apache.http.client.RoutedRequest;
 import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.client.protocol.HttpClientContext;
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.cookie.CookieSpecRegistry;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpRequestInterceptorList;
 import org.apache.http.protocol.HttpResponseInterceptorList;
 
@@ -418,7 +418,7 @@
         
         synchronized (this) {
             if (context == null) {
-                context = new HttpClientContext(getDefaultContext());
+                context = new BasicHttpContext(getDefaultContext());
             }
         }
         
@@ -456,7 +456,7 @@
         // all shared objects that are potentially threading unsafe.
         synchronized (this) {
             if (context == null) {
-                context = new HttpClientContext(getDefaultContext());
+                context = new BasicHttpContext(getDefaultContext());
             }
             // Create a director for this request
             director = new DefaultClientRequestDirector(

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultAuthenticationHandler.java
Fri Jul 20 13:21:22 2007
@@ -50,7 +50,7 @@
 import org.apache.http.auth.MalformedChallengeException;
 import org.apache.http.client.AuthenticationHandler;
 import org.apache.http.client.params.HttpClientParams;
-import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.message.BufferedHeader;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
@@ -153,7 +153,7 @@
             final HttpContext context) throws AuthenticationException {
         
         AuthSchemeRegistry registry = (AuthSchemeRegistry) context.getAttribute(
-                HttpClientContext.AUTHSCHEME_REGISTRY);
+                ClientContext.AUTHSCHEME_REGISTRY);
         if (registry == null) {
             throw new IllegalStateException("AuthScheme registry not set in HTTP context");
         }

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultClientRequestDirector.java
Fri Jul 20 13:21:22 2007
@@ -67,7 +67,7 @@
 import org.apache.http.client.methods.AbortableHttpRequest;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.params.HttpClientParams;
-import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.conn.BasicManagedEntity;
 import org.apache.http.conn.ClientConnectionManager;
 import org.apache.http.conn.ConnectionPoolTimeoutException;
@@ -83,7 +83,7 @@
 import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.util.CharArrayBuffer;
@@ -323,15 +323,15 @@
                 HttpHost proxy = route.getProxyHost();
                 
                 // Populate the execution context
-                context.setAttribute(HttpExecutionContext.HTTP_TARGET_HOST,
+                context.setAttribute(ExecutionContext.HTTP_TARGET_HOST,
                         target);
-                context.setAttribute(HttpExecutionContext.HTTP_PROXY_HOST,
+                context.setAttribute(ExecutionContext.HTTP_PROXY_HOST,
                         proxy);
-                context.setAttribute(HttpExecutionContext.HTTP_CONNECTION,
+                context.setAttribute(ExecutionContext.HTTP_CONNECTION,
                         managedConn);
-                context.setAttribute(HttpClientContext.TARGET_AUTH_STATE,
+                context.setAttribute(ClientContext.TARGET_AUTH_STATE,
                         targetAuthState);
-                context.setAttribute(HttpClientContext.PROXY_AUTH_STATE,
+                context.setAttribute(ClientContext.PROXY_AUTH_STATE,
                         proxyAuthState);
                 requestExec.preProcess(request, httpProcessor, context);
                 
@@ -339,7 +339,7 @@
                     ((AbortableHttpRequest) orig).setReleaseTrigger(managedConn);
                 }
 
-                context.setAttribute(HttpExecutionContext.HTTP_REQUEST,
+                context.setAttribute(ExecutionContext.HTTP_REQUEST,
                         request);
 
                 execCount++;
@@ -580,7 +580,8 @@
                         response.getStatusLine());
             }
             
-            HttpState state = (HttpState) context.getAttribute(HttpClientContext.HTTP_STATE);
+            HttpState state = (HttpState)
+                context.getAttribute(ClientContext.HTTP_STATE);
             
             if (state != null && HttpClientParams.isAuthenticating(params)) {
                 if (this.authHandler.isProxyAuthenticationRequested(response, context)) {
@@ -757,13 +758,15 @@
             return new RoutedRequest.Impl(redirect, newRoute);
         }
 
-        HttpState state = (HttpState) context.getAttribute(HttpClientContext.HTTP_STATE);
+        HttpState state = (HttpState)
+            context.getAttribute(ClientContext.HTTP_STATE);
         
         if (state != null && HttpClientParams.isAuthenticating(params)) {
 
             if (this.authHandler.isTargetAuthenticationRequested(response, context)) {
 
-                target = (HttpHost) context.getAttribute(HttpExecutionContext.HTTP_TARGET_HOST);
+                target = (HttpHost)
+                    context.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
                 if (target == null) {
                     target = route.getTargetHost();
                 }

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
Fri Jul 20 13:21:22 2007
@@ -46,7 +46,7 @@
 import org.apache.http.client.params.AuthPolicy;
 import org.apache.http.client.params.CookiePolicy;
 import org.apache.http.client.params.HttpClientParams;
-import org.apache.http.client.protocol.HttpClientContext;
+import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.client.protocol.RequestAddCookies;
 import org.apache.http.client.protocol.RequestProxyAuthentication;
 import org.apache.http.client.protocol.RequestTargetAuthentication;
@@ -77,7 +77,7 @@
 import org.apache.http.protocol.RequestExpectContinue;
 import org.apache.http.protocol.RequestTargetHost;
 import org.apache.http.protocol.RequestUserAgent;
-import org.apache.http.protocol.SyncHttpExecutionContext;
+import org.apache.http.protocol.SyncBasicHttpContext;
 
 
 
@@ -168,7 +168,7 @@
 
 
     protected HttpContext createHttpContext() {
-        return new SyncHttpExecutionContext(null);
+        return new SyncBasicHttpContext(null);
     }
 
     
@@ -245,13 +245,13 @@
 
     protected void populateContext(final HttpContext context) {
         context.setAttribute(
-                HttpClientContext.AUTHSCHEME_REGISTRY, 
+                ClientContext.AUTHSCHEME_REGISTRY, 
                 getAuthSchemes());
         context.setAttribute(
-                HttpClientContext.COOKIESPEC_REGISTRY, 
+                ClientContext.COOKIESPEC_REGISTRY, 
                 getCookieSpecs());
         context.setAttribute(
-                HttpClientContext.HTTP_STATE, 
+                ClientContext.HTTP_STATE, 
                 getState());
     }
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultHttpRequestRetryHandler.java
Fri Jul 20 13:21:22 2007
@@ -40,7 +40,7 @@
 import org.apache.http.NoHttpResponseException;
 import org.apache.http.client.HttpRequestRetryHandler;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.ExecutionContext;
 
 /**
  * The default {@link HttpRequestRetryHandler} used by request executors.
@@ -105,7 +105,8 @@
             // SSL handshake exception
             return false;
         }
-        Boolean b = (Boolean) context.getAttribute(HttpExecutionContext.HTTP_REQ_SENT);
+        Boolean b = (Boolean)
+            context.getAttribute(ExecutionContext.HTTP_REQ_SENT);
         boolean sent = (b != null && b.booleanValue());
         if (!sent || this.requestSentRetryEnabled) {
             // Retry if the request has not been sent fully or

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/impl/client/DefaultRedirectHandler.java
Fri Jul 20 13:21:22 2007
@@ -48,7 +48,7 @@
 import org.apache.http.client.params.HttpClientParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.ExecutionContext;
 
 /**
  * Default implementation of a redirect handler.
@@ -124,7 +124,7 @@
             }
             // Adjust location URI
             HttpHost target = (HttpHost) context.getAttribute(
-                    HttpExecutionContext.HTTP_TARGET_HOST);
+                    ExecutionContext.HTTP_TARGET_HOST);
             if (target == null) {
                 throw new IllegalStateException("Target host not available " +
                         "in the HTTP context");

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ExecReqThread.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ExecReqThread.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ExecReqThread.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/ExecReqThread.java
Fri Jul 20 13:21:22 2007
@@ -36,7 +36,7 @@
 import org.apache.http.conn.HttpRoute;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.util.EntityUtils;
@@ -96,12 +96,12 @@
 
         try {
             request_spec.context.setAttribute
-                (HttpExecutionContext.HTTP_CONNECTION, connection);
+                (ExecutionContext.HTTP_CONNECTION, connection);
 
             doOpenConnection();
 
             HttpRequest request = (HttpRequest) request_spec.context.
-                getAttribute(HttpExecutionContext.HTTP_REQUEST);
+                getAttribute(ExecutionContext.HTTP_REQUEST);
             request_spec.executor.preProcess
                 (request, request_spec.processor, request_spec.context);
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/Helper.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/Helper.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/Helper.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/Helper.java
Fri Jul 20 13:21:22 2007
@@ -37,7 +37,7 @@
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpParamsLinker;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
 
@@ -65,9 +65,9 @@
                                        HttpContext ctxt)
         throws Exception {
 
-        ctxt.setAttribute(HttpExecutionContext.HTTP_CONNECTION, conn);
-        ctxt.setAttribute(HttpExecutionContext.HTTP_TARGET_HOST, target);
-        ctxt.setAttribute(HttpExecutionContext.HTTP_REQUEST, req);
+        ctxt.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
+        ctxt.setAttribute(ExecutionContext.HTTP_TARGET_HOST, target);
+        ctxt.setAttribute(ExecutionContext.HTTP_REQUEST, req);
 
         HttpParamsLinker.link(req, params);
         exec.preProcess(req, proc, ctxt);

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestLocalServer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestLocalServer.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestLocalServer.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestLocalServer.java
Fri Jul 20 13:21:22 2007
@@ -43,7 +43,7 @@
 import org.apache.http.localserver.LocalTestServer;
 import org.apache.http.localserver.ServerTestBase;
 import org.apache.http.params.HttpParamsLinker;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.util.EntityUtils;
 
 
@@ -81,11 +81,11 @@
         HttpClientConnection conn = connectTo(target);
 
         httpContext.setAttribute(
-                HttpExecutionContext.HTTP_CONNECTION, conn);
+                ExecutionContext.HTTP_CONNECTION, conn);
         httpContext.setAttribute(
-                HttpExecutionContext.HTTP_TARGET_HOST, target);
+                ExecutionContext.HTTP_TARGET_HOST, target);
         httpContext.setAttribute(
-                HttpExecutionContext.HTTP_REQUEST, request);
+                ExecutionContext.HTTP_REQUEST, request);
 
         HttpParamsLinker.link(request, defaultParams);
         httpExecutor.preProcess
@@ -124,11 +124,11 @@
             HttpClientConnection conn = connectTo(target);
             
             httpContext.setAttribute(
-                    HttpExecutionContext.HTTP_CONNECTION, conn);
+                    ExecutionContext.HTTP_CONNECTION, conn);
             httpContext.setAttribute(
-                    HttpExecutionContext.HTTP_TARGET_HOST, target);
+                    ExecutionContext.HTTP_TARGET_HOST, target);
             httpContext.setAttribute(
-                    HttpExecutionContext.HTTP_REQUEST, request);
+                    ExecutionContext.HTTP_REQUEST, request);
 
             HttpParamsLinker.link(request, defaultParams);
             httpExecutor.preProcess

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/impl/conn/TestTSCCMWithServer.java
Fri Jul 20 13:21:22 2007
@@ -49,7 +49,8 @@
 import org.apache.http.localserver.ServerTestBase;
 import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.BasicHttpContext;
+import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.util.EntityUtils;
 
 
@@ -138,13 +139,13 @@
             ExecReqThread.RequestSpec ertrs = new ExecReqThread.RequestSpec();
             ertrs.executor = httpExecutor;
             ertrs.processor = httpProcessor;
-            ertrs.context = new HttpExecutionContext(null);
+            ertrs.context = new BasicHttpContext(null);
             ertrs.params = defaultParams;
 
             ertrs.context.setAttribute
-                (HttpExecutionContext.HTTP_TARGET_HOST, target);
+                (ExecutionContext.HTTP_TARGET_HOST, target);
             ertrs.context.setAttribute
-                (HttpExecutionContext.HTTP_REQUEST, request);
+                (ExecutionContext.HTTP_REQUEST, request);
 
             threads[i] = new ExecReqThread(mgr, route, 5000L, ertrs);
         }
@@ -223,7 +224,7 @@
 
         // repeat the communication, no need to prepare the request again
         conn.open(route, httpContext, defaultParams);
-        httpContext.setAttribute(HttpExecutionContext.HTTP_CONNECTION, conn);
+        httpContext.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
         response = httpExecutor.execute(request, conn, httpContext);
         httpExecutor.postProcess(response, httpProcessor, httpContext);
 
@@ -243,7 +244,7 @@
         assertTrue("connection should have been open", conn.isOpen());
 
         // repeat the communication, no need to prepare the request again
-        httpContext.setAttribute(HttpExecutionContext.HTTP_CONNECTION, conn);
+        httpContext.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
         response = httpExecutor.execute(request, conn, httpContext);
         httpExecutor.postProcess(response, httpProcessor, httpContext);
 

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/LocalTestServer.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/LocalTestServer.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/LocalTestServer.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/LocalTestServer.java
Fri Jul 20 13:21:22 2007
@@ -51,7 +51,7 @@
 import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.protocol.HttpRequestHandlerRegistry;
 import org.apache.http.protocol.HttpService;
@@ -365,7 +365,7 @@
 
 
             public void run() {
-                HttpContext context = new HttpExecutionContext(null);
+                HttpContext context = new BasicHttpContext(null);
                 try {
                     while ((servicedSocket != null) &&
                            this.conn.isOpen() && !Thread.interrupted()) {

Modified: jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/ServerTestBase.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/ServerTestBase.java?view=diff&rev=558119&r1=558118&r2=558119
==============================================================================
--- jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/ServerTestBase.java
(original)
+++ jakarta/httpcomponents/httpclient/trunk/module-client/src/test/java/org/apache/http/localserver/ServerTestBase.java
Fri Jul 20 13:21:22 2007
@@ -45,7 +45,7 @@
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.BasicHttpProcessor;
-import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpRequestExecutor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
@@ -74,7 +74,7 @@
     protected BasicHttpProcessor httpProcessor;
 
     /** The default context for the client side. */
-    protected HttpExecutionContext httpContext;
+    protected BasicHttpContext httpContext;
 
     /** The request executor for the client side. */
     protected HttpRequestExecutor httpExecutor;
@@ -135,7 +135,7 @@
         }
 
         // the context is created each time, it may get modified by test cases
-        httpContext = new HttpExecutionContext(null);
+        httpContext = new BasicHttpContext(null);
 
         if (httpExecutor == null) {
             httpExecutor = new HttpRequestExecutor();



Mime
View raw message