hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rola...@apache.org
Subject svn commit: r449761 - in /jakarta/httpcomponents/httpasync/trunk/src: contrib/org/apache/http/async/contrib/routing/ examples/org/apache/http/examples/ java/org/apache/http/async/
Date Mon, 25 Sep 2006 17:56:49 GMT
Author: rolandw
Date: Mon Sep 25 10:56:48 2006
New Revision: 449761

URL: http://svn.apache.org/viewvc?view=rev&rev=449761
Log:
minimal changes to adapt to HTTPCORE-13, take 1

Modified:
    jakarta/httpcomponents/httpasync/trunk/src/contrib/org/apache/http/async/contrib/routing/RoutingAsyncGet.java
    jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/ElementalAsyncGet.java
    jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/NotifiedAsyncGet.java
    jakarta/httpcomponents/httpasync/trunk/src/java/org/apache/http/async/AsyncHttpProcessor.java

Modified: jakarta/httpcomponents/httpasync/trunk/src/contrib/org/apache/http/async/contrib/routing/RoutingAsyncGet.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpasync/trunk/src/contrib/org/apache/http/async/contrib/routing/RoutingAsyncGet.java?view=diff&rev=449761&r1=449760&r2=449761
==============================================================================
--- jakarta/httpcomponents/httpasync/trunk/src/contrib/org/apache/http/async/contrib/routing/RoutingAsyncGet.java
(original)
+++ jakarta/httpcomponents/httpasync/trunk/src/contrib/org/apache/http/async/contrib/routing/RoutingAsyncGet.java
Mon Sep 25 10:56:48 2006
@@ -45,6 +45,7 @@
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpParams;
 import org.apache.http.impl.io.PlainSocketFactory;
+import org.apache.http.impl.protocol.DefaultHttpProcessor;
 import org.apache.http.io.SocketFactory;
 import org.apache.http.message.HttpGet;
 import org.apache.http.params.HttpParams;
@@ -234,15 +235,17 @@
 
         HttpAsyncClientConnection conn = new SimpleHttpAsyncClientConnection();
 
-        AsyncHttpProcessor proc = new AsyncHttpProcessor();
-        proc.setParams(params);
+        DefaultHttpProcessor dhp = new DefaultHttpProcessor();
         // Required request interceptors
-        proc.addInterceptor(new RequestContent());
-        proc.addInterceptor(new RequestTargetHost());
+        dhp.addInterceptor(new RequestContent());
+        dhp.addInterceptor(new RequestTargetHost());
         // Recommended request interceptors
-        proc.addInterceptor(new RequestConnControl());
-        proc.addInterceptor(new RequestUserAgent());
-        // not supported: proc.addInterceptor(new RequestExpectContinue());
+        dhp.addInterceptor(new RequestConnControl());
+        dhp.addInterceptor(new RequestUserAgent());
+        // not supported: dhp.addInterceptor(new RequestExpectContinue());
+
+        AsyncHttpProcessor proc = new AsyncHttpProcessor(dhp);
+        proc.setParams(params);
 
         ConnectionReuseStrategy crs = new DefaultConnectionReuseStrategy();
 

Modified: jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/ElementalAsyncGet.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/ElementalAsyncGet.java?view=diff&rev=449761&r1=449760&r2=449761
==============================================================================
--- jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/ElementalAsyncGet.java
(original)
+++ jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/ElementalAsyncGet.java
Mon Sep 25 10:56:48 2006
@@ -44,6 +44,7 @@
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpParams;
 import org.apache.http.impl.io.PlainSocketFactory;
+import org.apache.http.impl.protocol.DefaultHttpProcessor;
 import org.apache.http.io.SocketFactory;
 import org.apache.http.message.HttpGet;
 import org.apache.http.params.HttpParams;
@@ -162,15 +163,17 @@
 
         HttpAsyncClientConnection conn = new SimpleHttpAsyncClientConnection();
 
-        AsyncHttpProcessor proc = new AsyncHttpProcessor();
-        proc.setParams(params);
+        DefaultHttpProcessor dhp = new DefaultHttpProcessor();
         // Required request interceptors
-        proc.addInterceptor(new RequestContent());
-        proc.addInterceptor(new RequestTargetHost());
+        dhp.addInterceptor(new RequestContent());
+        dhp.addInterceptor(new RequestTargetHost());
         // Recommended request interceptors
-        proc.addInterceptor(new RequestConnControl());
-        proc.addInterceptor(new RequestUserAgent());
-        // not supported: proc.addInterceptor(new RequestExpectContinue());
+        dhp.addInterceptor(new RequestConnControl());
+        dhp.addInterceptor(new RequestUserAgent());
+        // not supported: dhp.addInterceptor(new RequestExpectContinue());
+
+        AsyncHttpProcessor proc = new AsyncHttpProcessor(dhp);
+        proc.setParams(params);
 
         ConnectionReuseStrategy crs = new DefaultConnectionReuseStrategy();
 

Modified: jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/NotifiedAsyncGet.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/NotifiedAsyncGet.java?view=diff&rev=449761&r1=449760&r2=449761
==============================================================================
--- jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/NotifiedAsyncGet.java
(original)
+++ jakarta/httpcomponents/httpasync/trunk/src/examples/org/apache/http/examples/NotifiedAsyncGet.java
Mon Sep 25 10:56:48 2006
@@ -47,6 +47,7 @@
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpParams;
 import org.apache.http.impl.io.PlainSocketFactory;
+import org.apache.http.impl.protocol.DefaultHttpProcessor;
 import org.apache.http.io.SocketFactory;
 import org.apache.http.message.HttpGet;
 import org.apache.http.params.HttpParams;
@@ -261,15 +262,17 @@
 
         HttpAsyncClientConnection conn = new SimpleHttpAsyncClientConnection();
 
-        AsyncHttpProcessor proc = new AsyncHttpProcessor();
-        proc.setParams(params);
+        DefaultHttpProcessor dhp = new DefaultHttpProcessor();
         // Required request interceptors
-        proc.addInterceptor(new RequestContent());
-        proc.addInterceptor(new RequestTargetHost());
+        dhp.addInterceptor(new RequestContent());
+        dhp.addInterceptor(new RequestTargetHost());
         // Recommended request interceptors
-        proc.addInterceptor(new RequestConnControl());
-        proc.addInterceptor(new RequestUserAgent());
-        // not supported: proc.addInterceptor(new RequestExpectContinue());
+        dhp.addInterceptor(new RequestConnControl());
+        dhp.addInterceptor(new RequestUserAgent());
+        // not supported: dhp.addInterceptor(new RequestExpectContinue());
+
+        AsyncHttpProcessor proc = new AsyncHttpProcessor(dhp);
+        proc.setParams(params);
 
         ConnectionReuseStrategy crs = new DefaultConnectionReuseStrategy();
 

Modified: jakarta/httpcomponents/httpasync/trunk/src/java/org/apache/http/async/AsyncHttpProcessor.java
URL: http://svn.apache.org/viewvc/jakarta/httpcomponents/httpasync/trunk/src/java/org/apache/http/async/AsyncHttpProcessor.java?view=diff&rev=449761&r1=449760&r2=449761
==============================================================================
--- jakarta/httpcomponents/httpasync/trunk/src/java/org/apache/http/async/AsyncHttpProcessor.java
(original)
+++ jakarta/httpcomponents/httpasync/trunk/src/java/org/apache/http/async/AsyncHttpProcessor.java
Mon Sep 25 10:56:48 2006
@@ -42,6 +42,7 @@
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExecutionContext;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestExecutor;
 
 
@@ -61,10 +62,12 @@
 public class AsyncHttpProcessor extends HttpRequestExecutor {
     
     /**
-     * Create a new HTTP processor with empty default context.
+     * Create a new async HTTP processor.
+     *
+     * @param proc      the underlying HTTP processor to use
      */
-    public AsyncHttpProcessor() {
-        super();
+    public AsyncHttpProcessor(HttpProcessor proc) {
+        super(proc);
     }
 
 



Mime
View raw message