hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r793188 [1/2] - in /httpcomponents/httpcore/trunk: httpcore-nio/src/examples/org/apache/http/examples/nio/ httpcore-nio/src/test/java/org/apache/http/ httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/ httpcore-nio/src/test/java/o...
Date Sat, 11 Jul 2009 15:50:32 GMT
Author: olegk
Date: Sat Jul 11 15:50:30 2009
New Revision: 793188

URL: http://svn.apache.org/viewvc?rev=793188&view=rev
Log:
HTTPCORE-183: Added Thread-safe implementations of HttpParams and HttpProcessor - SyncBasicHttpParams and ImmutableHttpProcessor classes

Added:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/SyncBasicHttpParams.java   (with props)
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/ImmutableHttpProcessor.java   (with props)
Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClientConnManagement.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOSSLTestBase.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestBaseIOReactorSSL.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactors.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactorsSSL.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestTruncatedChunks.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpServer.java
    httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalReverseProxy.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/BasicHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/DefaultedHttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/BasicHttpProcessor.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpClient.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/mockup/TestHttpServer.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/params/TestBasicHttpParams.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/ElementalEchoServer.java Sat Jul 11 15:50:30 2009
@@ -35,7 +35,7 @@
 import java.net.InetSocketAddress;
 import java.nio.ByteBuffer;
 
-import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
 import org.apache.http.nio.reactor.EventMask;
 import org.apache.http.nio.reactor.IOEventDispatch;
@@ -46,7 +46,7 @@
 public class ElementalEchoServer {
 
     public static void main(String[] args) throws Exception {
-        HttpParams params = new BasicHttpParams(); 
+        HttpParams params = new SyncBasicHttpParams(); 
         IOEventDispatch ioEventDispatch = new DefaultIoEventDispatch();
         ListeningIOReactor ioReactor = new DefaultListeningIOReactor(2, params);
         ioReactor.listen(new InetSocketAddress(8080));

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClient.java Sat Jul 11 15:50:30 2009
@@ -39,9 +39,9 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.impl.nio.DefaultClientIOEventDispatch;
 import org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor;
 import org.apache.http.message.BasicHttpRequest;
@@ -56,9 +56,11 @@
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.ExecutionContext;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -78,7 +80,7 @@
 public class NHttpClient {
 
     public static void main(String[] args) throws Exception {
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 10000)
@@ -89,12 +91,12 @@
 
         final ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(2, params);
 
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new RequestContent());
-        httpproc.addInterceptor(new RequestTargetHost());
-        httpproc.addInterceptor(new RequestConnControl());
-        httpproc.addInterceptor(new RequestUserAgent());
-        httpproc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
         
         // We are going to use this object to synchronize between the 
         // I/O event and main threads

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClientConnManagement.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClientConnManagement.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClientConnManagement.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpClientConnManagement.java Sat Jul 11 15:50:30 2009
@@ -42,6 +42,7 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
@@ -61,12 +62,13 @@
 import org.apache.http.nio.reactor.IOReactorException;
 import org.apache.http.nio.reactor.SessionRequest;
 import org.apache.http.nio.reactor.SessionRequestCallback;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -87,7 +89,7 @@
 public class NHttpClientConnManagement {
 
     public static void main(String[] args) throws Exception {
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 10000)
@@ -96,12 +98,12 @@
             .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
             .setParameter(CoreProtocolPNames.USER_AGENT, "HttpComponents/1.1");
 
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new RequestContent());
-        httpproc.addInterceptor(new RequestTargetHost());
-        httpproc.addInterceptor(new RequestConnControl());
-        httpproc.addInterceptor(new RequestUserAgent());
-        httpproc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
         
         // Set up protocol handler
         BufferingHttpClientHandler protocolHandler = new BufferingHttpClientHandler(

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpFileServer.java Sat Jul 11 15:50:30 2009
@@ -30,7 +30,10 @@
  */
 package org.apache.http.examples.nio;
 
-import java.io.*;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InterruptedIOException;
 import java.net.InetSocketAddress;
 import java.net.URLDecoder;
 import java.nio.channels.FileChannel;
@@ -39,6 +42,7 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
@@ -61,12 +65,13 @@
 import org.apache.http.nio.protocol.SimpleNHttpRequestHandler;
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.ListeningIOReactor;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseConnControl;
 import org.apache.http.protocol.ResponseContent;
 import org.apache.http.protocol.ResponseDate;
@@ -98,7 +103,7 @@
             }
         }
 
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 20000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
@@ -106,12 +111,13 @@
             .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
             .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1");
 
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new ResponseDate());
-        httpproc.addInterceptor(new ResponseServer());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseConnControl());
-
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
+        
         AsyncNHttpServiceHandler handler = new AsyncNHttpServiceHandler(
                 httpproc,
                 new DefaultHttpResponseFactory(),

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpReverseProxy.java Sat Jul 11 15:50:30 2009
@@ -41,8 +41,10 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseFactory;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
@@ -63,16 +65,16 @@
 import org.apache.http.nio.reactor.ConnectingIOReactor;
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.ListeningIOReactor;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -109,7 +111,7 @@
         // Target host
         HttpHost targetHost = new HttpHost(hostname, port); 
         
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 30000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
@@ -124,28 +126,34 @@
         final ListeningIOReactor listeningIOReactor = new DefaultListeningIOReactor(
                 1, params);
         
-        BasicHttpProcessor originServerProc = new BasicHttpProcessor();
-        originServerProc.addInterceptor(new RequestContent());
-        originServerProc.addInterceptor(new RequestTargetHost());
-        originServerProc.addInterceptor(new RequestConnControl());
-        originServerProc.addInterceptor(new RequestUserAgent());
-        originServerProc.addInterceptor(new RequestExpectContinue());
-        
-        BasicHttpProcessor clientProxyProcessor = new BasicHttpProcessor();
-        clientProxyProcessor.addInterceptor(new ResponseDate());
-        clientProxyProcessor.addInterceptor(new ResponseServer());
-        clientProxyProcessor.addInterceptor(new ResponseContent());
-        clientProxyProcessor.addInterceptor(new ResponseConnControl());
+        // Set up HTTP protocol processor for incoming connections
+        HttpProcessor inhttpproc = new ImmutableHttpProcessor(
+                new HttpRequestInterceptor[] {
+                        new RequestContent(),
+                        new RequestTargetHost(),
+                        new RequestConnControl(),
+                        new RequestUserAgent(),
+                        new RequestExpectContinue()
+         });
+        
+        // Set up HTTP protocol processor for outgoing connections
+        HttpProcessor outhttpproc = new ImmutableHttpProcessor(
+                new HttpResponseInterceptor[] {
+                        new ResponseDate(),
+                        new ResponseServer(),
+                        new ResponseContent(),
+                        new ResponseConnControl()
+        });
         
         NHttpClientHandler connectingHandler = new ConnectingHandler(
-                originServerProc,
+                inhttpproc,
                 new DefaultConnectionReuseStrategy(),
                 params);
 
         NHttpServiceHandler listeningHandler = new ListeningHandler(
                 targetHost,
                 connectingIOReactor,
-                clientProxyProcessor, 
+                outhttpproc, 
                 new DefaultHttpResponseFactory(),
                 new DefaultConnectionReuseStrategy(),
                 params);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLClient.java Sat Jul 11 15:50:30 2009
@@ -41,6 +41,7 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.nio.SSLClientIOEventDispatch;
@@ -54,13 +55,14 @@
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.SessionRequest;
 import org.apache.http.nio.reactor.SessionRequestCallback;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -80,7 +82,7 @@
 public class NHttpSSLClient {
 
     public static void main(String[] args) throws Exception {
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 30000)
             .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 30000)
@@ -91,12 +93,12 @@
 
         final ConnectingIOReactor ioReactor = new DefaultConnectingIOReactor(2, params);
 
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new RequestContent());
-        httpproc.addInterceptor(new RequestTargetHost());
-        httpproc.addInterceptor(new RequestConnControl());
-        httpproc.addInterceptor(new RequestUserAgent());
-        httpproc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
         
         // Initialize default SSL context
         SSLContext sslcontext = SSLContext.getInstance("SSL");

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpSSLServer.java Sat Jul 11 15:50:30 2009
@@ -51,6 +51,7 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.MethodNotSupportedException;
 import org.apache.http.entity.ContentProducer;
@@ -58,7 +59,6 @@
 import org.apache.http.entity.FileEntity;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.impl.nio.SSLServerIOEventDispatch;
 import org.apache.http.impl.nio.reactor.DefaultListeningIOReactor;
 import org.apache.http.nio.NHttpConnection;
@@ -69,10 +69,12 @@
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.protocol.HttpRequestHandlerRegistry;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseConnControl;
 import org.apache.http.protocol.ResponseContent;
 import org.apache.http.protocol.ResponseDate;
@@ -108,7 +110,7 @@
         SSLContext sslcontext = SSLContext.getInstance("TLS");
         sslcontext.init(keymanagers, null, null);
         
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
@@ -116,11 +118,12 @@
             .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
             .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "Jakarta-HttpComponents-NIO/1.1");
 
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new ResponseDate());
-        httpproc.addInterceptor(new ResponseServer());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseConnControl());
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
         
         BufferingHttpServiceHandler handler = new BufferingHttpServiceHandler(
                 httpproc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/examples/org/apache/http/examples/nio/NHttpServer.java Sat Jul 11 15:50:30 2009
@@ -42,6 +42,7 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.MethodNotSupportedException;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
@@ -55,14 +56,15 @@
 import org.apache.http.nio.protocol.EventListener;
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.ListeningIOReactor;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.protocol.HttpRequestHandlerRegistry;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseConnControl;
 import org.apache.http.protocol.ResponseContent;
 import org.apache.http.protocol.ResponseDate;
@@ -86,7 +88,7 @@
             System.err.println("Please specify document root directory");
             System.exit(1);
         }
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         params
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
@@ -94,12 +96,13 @@
             .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true)
             .setParameter(CoreProtocolPNames.ORIGIN_SERVER, "HttpComponents/1.1");
 
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new ResponseDate());
-        httpproc.addInterceptor(new ResponseServer());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseConnControl());
-
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
+        
         BufferingHttpServiceHandler handler = new BufferingHttpServiceHandler(
                 httpproc,
                 new DefaultHttpResponseFactory(),

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOSSLTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOSSLTestBase.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOSSLTestBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOSSLTestBase.java Sat Jul 11 15:50:30 2009
@@ -30,7 +30,6 @@
 
 package org.apache.http;
 
-
 import java.io.IOException;
 import java.util.List;
 
@@ -39,14 +38,13 @@
 import org.apache.http.impl.nio.reactor.ExceptionEvent;
 import org.apache.http.mockup.TestHttpSSLClient;
 import org.apache.http.mockup.TestHttpSSLServer;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
+import org.apache.http.params.SyncBasicHttpParams;
 
 /**
  * Base class for all HttpCore NIO tests
- *
  */
 public class HttpCoreNIOSSLTestBase extends TestCase {
 
@@ -59,7 +57,7 @@
     
     @Override
     protected void setUp() throws Exception {
-        HttpParams serverParams = new BasicHttpParams();
+        HttpParams serverParams = new SyncBasicHttpParams();
         serverParams
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
@@ -69,7 +67,7 @@
         
         this.server = new TestHttpSSLServer(serverParams);
         
-        HttpParams clientParams = new BasicHttpParams();
+        HttpParams clientParams = new SyncBasicHttpParams();
         clientParams
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 2000)

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/HttpCoreNIOTestBase.java Sat Jul 11 15:50:30 2009
@@ -38,10 +38,10 @@
 import org.apache.http.impl.nio.reactor.ExceptionEvent;
 import org.apache.http.mockup.TestHttpClient;
 import org.apache.http.mockup.TestHttpServer;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
+import org.apache.http.params.SyncBasicHttpParams;
 
 /**
  * Base class for all HttpCore NIO tests
@@ -58,7 +58,7 @@
     
     @Override
     protected void setUp() throws Exception {
-        HttpParams serverParams = new BasicHttpParams();
+        HttpParams serverParams = new SyncBasicHttpParams();
         serverParams
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024)
@@ -68,7 +68,7 @@
 
         this.server = new TestHttpServer(serverParams);
 
-        HttpParams clientParams = new BasicHttpParams();
+        HttpParams clientParams = new SyncBasicHttpParams();
         clientParams
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 60000)
             .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 30000)

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestBaseIOReactorSSL.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestBaseIOReactorSSL.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestBaseIOReactorSSL.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestBaseIOReactorSSL.java Sat Jul 11 15:50:30 2009
@@ -48,6 +48,7 @@
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.mockup.SimpleHttpRequestHandlerResolver;
@@ -56,14 +57,15 @@
 import org.apache.http.nio.protocol.BufferingHttpServiceHandler;
 import org.apache.http.nio.protocol.EventListener;
 import org.apache.http.nio.reactor.ListenerEndpoint;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExpectationVerifier;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseConnControl;
 import org.apache.http.protocol.ResponseContent;
 import org.apache.http.protocol.ResponseDate;
@@ -75,7 +77,7 @@
 
     @Override
     protected void setUp() throws Exception {
-        HttpParams serverParams = new BasicHttpParams();
+        HttpParams serverParams = new SyncBasicHttpParams();
         serverParams
             .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 5000)
             .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 10)
@@ -99,12 +101,12 @@
             final HttpRequestHandler requestHandler,
             final HttpExpectationVerifier expectationVerifier,
             final EventListener eventListener) {
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new ResponseDate());
-        httpproc.addInterceptor(new ResponseServer());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseConnControl());
-
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
         BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 httpproc,
                 new DefaultHttpResponseFactory(),

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactors.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactors.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactors.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactors.java Sat Jul 11 15:50:30 2009
@@ -42,7 +42,9 @@
 import org.apache.http.HttpCoreNIOTestBase;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.OoopsieRuntimeException;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
@@ -58,9 +60,10 @@
 import org.apache.http.nio.reactor.IOReactorExceptionHandler;
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
-import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -151,11 +154,12 @@
             
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 serverHttpProc,
@@ -178,12 +182,12 @@
             
         };
         
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         BufferingHttpClientHandler clientHandler = new BufferingHttpClientHandler(
                 clientHttpProc,
@@ -257,11 +261,12 @@
             
         };
      
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 serverHttpProc,
@@ -274,12 +279,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         BufferingHttpClientHandler clientHandler = new BufferingHttpClientHandler(
                 clientHttpProc,
@@ -372,11 +377,12 @@
           
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 serverHttpProc,
@@ -389,12 +395,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         BufferingHttpClientHandler clientHandler = new BufferingHttpClientHandler(
                 clientHttpProc,
@@ -488,11 +494,12 @@
           
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 serverHttpProc,
@@ -505,12 +512,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         BufferingHttpClientHandler clientHandler = new BufferingHttpClientHandler(
                 clientHttpProc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactorsSSL.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactorsSSL.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactorsSSL.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultIOReactorsSSL.java Sat Jul 11 15:50:30 2009
@@ -41,7 +41,9 @@
 import org.apache.http.HttpCoreNIOSSLTestBase;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.message.BasicHttpRequest;
@@ -53,9 +55,10 @@
 import org.apache.http.nio.protocol.EventListener;
 import org.apache.http.nio.protocol.HttpRequestExecutionHandler;
 import org.apache.http.nio.reactor.ListenerEndpoint;
-import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -144,11 +147,12 @@
             
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 serverHttpProc,
@@ -171,12 +175,12 @@
             
         };
         
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         BufferingHttpClientHandler clientHandler = new BufferingHttpClientHandler(
                 clientHttpProc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestDefaultListeningIOReactor.java Sat Jul 11 15:50:30 2009
@@ -41,6 +41,7 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.nio.DefaultServerIOEventDispatch;
@@ -50,9 +51,10 @@
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.nio.reactor.ListeningIOReactor;
-import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.HttpParams;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.params.SyncBasicHttpParams;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.ResponseConnControl;
 import org.apache.http.protocol.ResponseContent;
 import org.apache.http.protocol.ResponseDate;
@@ -85,13 +87,14 @@
     
     public void testEndpointUpAndDown() throws Exception {
         
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new ResponseDate());
-        httpproc.addInterceptor(new ResponseServer());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseConnControl());
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         final BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 httpproc,
@@ -150,13 +153,14 @@
 
     public void testEndpointAlreadyBoundFatal() throws Exception {
         
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new ResponseDate());
-        httpproc.addInterceptor(new ResponseServer());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseConnControl());
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         final BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 httpproc,
@@ -210,13 +214,14 @@
     
     public void testEndpointAlreadyBoundNonFatal() throws Exception {
         
-        HttpParams params = new BasicHttpParams();
+        HttpParams params = new SyncBasicHttpParams();
         
-        BasicHttpProcessor httpproc = new BasicHttpProcessor();
-        httpproc.addInterceptor(new ResponseDate());
-        httpproc.addInterceptor(new ResponseServer());
-        httpproc.addInterceptor(new ResponseContent());
-        httpproc.addInterceptor(new ResponseConnControl());
+        HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         final BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 httpproc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestAsyncNHttpHandlers.java Sat Jul 11 15:50:30 2009
@@ -44,7 +44,9 @@
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
@@ -58,9 +60,10 @@
 import org.apache.http.nio.entity.NStringEntity;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExpectationVerifier;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -111,11 +114,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -128,12 +132,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,
@@ -340,11 +344,12 @@
             
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -359,12 +364,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,
@@ -425,11 +430,12 @@
             
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -442,12 +448,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,
@@ -588,11 +594,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -605,12 +612,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,
@@ -693,11 +700,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -710,12 +718,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,
@@ -774,11 +782,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -789,12 +798,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,
@@ -859,11 +868,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -876,12 +886,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestBufferingNHttpHandlers.java Sat Jul 11 15:50:30 2009
@@ -41,6 +41,8 @@
 import org.apache.http.HttpCoreNIOTestBase;
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
@@ -52,8 +54,9 @@
 import org.apache.http.nio.entity.NStringEntity;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -104,11 +107,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         BufferingHttpServiceHandler serviceHandler = new BufferingHttpServiceHandler(
                 serverHttpProc,
@@ -121,12 +125,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         BufferingHttpClientHandler clientHandler = new BufferingHttpClientHandler(
                 clientHttpProc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestNIOSSLHttp.java Sat Jul 11 15:50:30 2009
@@ -41,6 +41,8 @@
 import org.apache.http.HttpCoreNIOSSLTestBase;
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
@@ -52,7 +54,8 @@
 import org.apache.http.nio.entity.NStringEntity;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
+import org.apache.http.protocol.HttpProcessor;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -102,11 +105,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         AsyncNHttpServiceHandler serviceHandler = new AsyncNHttpServiceHandler(
                 serverHttpProc,
@@ -119,12 +123,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         AsyncNHttpClientHandler clientHandler = new AsyncNHttpClientHandler(
                 clientHttpProc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java?rev=793188&r1=793187&r2=793188&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/protocol/TestThrottlingNHttpHandlers.java Sat Jul 11 15:50:30 2009
@@ -55,7 +55,9 @@
 import org.apache.http.HttpEntityEnclosingRequest;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.HttpResponse;
+import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.HttpStatus;
 import org.apache.http.HttpVersion;
 import org.apache.http.entity.InputStreamEntity;
@@ -71,10 +73,11 @@
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.protocol.BasicHttpProcessor;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExpectationVerifier;
+import org.apache.http.protocol.HttpProcessor;
 import org.apache.http.protocol.HttpRequestHandler;
+import org.apache.http.protocol.ImmutableHttpProcessor;
 import org.apache.http.protocol.RequestConnControl;
 import org.apache.http.protocol.RequestContent;
 import org.apache.http.protocol.RequestExpectContinue;
@@ -141,11 +144,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         ThrottlingHttpServiceHandler serviceHandler = new ThrottlingHttpServiceHandler(
                 serverHttpProc,
@@ -159,12 +163,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
         
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         ThrottlingHttpClientHandler clientHandler = new ThrottlingHttpClientHandler(
                 clientHttpProc,
@@ -354,11 +358,12 @@
             
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         ThrottlingHttpServiceHandler serviceHandler = new ThrottlingHttpServiceHandler(
                 serverHttpProc,
@@ -372,12 +377,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
         
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         ThrottlingHttpClientHandler clientHandler = new ThrottlingHttpClientHandler(
                 clientHttpProc,
@@ -520,11 +525,12 @@
             
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         ThrottlingHttpServiceHandler serviceHandler = new ThrottlingHttpServiceHandler(
                 serverHttpProc,
@@ -540,12 +546,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
         
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         ThrottlingHttpClientHandler clientHandler = new ThrottlingHttpClientHandler(
                 clientHttpProc,
@@ -608,11 +614,12 @@
             
         };
         
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         ThrottlingHttpServiceHandler serviceHandler = new ThrottlingHttpServiceHandler(
                 serverHttpProc,
@@ -626,12 +633,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
 
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         ThrottlingHttpClientHandler clientHandler = new ThrottlingHttpClientHandler(
                 clientHttpProc,
@@ -713,11 +720,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         ThrottlingHttpServiceHandler serviceHandler = new ThrottlingHttpServiceHandler(
                 serverHttpProc,
@@ -731,12 +739,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
         
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         ThrottlingHttpClientHandler clientHandler = new ThrottlingHttpClientHandler(
                 clientHttpProc,
@@ -860,11 +868,12 @@
             queue.add(jobs[i]); 
         }
 
-        BasicHttpProcessor serverHttpProc = new BasicHttpProcessor();
-        serverHttpProc.addInterceptor(new ResponseDate());
-        serverHttpProc.addInterceptor(new ResponseServer());
-        serverHttpProc.addInterceptor(new ResponseContent());
-        serverHttpProc.addInterceptor(new ResponseConnControl());
+        HttpProcessor serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
+                new ResponseDate(),
+                new ResponseServer(),
+                new ResponseContent(),
+                new ResponseConnControl()
+        });
 
         ThrottlingHttpServiceHandler serviceHandler = new ThrottlingHttpServiceHandler(
                 serverHttpProc,
@@ -878,12 +887,12 @@
         serviceHandler.setEventListener(
                 new SimpleEventListener());
         
-        BasicHttpProcessor clientHttpProc = new BasicHttpProcessor();
-        clientHttpProc.addInterceptor(new RequestContent());
-        clientHttpProc.addInterceptor(new RequestTargetHost());
-        clientHttpProc.addInterceptor(new RequestConnControl());
-        clientHttpProc.addInterceptor(new RequestUserAgent());
-        clientHttpProc.addInterceptor(new RequestExpectContinue());
+        HttpProcessor clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
+                new RequestContent(),
+                new RequestTargetHost(),
+                new RequestConnControl(),
+                new RequestUserAgent(),
+                new RequestExpectContinue()});
 
         ThrottlingHttpClientHandler clientHandler = new ThrottlingHttpClientHandler(
                 clientHttpProc,



Mime
View raw message