hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r610763 - in /httpcomponents/httpcore/trunk: contrib/src/main/java/org/apache/http/contrib/benchmark/ module-main/src/main/java/org/apache/http/params/ module-main/src/main/java/org/apache/http/protocol/ module-main/src/test/java/org/apache...
Date Thu, 10 Jan 2008 12:01:26 GMT
Author: olegk
Date: Thu Jan 10 04:01:13 2008
New Revision: 610763

URL: http://svn.apache.org/viewvc?rev=610763&view=rev
Log:
Renamed SimpleParamStack to DefaultedHttpParams; removed #isParameterSet method from the HttpParams
interface; added some javadocs

Added:
    httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/DefaultedHttpParams.java
      - copied, changed from r610464, httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/SimpleParamStack.java
Removed:
    httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/SimpleParamStack.java
Modified:
    httpcomponents/httpcore/trunk/contrib/src/main/java/org/apache/http/contrib/benchmark/BenchmarkWorker.java
    httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/HttpParams.java
    httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
    httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/TestHttpClient.java
    httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/params/TestBasicHttpParams.java
    httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpClientHandler.java
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
    httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java

Modified: httpcomponents/httpcore/trunk/contrib/src/main/java/org/apache/http/contrib/benchmark/BenchmarkWorker.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/contrib/src/main/java/org/apache/http/contrib/benchmark/BenchmarkWorker.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/contrib/src/main/java/org/apache/http/contrib/benchmark/BenchmarkWorker.java
(original)
+++ httpcomponents/httpcore/trunk/contrib/src/main/java/org/apache/http/contrib/benchmark/BenchmarkWorker.java
Thu Jan 10 04:01:13 2008
@@ -50,7 +50,7 @@
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
@@ -137,7 +137,7 @@
         this.context.setAttribute(ExecutionContext.HTTP_REQUEST, this.request);
 
         stats.start();
-        request.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+        request.setParams(new DefaultedHttpParams(new BasicHttpParams(), this.params));
         for (int i = 0; i < count; i++) {
 
             try {

Copied: httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/DefaultedHttpParams.java
(from r610464, httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/SimpleParamStack.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/DefaultedHttpParams.java?p2=httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/DefaultedHttpParams.java&p1=httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/SimpleParamStack.java&r1=610464&r2=610763&rev=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/SimpleParamStack.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/DefaultedHttpParams.java
Thu Jan 10 04:01:13 2008
@@ -1,7 +1,7 @@
 /*
- * $HeadURL:$
- * $Revision:$
- * $Date:$
+ * $HeadURL$
+ * $Revision$
+ * $Date$
  *
  * ====================================================================
  * Licensed to the Apache Software Foundation (ASF) under one
@@ -33,55 +33,69 @@
 
 import org.apache.http.params.HttpParams;
 
-
 /**
- * Simple two level stack of HTTP parameters (child/parent).
+ * {@link HttpParams} implementation that delegates resolution of a parameter
+ * to the given default {@link HttpParams} instance if the parameter is not 
+ * present in the local one. The state of the local collection can be mutated,
+ * whereas the default collection is treated as read-only.
  *
  * @author <a href="mailto:oleg at ural.ru">Oleg Kalnichevski</a>
  * 
- * @version $Revision:$
+ * @version $Revision$
  */
-public final class SimpleParamStack extends AbstractHttpParams {
+public final class DefaultedHttpParams extends AbstractHttpParams {
 
-    private final HttpParams params;
-    private final HttpParams parent;
+    private final HttpParams local;
+    private final HttpParams defaults;
     
-    public SimpleParamStack(final HttpParams params, final HttpParams parent) {
+    public DefaultedHttpParams(final HttpParams local, final HttpParams defaults) {
         super();
-        if (params == null) {
+        if (local == null) {
             throw new IllegalArgumentException("HTTP parameters may not be null");
         }
-        this.params = params;
-        this.parent = parent;
+        this.local = local;
+        this.defaults = defaults;
     }
 
+    /**
+     * Creates a copy of the local collection with the same default
+     */
     public HttpParams copy() {
-        HttpParams clone = this.params.copy();
-        return new SimpleParamStack(clone, this.parent);
+        HttpParams clone = this.local.copy();
+        return new DefaultedHttpParams(clone, this.defaults);
     }
 
+    /**
+     * Retrieves the value of the parameter from the local collection and, if the 
+     * parameter is not set locally, delegates its resolution to the default 
+     * collection.
+     */
     public Object getParameter(final String name) {
-        Object obj = this.params.getParameter(name);
-        if (obj == null && this.parent != null) {
-            obj = this.parent.getParameter(name);
+        Object obj = this.local.getParameter(name);
+        if (obj == null && this.defaults != null) {
+            obj = this.defaults.getParameter(name);
         }
         return obj;
     }
 
-    public boolean isParameterSet(final String name) {
-        return this.params.isParameterSet(name);
-    }
-
+    /**
+     * Attempts to remove the parameter from the local collection. This method 
+     * <i>does not</i> modify the default collection.
+     */
     public boolean removeParameter(final String name) {
-        return this.removeParameter(name);
+        return this.local.removeParameter(name);
     }
 
+    /**
+     * Sets the parameter in the local collection. This method <i>does not</i>

+     * modify the default collection.
+     */
     public HttpParams setParameter(final String name, final Object value) {
-        return this.params.setParameter(name, value);
+        return this.local.setParameter(name, value);
     }
 
-    public HttpParams getParent() {
-        return this.parent;
+    public HttpParams getDefaults() {
+        return this.defaults;
     }
     
 }

Modified: httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/HttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/HttpParams.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/HttpParams.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/params/HttpParams.java
Thu Jan 10 04:01:13 2008
@@ -164,16 +164,6 @@
     HttpParams setBooleanParameter(String name, boolean value);
 
     /**
-     * Checks if a parameter is set.
-     * 
-     * @param name parameter name
-     *
-     * @return <tt>true</tt> if the parameter is set,
-     *         <tt>false</tt> otherwise
-     */
-    boolean isParameterSet(String name);
-
-    /**
      * Checks if a boolean parameter is set to <code>true</code>.
      * 
      * @param name parameter name

Modified: httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/main/java/org/apache/http/protocol/HttpService.java
Thu Jan 10 04:01:13 2008
@@ -48,9 +48,8 @@
 import org.apache.http.ProtocolVersion;
 import org.apache.http.UnsupportedHttpVersionException;
 import org.apache.http.entity.ByteArrayEntity;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.util.EncodingUtils;
 
 /**
@@ -134,7 +133,8 @@
         try {
 
             HttpRequest request = conn.receiveRequestHeader();
-            request.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+            request.setParams(
+                    new DefaultedHttpParams(request.getParams(), this.params));
             
             ProtocolVersion ver =
                 request.getRequestLine().getProtocolVersion();
@@ -148,7 +148,8 @@
                 if (((HttpEntityEnclosingRequest) request).expectContinue()) {
                     response = this.responseFactory.newHttpResponse(ver, 
                             HttpStatus.SC_CONTINUE, context);
-                    response.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+                    response.setParams(
+                            new DefaultedHttpParams(response.getParams(), this.params));
                     
                     if (this.expectationVerifier != null) {
                         try {
@@ -157,7 +158,7 @@
                             response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0,

                                     HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
                             response.setParams(
-                                    new SimpleParamStack(new BasicHttpParams(), this.params));
+                                    new DefaultedHttpParams(response.getParams(), this.params));
                             handleException(ex, response);
                         }
                     }
@@ -176,7 +177,8 @@
 
             if (response == null) {
                 response = this.responseFactory.newHttpResponse(ver, HttpStatus.SC_OK, context);
-                response.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+                response.setParams(
+                        new DefaultedHttpParams(response.getParams(), this.params));
 
                 context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
                 context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);
@@ -197,7 +199,8 @@
             response = this.responseFactory.newHttpResponse
                 (HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR,
                  context);
-            response.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+            response.setParams(
+                    new DefaultedHttpParams(response.getParams(), this.params));
             handleException(ex, response);
         }
         

Modified: httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/TestHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/TestHttpClient.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/TestHttpClient.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/mockup/TestHttpClient.java
Thu Jan 10 04:01:13 2008
@@ -45,7 +45,7 @@
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.BasicHttpContext;
@@ -100,10 +100,10 @@
         this.context.setAttribute(ExecutionContext.HTTP_TARGET_HOST, targetHost);
         this.context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
 
-        request.setParams(new SimpleParamStack(request.getParams(), this.params));
+        request.setParams(new DefaultedHttpParams(request.getParams(), this.params));
         this.httpexecutor.preProcess(request, this.httpproc, this.context);
         HttpResponse response = this.httpexecutor.execute(request, conn, this.context);
-        response.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+        response.setParams(new DefaultedHttpParams(response.getParams(), this.params));
         this.httpexecutor.postProcess(response, this.httpproc, this.context);
         return response;
     }

Modified: httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/params/TestBasicHttpParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/params/TestBasicHttpParams.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/params/TestBasicHttpParams.java
(original)
+++ httpcomponents/httpcore/trunk/module-main/src/test/java/org/apache/http/params/TestBasicHttpParams.java
Thu Jan 10 04:01:13 2008
@@ -59,7 +59,7 @@
 
     public void testCopyParams() {
         HttpParams parent = new BasicHttpParams();
-        HttpParams child  = new SimpleParamStack(
+        HttpParams child  = new DefaultedHttpParams(
                 new BasicHttpParams(), parent);
         parent.setParameter("parent", "something");
         child.setParameter("child", "something");

Modified: httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
(original)
+++ httpcomponents/httpcore/trunk/module-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
Thu Jan 10 04:01:13 2008
@@ -74,7 +74,7 @@
 import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.HttpProtocolParams;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HTTP;
@@ -289,7 +289,8 @@
             
             HttpResponse response =  this.responseFactory.newHttpResponse(
                     HttpVersion.HTTP_1_0, HttpStatus.SC_BAD_REQUEST, context);
-            response.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+            response.setParams(
+                    new DefaultedHttpParams(response.getParams(), this.params));
             
             context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);
             context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
@@ -462,7 +463,8 @@
                 final ConnState connState) throws HttpException, IOException {
             HttpContext context = conn.getContext();
             HttpRequest request = conn.getHttpRequest();
-            request.setParams(new SimpleParamStack(request.getParams(), this.params));
+            request.setParams(
+                    new DefaultedHttpParams(request.getParams(), this.params));
 
             if (request instanceof HttpEntityEnclosingRequest) {
                 HttpEntityEnclosingRequest eeRequest = (HttpEntityEnclosingRequest) request;
@@ -477,7 +479,8 @@
             
             ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
             HttpResponse response =  this.responseFactory.newHttpResponse(ver, 200, context);
-            response.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+            response.setParams(
+                    new DefaultedHttpParams(response.getParams(), this.params));
             
             context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
             context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpClientHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpClientHandler.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpClientHandler.java
(original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpClientHandler.java
Thu Jan 10 04:01:13 2008
@@ -52,10 +52,9 @@
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.nio.util.SimpleInputBuffer;
 import org.apache.http.nio.util.SimpleOutputBuffer;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -130,7 +129,8 @@
                 return;
             }
             
-            request.setParams(new SimpleParamStack(request.getParams(), this.params));
+            request.setParams(
+                    new DefaultedHttpParams(request.getParams(), this.params));
             
             context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
             this.httpProcessor.process(request, context);
@@ -228,7 +228,8 @@
         ClientConnState connState = (ClientConnState) context.getAttribute(CONN_STATE);
 
         HttpResponse response = conn.getHttpResponse();
-        response.setParams(new SimpleParamStack(new BasicHttpParams(), this.params));
+        response.setParams(
+                new DefaultedHttpParams(response.getParams(), this.params));
         
         HttpRequest request = connState.getRequest();
         

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
(original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/BufferingHttpServiceHandler.java
Thu Jan 10 04:01:13 2008
@@ -60,9 +60,8 @@
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.nio.util.SimpleInputBuffer;
 import org.apache.http.nio.util.SimpleOutputBuffer;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -115,7 +114,7 @@
         HttpContext context = conn.getContext();
         
         HttpRequest request = conn.getHttpRequest();
-        request.setParams(new SimpleParamStack(request.getParams(), this.params));
+        request.setParams(new DefaultedHttpParams(request.getParams(), this.params));
 
         ServerConnState connState = (ServerConnState) context.getAttribute(CONN_STATE);
 
@@ -139,7 +138,7 @@
                     response = this.responseFactory.newHttpResponse(
                             ver, HttpStatus.SC_CONTINUE, context);
                     response.setParams(
-                            new SimpleParamStack(new BasicHttpParams(), this.params));
+                            new DefaultedHttpParams(response.getParams(), this.params));
                     
                     if (this.expectationVerifier != null) {
                         try {
@@ -150,7 +149,7 @@
                                     HttpStatus.SC_INTERNAL_SERVER_ERROR, 
                                     context);
                             response.setParams(
-                                    new SimpleParamStack(new BasicHttpParams(), this.params));
+                                    new DefaultedHttpParams(response.getParams(), this.params));
                             handleException(ex, response);
                         }
                     }
@@ -208,7 +207,7 @@
             HttpResponse response = this.responseFactory.newHttpResponse(
                     HttpVersion.HTTP_1_0, HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
             response.setParams(
-                    new SimpleParamStack(new BasicHttpParams(), this.params));
+                    new DefaultedHttpParams(response.getParams(), this.params));
             handleException(httpex, response);
             response.setEntity(null);
             sendResponse(conn, response);
@@ -335,7 +334,7 @@
                 HttpStatus.SC_OK, 
                 conn.getContext());
         response.setParams(
-                new SimpleParamStack(new BasicHttpParams(), this.params));
+                new DefaultedHttpParams(response.getParams(), this.params));
         
         context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
@@ -360,7 +359,7 @@
             response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 
                     HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
             response.setParams(
-                    new SimpleParamStack(new BasicHttpParams(), this.params));
+                    new DefaultedHttpParams(response.getParams(), this.params));
             handleException(ex, response);
         }
 

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
(original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpClientHandler.java
Thu Jan 10 04:01:13 2008
@@ -57,10 +57,9 @@
 import org.apache.http.nio.util.DirectByteBufferAllocator;
 import org.apache.http.nio.util.SharedInputBuffer;
 import org.apache.http.nio.util.SharedOutputBuffer;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -154,7 +153,8 @@
                     return;
                 }
                 
-                request.setParams(new SimpleParamStack(request.getParams(), this.params));
+                request.setParams(
+                        new DefaultedHttpParams(request.getParams(), this.params));
                 
                 context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
                 this.httpProcessor.process(request, context);
@@ -236,7 +236,7 @@
             synchronized (connState) {
                 HttpResponse response = conn.getHttpResponse();
                 response.setParams(
-                        new SimpleParamStack(new BasicHttpParams(), this.params));
+                        new DefaultedHttpParams(response.getParams(), this.params));
                 
                 HttpRequest request = connState.getRequest();
                 

Modified: httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java?rev=610763&r1=610762&r2=610763&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
(original)
+++ httpcomponents/httpcore/trunk/module-nio/src/main/java/org/apache/http/nio/protocol/ThrottlingHttpServiceHandler.java
Thu Jan 10 04:01:13 2008
@@ -63,9 +63,8 @@
 import org.apache.http.nio.util.DirectByteBufferAllocator;
 import org.apache.http.nio.util.SharedInputBuffer;
 import org.apache.http.nio.util.SharedOutputBuffer;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.SimpleParamStack;
+import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -152,7 +151,7 @@
                     HttpStatus.SC_INTERNAL_SERVER_ERROR, 
                     context);
             response.setParams(
-                    new SimpleParamStack(new BasicHttpParams(), this.params));
+                    new DefaultedHttpParams(response.getParams(), this.params));
             handleException(httpex, response);
             response.setEntity(null);
             
@@ -386,7 +385,7 @@
             connState.setWorkerRunning(true);
         }
 
-        request.setParams(new SimpleParamStack(request.getParams(), this.params));
+        request.setParams(new DefaultedHttpParams(request.getParams(), this.params));
 
         context.setAttribute(ExecutionContext.HTTP_CONNECTION, conn);
         context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
@@ -409,7 +408,7 @@
                         HttpStatus.SC_CONTINUE, 
                         context);
                 response.setParams(
-                        new SimpleParamStack(new BasicHttpParams(), this.params));
+                        new DefaultedHttpParams(response.getParams(), this.params));
                 if (this.expectationVerifier != null) {
                     try {
                         this.expectationVerifier.verify(request, response, context);
@@ -417,7 +416,7 @@
                         response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0,

                                 HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
                         response.setParams(
-                                new SimpleParamStack(new BasicHttpParams(), this.params));
+                                new DefaultedHttpParams(response.getParams(), this.params));
                         handleException(ex, response);
                     }
                 }
@@ -472,7 +471,7 @@
                     HttpStatus.SC_OK, 
                     context);
             response.setParams(
-                    new SimpleParamStack(new BasicHttpParams(), this.params));
+                    new DefaultedHttpParams(response.getParams(), this.params));
 
             context.setAttribute(ExecutionContext.HTTP_RESPONSE, response);
             
@@ -495,7 +494,7 @@
                 response = this.responseFactory.newHttpResponse(HttpVersion.HTTP_1_0, 
                         HttpStatus.SC_INTERNAL_SERVER_ERROR, context);
                 response.setParams(
-                        new SimpleParamStack(new BasicHttpParams(), this.params));
+                        new DefaultedHttpParams(response.getParams(), this.params));
                 handleException(ex, response);
             }
         }



Mime
View raw message