hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1393494 - in /httpcomponents/httpcore/trunk/httpcore-nio/src: main/java/org/apache/http/impl/nio/ test/java/org/apache/http/impl/nio/reactor/ test/java/org/apache/http/nio/integration/ test/java/org/apache/http/testserver/
Date Wed, 03 Oct 2012 13:58:12 GMT
Author: olegk
Date: Wed Oct  3 13:58:11 2012
New Revision: 1393494

URL: http://svn.apache.org/viewvc?rev=1393494&view=rev
Log:
Configuration API changes: non-blocking connection factories are no longer dependent on HttpParams

Modified:
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.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/TestSessionInOutBuffers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestAsyncNHttpHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlerCancellable.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpsAsyncHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestPipelining.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestThrottlingNHttpHandlers.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestTruncatedChunks.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingClientConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLClientConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLServerConnectionFactory.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingServerConnectionFactory.java

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpClientConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -26,11 +26,14 @@
  */
 package org.apache.http.impl.nio;
 
+import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseFactory;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.impl.DefaultHttpResponseFactory;
+import org.apache.http.impl.nio.codecs.DefaultHttpResponseParserFactory;
 import org.apache.http.nio.NHttpClientConnection;
 import org.apache.http.nio.NHttpConnectionFactory;
+import org.apache.http.nio.NHttpMessageParserFactory;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
@@ -40,17 +43,7 @@ import org.apache.http.params.HttpParams
 import org.apache.http.util.Args;
 
 /**
- * Factory for plain (non-encrypted), non-blocking {@link NHttpClientConnection}s.
- * <p>
- * The following parameters can be used to customize the behavior of this
- * class:
- * <ul>
- *  <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SOCKET_BUFFER_SIZE}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_HEADER_COUNT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_LINE_LENGTH}</li>
- * </ul>
+ * Default factory for plain (non-encrypted), non-blocking {@link NHttpClientConnection}s.
  *
  * @since 4.2
  */
@@ -58,10 +51,17 @@ import org.apache.http.util.Args;
 public class DefaultNHttpClientConnectionFactory
     implements NHttpConnectionFactory<DefaultNHttpClientConnection> {
 
+    private final NHttpMessageParserFactory<HttpResponse> responseParserFactory;
     private final HttpResponseFactory responseFactory;
     private final ByteBufferAllocator allocator;
     private final HttpParams params;
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory(
+     *     ByteBufferAllocator, HttpResponseFactory)}
+     */
+    @Deprecated
     public DefaultNHttpClientConnectionFactory(
             final HttpResponseFactory responseFactory,
             final ByteBufferAllocator allocator,
@@ -73,12 +73,42 @@ public class DefaultNHttpClientConnectio
         this.responseFactory = responseFactory;
         this.allocator = allocator;
         this.params = params;
+        this.responseParserFactory = null;
     }
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory()}
+     */
+    @Deprecated
     public DefaultNHttpClientConnectionFactory(final HttpParams params) {
         this(DefaultHttpResponseFactory.INSTANCE, HeapByteBufferAllocator.INSTANCE, params);
     }
 
+    /**
+     * @since 4.3
+     */
+    public DefaultNHttpClientConnectionFactory(
+            final ByteBufferAllocator allocator,
+            final HttpResponseFactory responseFactory) {
+        super();
+        this.responseFactory = responseFactory;
+        this.allocator = allocator;
+        this.responseParserFactory = new DefaultHttpResponseParserFactory(null, responseFactory);
+        this.params = null;
+    }
+
+    /**
+     * @since 4.3
+     */
+    public DefaultNHttpClientConnectionFactory() {
+        this(null, null);
+    }
+
+    /**
+     * @deprecated (4.3) no longer used.
+     */
+    @Deprecated
     protected DefaultNHttpClientConnection createConnection(
             final IOSession session,
             final HttpResponseFactory responseFactory,
@@ -88,11 +118,19 @@ public class DefaultNHttpClientConnectio
     }
 
     public DefaultNHttpClientConnection createConnection(final IOSession session) {
-        DefaultNHttpClientConnection conn = createConnection(session, this.responseFactory,
-                this.allocator, this.params);
-        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
-        conn.setSocketTimeout(timeout);
-        return conn;
+        if (this.params != null) {
+            DefaultNHttpClientConnection conn = createConnection(session, this.responseFactory,
+                    this.allocator, this.params);
+            int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
+            conn.setSocketTimeout(timeout);
+            return conn;
+        } else {
+            return new DefaultNHttpClientConnection(
+                    session, 8 * 1024,
+                    this.allocator,
+                    null, null, null, null, null, null,
+                    this.responseParserFactory);
+        }
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/DefaultNHttpServerConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -26,10 +26,14 @@
  */
 package org.apache.http.impl.nio;
 
+import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestFactory;
+import org.apache.http.HttpResponseFactory;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.impl.DefaultHttpRequestFactory;
+import org.apache.http.impl.nio.codecs.DefaultHttpRequestParserFactory;
 import org.apache.http.nio.NHttpConnectionFactory;
+import org.apache.http.nio.NHttpMessageParserFactory;
 import org.apache.http.nio.NHttpServerConnection;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.util.ByteBufferAllocator;
@@ -40,17 +44,7 @@ import org.apache.http.params.HttpParams
 import org.apache.http.util.Args;
 
 /**
- * Factory for plain (non-encrypted), non-blocking {@link NHttpServerConnection}s.
- * <p>
- * The following parameters can be used to customize the behavior of this
- * class:
- * <ul>
- *  <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SOCKET_BUFFER_SIZE}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_HEADER_COUNT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_LINE_LENGTH}</li>
- * </ul>
+ * Default factory for plain (non-encrypted), non-blocking {@link NHttpServerConnection}s.
  *
  * @since 4.2
  */
@@ -58,10 +52,17 @@ import org.apache.http.util.Args;
 public class DefaultNHttpServerConnectionFactory
     implements NHttpConnectionFactory<DefaultNHttpServerConnection> {
 
+    private final NHttpMessageParserFactory<HttpRequest> requestParserFactory;
     private final HttpRequestFactory requestFactory;
     private final ByteBufferAllocator allocator;
     private final HttpParams params;
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory(
+     *     ByteBufferAllocator, HttpResponseFactory)}
+     */
+    @Deprecated
     public DefaultNHttpServerConnectionFactory(
             final HttpRequestFactory requestFactory,
             final ByteBufferAllocator allocator,
@@ -73,12 +74,23 @@ public class DefaultNHttpServerConnectio
         this.requestFactory = requestFactory;
         this.allocator = allocator;
         this.params = params;
+        this.requestParserFactory = null;
     }
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory(
+     *     ByteBufferAllocator, HttpResponseFactory)}
+     */
+    @Deprecated
     public DefaultNHttpServerConnectionFactory(final HttpParams params) {
         this(DefaultHttpRequestFactory.INSTANCE, HeapByteBufferAllocator.INSTANCE, params);
     }
 
+    /**
+     * @deprecated (4.3) no longer used.
+     */
+    @Deprecated
     protected DefaultNHttpServerConnection createConnection(
             final IOSession session,
             final HttpRequestFactory requestFactory,
@@ -87,12 +99,40 @@ public class DefaultNHttpServerConnectio
         return new DefaultNHttpServerConnection(session, requestFactory, allocator, params);
     }
 
+    /**
+     * @since 4.3
+     */
+    public DefaultNHttpServerConnectionFactory(
+            final ByteBufferAllocator allocator,
+            final HttpRequestFactory requestFactory) {
+        super();
+        this.requestFactory = requestFactory;
+        this.allocator = allocator;
+        this.requestParserFactory = new DefaultHttpRequestParserFactory(null, requestFactory);
+        this.params = null;
+    }
+
+    /**
+     * @since 4.3
+     */
+    public DefaultNHttpServerConnectionFactory() {
+        this(null, null);
+    }
+
     public DefaultNHttpServerConnection createConnection(final IOSession session) {
-        DefaultNHttpServerConnection conn = createConnection(
-                session, this.requestFactory, this.allocator, this.params);
-        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
-        conn.setSocketTimeout(timeout);
-        return conn;
+        if (this.params != null) {
+            DefaultNHttpServerConnection conn = createConnection(
+                    session, this.requestFactory, this.allocator, this.params);
+            int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
+            conn.setSocketTimeout(timeout);
+            return conn;
+        } else {
+            return new DefaultNHttpServerConnection(session, 8 * 1024,
+                    this.allocator,
+                    null, null, null, null, null,
+                    this.requestParserFactory,
+                    null);
+        }
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpClientConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -28,11 +28,14 @@ package org.apache.http.impl.nio;
 
 import javax.net.ssl.SSLContext;
 
+import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseFactory;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.impl.DefaultHttpResponseFactory;
+import org.apache.http.impl.nio.codecs.DefaultHttpResponseParserFactory;
 import org.apache.http.nio.NHttpClientConnection;
 import org.apache.http.nio.NHttpConnectionFactory;
+import org.apache.http.nio.NHttpMessageParserFactory;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.ssl.SSLIOSession;
 import org.apache.http.nio.reactor.ssl.SSLMode;
@@ -45,17 +48,7 @@ import org.apache.http.params.HttpParams
 import org.apache.http.util.Args;
 
 /**
- * Factory for SSL encrypted, non-blocking {@link NHttpClientConnection}s.
- * <p>
- * The following parameters can be used to customize the behavior of this
- * class:
- * <ul>
- *  <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SOCKET_BUFFER_SIZE}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_HEADER_COUNT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_LINE_LENGTH}</li>
- * </ul>
+ * Default factory for SSL encrypted, non-blocking {@link NHttpClientConnection}s.
  *
  * @since 4.2
  */
@@ -63,12 +56,19 @@ import org.apache.http.util.Args;
 public class SSLNHttpClientConnectionFactory
     implements NHttpConnectionFactory<DefaultNHttpClientConnection> {
 
+    private final NHttpMessageParserFactory<HttpResponse> responseParserFactory;
     private final HttpResponseFactory responseFactory;
     private final ByteBufferAllocator allocator;
     private final SSLContext sslcontext;
     private final SSLSetupHandler sslHandler;
     private final HttpParams params;
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   SSLNHttpClientConnectionFactory#SSLNHttpClientConnectionFactory(SSLContext,
+     *     SSLSetupHandler, HttpResponseFactory, ByteBufferAllocator)}
+     */
+    @Deprecated
     public SSLNHttpClientConnectionFactory(
             final SSLContext sslcontext,
             final SSLSetupHandler sslHandler,
@@ -84,8 +84,15 @@ public class SSLNHttpClientConnectionFac
         this.responseFactory = responseFactory;
         this.allocator = allocator;
         this.params = params;
+        this.responseParserFactory = null;
     }
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   SSLNHttpClientConnectionFactory#SSLNHttpClientConnectionFactory(SSLContext,
+     *     SSLSetupHandler)}
+     */
+    @Deprecated
     public SSLNHttpClientConnectionFactory(
             final SSLContext sslcontext,
             final SSLSetupHandler sslHandler,
@@ -94,10 +101,48 @@ public class SSLNHttpClientConnectionFac
                 HeapByteBufferAllocator.INSTANCE, params);
     }
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   SSLNHttpClientConnectionFactory#SSLNHttpClientConnectionFactory()}
+     */
+    @Deprecated
     public SSLNHttpClientConnectionFactory(final HttpParams params) {
         this(null, null, params);
     }
 
+    /**
+     * @since 4.3
+     */
+    public SSLNHttpClientConnectionFactory(
+            final SSLContext sslcontext,
+            final SSLSetupHandler sslHandler,
+            final HttpResponseFactory responseFactory,
+            final ByteBufferAllocator allocator) {
+        super();
+        this.sslcontext = sslcontext;
+        this.sslHandler = sslHandler;
+        this.responseFactory = responseFactory;
+        this.allocator = allocator;
+        this.responseParserFactory = new DefaultHttpResponseParserFactory(null, responseFactory);
+        this.params = null;
+    }
+
+    /**
+     * @since 4.3
+     */
+    public SSLNHttpClientConnectionFactory(
+            final SSLContext sslcontext,
+            final SSLSetupHandler sslHandler) {
+        this(sslcontext, sslHandler, null, null);
+    }
+
+    /**
+     * @since 4.3
+     */
+    public SSLNHttpClientConnectionFactory() {
+        this(null, null, null, null);
+    }
+
     private SSLContext getDefaultSSLContext() {
         SSLContext sslcontext;
         try {
@@ -109,6 +154,10 @@ public class SSLNHttpClientConnectionFac
         return sslcontext;
     }
 
+    /**
+     * @deprecated (4.3) no longer used.
+     */
+    @Deprecated
     protected DefaultNHttpClientConnection createConnection(
             final IOSession session,
             final HttpResponseFactory responseFactory,
@@ -117,15 +166,35 @@ public class SSLNHttpClientConnectionFac
         return new DefaultNHttpClientConnection(session, responseFactory, allocator, params);
     }
 
-    public DefaultNHttpClientConnection createConnection(final IOSession session) {
-        SSLContext sslcontext = this.sslcontext != null ? this.sslcontext : getDefaultSSLContext();
-        SSLIOSession ssliosession = new SSLIOSession(session, SSLMode.CLIENT, sslcontext, this.sslHandler);
-        session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
-        DefaultNHttpClientConnection conn = createConnection(
-                ssliosession, this.responseFactory, this.allocator, this.params);
-        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
-        conn.setSocketTimeout(timeout);
-        return conn;
+    /**
+     * @since 4.3
+     */
+    protected SSLIOSession createSSLIOSession(
+            final IOSession iosession,
+            final SSLContext sslcontext,
+            final SSLSetupHandler sslHandler) {
+        SSLIOSession ssliosession = new SSLIOSession(iosession, SSLMode.CLIENT,
+                (sslcontext != null ? sslcontext : getDefaultSSLContext()),
+                sslHandler);
+        iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
+        return ssliosession;
+    }
+
+    public DefaultNHttpClientConnection createConnection(final IOSession iosession) {
+        SSLIOSession ssliosession = createSSLIOSession(iosession, this.sslcontext, this.sslHandler);
+        if (this.params != null) {
+            DefaultNHttpClientConnection conn = createConnection(
+                    ssliosession, this.responseFactory, this.allocator, this.params);
+            int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
+            conn.setSocketTimeout(timeout);
+            return conn;
+        } else {
+            return new DefaultNHttpClientConnection(
+                    ssliosession, 8 * 1024,
+                    this.allocator,
+                    null, null, null, null, null, null,
+                    this.responseParserFactory);
+        }
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/SSLNHttpServerConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -28,10 +28,14 @@ package org.apache.http.impl.nio;
 
 import javax.net.ssl.SSLContext;
 
+import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestFactory;
+import org.apache.http.HttpResponseFactory;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.impl.DefaultHttpRequestFactory;
+import org.apache.http.impl.nio.codecs.DefaultHttpRequestParserFactory;
 import org.apache.http.nio.NHttpConnectionFactory;
+import org.apache.http.nio.NHttpMessageParserFactory;
 import org.apache.http.nio.NHttpServerConnection;
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.ssl.SSLIOSession;
@@ -45,17 +49,7 @@ import org.apache.http.params.HttpParams
 import org.apache.http.util.Args;
 
 /**
- * Factory for SSL encrypted, non-blocking {@link NHttpServerConnection}s.
- * <p>
- * The following parameters can be used to customize the behavior of this
- * class:
- * <ul>
- *  <li>{@link org.apache.http.params.CoreProtocolPNames#HTTP_ELEMENT_CHARSET}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SO_TIMEOUT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#SOCKET_BUFFER_SIZE}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_HEADER_COUNT}</li>
- *  <li>{@link org.apache.http.params.CoreConnectionPNames#MAX_LINE_LENGTH}</li>
- * </ul>
+ * Default factory for SSL encrypted, non-blocking {@link NHttpServerConnection}s.
  *
  * @since 4.2
  */
@@ -63,12 +57,19 @@ import org.apache.http.util.Args;
 public class SSLNHttpServerConnectionFactory
     implements NHttpConnectionFactory<DefaultNHttpServerConnection> {
 
+    private final NHttpMessageParserFactory<HttpRequest> requestParserFactory;
     private final HttpRequestFactory requestFactory;
     private final ByteBufferAllocator allocator;
     private final SSLContext sslcontext;
     private final SSLSetupHandler sslHandler;
     private final HttpParams params;
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory(
+     *     ByteBufferAllocator, HttpResponseFactory)}
+     */
+    @Deprecated
     public SSLNHttpServerConnectionFactory(
             final SSLContext sslcontext,
             final SSLSetupHandler sslHandler,
@@ -84,8 +85,15 @@ public class SSLNHttpServerConnectionFac
         this.requestFactory = requestFactory;
         this.allocator = allocator;
         this.params = params;
+        this.requestParserFactory = null;
     }
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory(
+     *     ByteBufferAllocator, HttpResponseFactory)}
+     */
+    @Deprecated
     public SSLNHttpServerConnectionFactory(
             final SSLContext sslcontext,
             final SSLSetupHandler sslHandler,
@@ -94,10 +102,49 @@ public class SSLNHttpServerConnectionFac
                 HeapByteBufferAllocator.INSTANCE, params);
     }
 
+    /**
+     * @deprecated (4.3) use {@link
+     *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory(
+     *     ByteBufferAllocator, HttpResponseFactory)}
+     */
+    @Deprecated
     public SSLNHttpServerConnectionFactory(final HttpParams params) {
         this(null, null, params);
     }
 
+    /**
+     * @since 4.3
+     */
+    public SSLNHttpServerConnectionFactory(
+            final SSLContext sslcontext,
+            final SSLSetupHandler sslHandler,
+            final HttpRequestFactory requestFactory,
+            final ByteBufferAllocator allocator) {
+        super();
+        this.sslcontext = sslcontext;
+        this.sslHandler = sslHandler;
+        this.requestFactory = requestFactory;
+        this.allocator = allocator;
+        this.requestParserFactory = new DefaultHttpRequestParserFactory(null, requestFactory);
+        this.params = null;
+    }
+
+    /**
+     * @since 4.3
+     */
+    public SSLNHttpServerConnectionFactory(
+            final SSLContext sslcontext,
+            final SSLSetupHandler sslHandler) {
+        this(sslcontext, sslHandler, null, null);
+    }
+
+    /**
+     * @since 4.3
+     */
+    public SSLNHttpServerConnectionFactory() {
+        this(null, null, null, null);
+    }
+
     private SSLContext getDefaultSSLContext() {
         SSLContext sslcontext;
         try {
@@ -109,6 +156,10 @@ public class SSLNHttpServerConnectionFac
         return sslcontext;
     }
 
+    /**
+     * @deprecated (4.3) no longer used.
+     */
+    @Deprecated
     protected DefaultNHttpServerConnection createConnection(
             final IOSession session,
             final HttpRequestFactory requestFactory,
@@ -117,15 +168,35 @@ public class SSLNHttpServerConnectionFac
         return new DefaultNHttpServerConnection(session, requestFactory, allocator, params);
     }
 
-    public DefaultNHttpServerConnection createConnection(final IOSession session) {
-        SSLContext sslcontext = this.sslcontext != null ? this.sslcontext : getDefaultSSLContext();
-        SSLIOSession ssliosession = new SSLIOSession(session, SSLMode.SERVER, sslcontext, this.sslHandler);
-        session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
-        DefaultNHttpServerConnection conn =  createConnection(
-                ssliosession, this.requestFactory, this.allocator, this.params);
-        int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
-        conn.setSocketTimeout(timeout);
-        return conn;
+    /**
+     * @since 4.3
+     */
+    protected SSLIOSession createSSLIOSession(
+            final IOSession iosession,
+            final SSLContext sslcontext,
+            final SSLSetupHandler sslHandler) {
+        SSLIOSession ssliosession = new SSLIOSession(iosession, SSLMode.SERVER,
+                (sslcontext != null ? sslcontext : getDefaultSSLContext()),
+                sslHandler);
+        iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
+        return ssliosession;
+    }
+
+    public DefaultNHttpServerConnection createConnection(final IOSession iosession) {
+        SSLIOSession ssliosession = createSSLIOSession(iosession, this.sslcontext, this.sslHandler);
+        if (this.params != null) {
+            DefaultNHttpServerConnection conn = createConnection(
+                    ssliosession, this.requestFactory, this.allocator, this.params);
+            int timeout = Config.getInt(this.params, CoreConnectionPNames.SO_TIMEOUT, 0);
+            conn.setSocketTimeout(timeout);
+            return conn;
+        } else {
+            return new DefaultNHttpServerConnection(ssliosession, 8 * 1024,
+                    this.allocator,
+                    null, null, null, null, null,
+                    this.requestParserFactory,
+                    null);
+        }
     }
 
 }

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=1393494&r1=1393493&r2=1393494&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 Wed Oct  3 13:58:11 2012
@@ -51,7 +51,6 @@ import org.apache.http.nio.NHttpServiceH
 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.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExpectationVerifier;
 import org.apache.http.protocol.HttpRequestHandler;
@@ -79,15 +78,13 @@ public class TestBaseIOReactorSSL extend
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingSSLServerConnectionFactory(SSLTestContexts.createServerSSLContext(), params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingSSLServerConnectionFactory(SSLTestContexts.createServerSSLContext());
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingSSLClientConnectionFactory(SSLTestContexts.createClientSSLContext(), params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingSSLClientConnectionFactory(SSLTestContexts.createClientSSLContext());
     }
 
     private NHttpServiceHandler createHttpServiceHandler(

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=1393494&r1=1393493&r2=1393494&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 Wed Oct  3 13:58:11 2012
@@ -60,7 +60,6 @@ import org.apache.http.nio.reactor.IORea
 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.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.testserver.HttpCoreNIOTestBase;
@@ -91,15 +90,13 @@ public class TestDefaultIOReactors exten
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     @Test

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=1393494&r1=1393493&r2=1393494&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 Wed Oct  3 13:58:11 2012
@@ -30,7 +30,6 @@ package org.apache.http.impl.nio.reactor
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
 import org.apache.http.impl.nio.DefaultNHttpServerConnection;
 import org.apache.http.nio.NHttpConnectionFactory;
-import org.apache.http.params.HttpParams;
 import org.apache.http.testserver.LoggingSSLClientConnectionFactory;
 import org.apache.http.testserver.LoggingSSLServerConnectionFactory;
 import org.apache.http.testserver.SSLTestContexts;
@@ -42,15 +41,13 @@ import org.apache.http.testserver.SSLTes
 public class TestDefaultIOReactorsSSL extends TestDefaultIOReactors {
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingSSLServerConnectionFactory(SSLTestContexts.createServerSSLContext(), params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingSSLServerConnectionFactory(SSLTestContexts.createServerSSLContext());
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingSSLClientConnectionFactory(SSLTestContexts.createClientSSLContext(), params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingSSLClientConnectionFactory(SSLTestContexts.createClientSSLContext());
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestSessionInOutBuffers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestSessionInOutBuffers.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestSessionInOutBuffers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestSessionInOutBuffers.java Wed Oct  3 13:58:11 2012
@@ -61,20 +61,20 @@ import org.junit.runners.Parameterized.P
 public class TestSessionInOutBuffers {
 
     private ByteBufferAllocator allocator;
-    
+
     public TestSessionInOutBuffers(final ByteBufferAllocator allocator) {
         super();
         this.allocator = allocator;
     }
-    
+
     @Parameters
     public static Collection<Object[]> getParameters() {
-        
+
         return Arrays.asList(
-                new Object[] { HeapByteBufferAllocator.INSTANCE }, 
+                new Object[] { HeapByteBufferAllocator.INSTANCE },
                 new Object[] { DirectByteBufferAllocator.INSTANCE });
     }
-    
+
     private static WritableByteChannel newChannel(final ByteArrayOutputStream outstream) {
         return Channels.newChannel(outstream);
     }
@@ -426,7 +426,7 @@ public class TestSessionInOutBuffers {
         String s2 = constructString(RUSSIAN_HELLO);
         String s3 = "Like hello and stuff";
 
-        SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16, 
+        SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16,
                 Consts.UTF_8.newEncoder(), this.allocator);
 
         for (int i = 0; i < 10; i++) {
@@ -442,7 +442,7 @@ public class TestSessionInOutBuffers {
         byte[] tmp = outstream.toByteArray();
 
         ReadableByteChannel channel = newChannel(tmp);
-        SessionInputBuffer inbuf = new SessionInputBufferImpl(16, 16, 
+        SessionInputBuffer inbuf = new SessionInputBufferImpl(16, 16,
                 Consts.UTF_8.newDecoder(), this.allocator);
 
         while (inbuf.fill(channel) > 0) {

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestAsyncNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestAsyncNHttpHandlers.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestAsyncNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestAsyncNHttpHandlers.java Wed Oct  3 13:58:11 2012
@@ -62,7 +62,6 @@ import org.apache.http.nio.reactor.IORea
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.nio.reactor.SessionRequest;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExpectationVerifier;
 import org.apache.http.protocol.HttpProcessor;
@@ -106,15 +105,13 @@ public class TestAsyncNHttpHandlers exte
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     private void executeStandardTest(

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlerCancellable.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlerCancellable.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlerCancellable.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlerCancellable.java Wed Oct  3 13:58:11 2012
@@ -60,7 +60,6 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper;
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
-import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.testserver.HttpCoreNIOTestBase;
 import org.apache.http.testserver.LoggingClientConnectionFactory;
@@ -83,15 +82,13 @@ public class TestHttpAsyncHandlerCancell
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     @Test

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncHandlers.java Wed Oct  3 13:58:11 2012
@@ -68,7 +68,6 @@ import org.apache.http.nio.protocol.UriH
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
@@ -106,15 +105,13 @@ public class TestHttpAsyncHandlers exten
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     private InetSocketAddress start(

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpAsyncPrematureTermination.java Wed Oct  3 13:58:11 2012
@@ -61,7 +61,6 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper;
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
-import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
@@ -89,15 +88,13 @@ public class TestHttpAsyncPrematureTermi
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     private InetSocketAddress start(

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpsAsyncHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpsAsyncHandlers.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpsAsyncHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestHttpsAsyncHandlers.java Wed Oct  3 13:58:11 2012
@@ -30,7 +30,6 @@ package org.apache.http.nio.integration;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
 import org.apache.http.impl.nio.DefaultNHttpServerConnection;
 import org.apache.http.nio.NHttpConnectionFactory;
-import org.apache.http.params.HttpParams;
 import org.apache.http.testserver.LoggingSSLClientConnectionFactory;
 import org.apache.http.testserver.LoggingSSLServerConnectionFactory;
 import org.apache.http.testserver.SSLTestContexts;
@@ -41,15 +40,13 @@ import org.apache.http.testserver.SSLTes
 public class TestHttpsAsyncHandlers extends TestHttpAsyncHandlers {
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingSSLServerConnectionFactory(SSLTestContexts.createServerSSLContext(), params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingSSLServerConnectionFactory(SSLTestContexts.createServerSSLContext());
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingSSLClientConnectionFactory(SSLTestContexts.createClientSSLContext(), params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingSSLClientConnectionFactory(SSLTestContexts.createClientSSLContext());
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestPipelining.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestPipelining.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestPipelining.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestPipelining.java Wed Oct  3 13:58:11 2012
@@ -59,7 +59,6 @@ import org.apache.http.nio.protocol.Http
 import org.apache.http.nio.protocol.UriHttpAsyncRequestHandlerMapper;
 import org.apache.http.nio.reactor.IOReactorStatus;
 import org.apache.http.nio.reactor.ListenerEndpoint;
-import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpRequestHandler;
 import org.apache.http.protocol.ImmutableHttpProcessor;
@@ -95,15 +94,13 @@ public class TestPipelining extends Http
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     @Test

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestThrottlingNHttpHandlers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestThrottlingNHttpHandlers.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestThrottlingNHttpHandlers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestThrottlingNHttpHandlers.java Wed Oct  3 13:58:11 2012
@@ -66,7 +66,6 @@ import org.apache.http.nio.reactor.IORea
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.nio.reactor.SessionRequest;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpExpectationVerifier;
@@ -113,15 +112,13 @@ public class TestThrottlingNHttpHandlers
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new LoggingServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     private ExecutorService execService;

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestTruncatedChunks.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestTruncatedChunks.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestTruncatedChunks.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/nio/integration/TestTruncatedChunks.java Wed Oct  3 13:58:11 2012
@@ -37,7 +37,6 @@ import java.util.concurrent.Future;
 import org.apache.http.Consts;
 import org.apache.http.HttpEntity;
 import org.apache.http.HttpHost;
-import org.apache.http.HttpRequestFactory;
 import org.apache.http.HttpResponse;
 import org.apache.http.HttpStatus;
 import org.apache.http.MalformedChunkCodingException;
@@ -49,7 +48,6 @@ import org.apache.http.impl.DefaultConne
 import org.apache.http.impl.io.HttpTransportMetricsImpl;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
 import org.apache.http.impl.nio.DefaultNHttpServerConnection;
-import org.apache.http.impl.nio.DefaultNHttpServerConnectionFactory;
 import org.apache.http.impl.nio.codecs.AbstractContentEncoder;
 import org.apache.http.message.BasicHttpRequest;
 import org.apache.http.nio.ContentDecoder;
@@ -68,10 +66,8 @@ import org.apache.http.nio.reactor.IORea
 import org.apache.http.nio.reactor.IOSession;
 import org.apache.http.nio.reactor.ListenerEndpoint;
 import org.apache.http.nio.reactor.SessionOutputBuffer;
-import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
 import org.apache.http.nio.util.SimpleInputBuffer;
-import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.testserver.HttpCoreNIOTestBase;
 import org.apache.http.testserver.LoggingClientConnectionFactory;
@@ -103,15 +99,13 @@ public class TestTruncatedChunks extends
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new CustomServerConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory() throws Exception {
+        return new CustomServerConnectionFactory();
     }
 
     @Override
-    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            final HttpParams params) throws Exception {
-        return new LoggingClientConnectionFactory(params);
+    protected NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory() throws Exception {
+        return new LoggingClientConnectionFactory();
     }
 
     private static final byte[] GARBAGE = new byte[] {'1', '2', '3', '4', '5' };
@@ -158,33 +152,27 @@ public class TestTruncatedChunks extends
 
     }
 
-    static class CustomServerConnectionFactory extends DefaultNHttpServerConnectionFactory {
+    static class CustomServerConnectionFactory implements NHttpConnectionFactory<DefaultNHttpServerConnection> {
 
-        public CustomServerConnectionFactory(final HttpParams params) {
-            super(params);
+        public CustomServerConnectionFactory() {
+            super();
         }
 
-        @Override
-        protected DefaultNHttpServerConnection createConnection(
-                final IOSession session,
-                final HttpRequestFactory requestFactory,
-                final ByteBufferAllocator allocator,
-                final HttpParams params) {
-
-            return new LoggingNHttpServerConnection(session, requestFactory, allocator, params) {
-
-                        @Override
-                        protected ContentEncoder createContentEncoder(
-                                final long len,
-                                final WritableByteChannel channel,
-                                final SessionOutputBuffer buffer,
-                                final HttpTransportMetricsImpl metrics) {
-                            if (len == ContentLengthStrategy.CHUNKED) {
-                                return new BrokenChunkEncoder(channel, buffer, metrics);
-                            } else {
-                                return super.createContentEncoder(len, channel, buffer, metrics);
-                            }
-                        }
+        public DefaultNHttpServerConnection createConnection(final IOSession session) {
+            return new LoggingNHttpServerConnection(session) {
+
+                @Override
+                protected ContentEncoder createContentEncoder(
+                        final long len,
+                        final WritableByteChannel channel,
+                        final SessionOutputBuffer buffer,
+                        final HttpTransportMetricsImpl metrics) {
+                    if (len == ContentLengthStrategy.CHUNKED) {
+                        return new BrokenChunkEncoder(channel, buffer, metrics);
+                    } else {
+                        return super.createContentEncoder(len, channel, buffer, metrics);
+                    }
+                }
 
             };
         }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/HttpCoreNIOTestBase.java Wed Oct  3 13:58:11 2012
@@ -66,11 +66,11 @@ public abstract class HttpCoreNIOTestBas
     protected BasicNIOConnPool connpool;
     protected HttpAsyncRequester executor;
 
-    protected abstract NHttpConnectionFactory<DefaultNHttpServerConnection> createServerConnectionFactory(
-            HttpParams params) throws Exception;
+    protected abstract NHttpConnectionFactory<DefaultNHttpServerConnection>
+        createServerConnectionFactory() throws Exception;
 
-    protected abstract NHttpConnectionFactory<DefaultNHttpClientConnection> createClientConnectionFactory(
-            HttpParams params) throws Exception;
+    protected abstract NHttpConnectionFactory<DefaultNHttpClientConnection>
+        createClientConnectionFactory() throws Exception;
 
     public void initServer() throws Exception {
         this.serverParams = new HttpCoreConfigBuilder()
@@ -78,7 +78,7 @@ public abstract class HttpCoreNIOTestBas
             .setSocketBufferSize(8 * 1024)
             .setTcpNoDelay(true)
             .setOriginServer("TEST-SERVER/1.1").build();
-        this.server = new HttpServerNio(createServerConnectionFactory(this.serverParams));
+        this.server = new HttpServerNio(createServerConnectionFactory());
         this.server.setExceptionHandler(new SimpleIOReactorExceptionHandler());
         this.serverHttpProc = new ImmutableHttpProcessor(new HttpResponseInterceptor[] {
                 new ResponseDate(),
@@ -95,7 +95,7 @@ public abstract class HttpCoreNIOTestBas
             .setSocketBufferSize(8 * 1024)
             .setTcpNoDelay(true)
             .setUserAgent("TEST-CLIENT/1.1").build();
-        this.client = new HttpClientNio(createClientConnectionFactory(this.clientParams));
+        this.client = new HttpClientNio(createClientConnectionFactory());
         this.client.setExceptionHandler(new SimpleIOReactorExceptionHandler());
         this.clientHttpProc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
                 new RequestContent(),
@@ -108,7 +108,7 @@ public abstract class HttpCoreNIOTestBas
     public void initConnPool() throws Exception {
         this.connpool = new BasicNIOConnPool(
                 this.client.getIoReactor(),
-                new BasicNIOConnFactory(createClientConnectionFactory(this.clientParams)),
+                new BasicNIOConnFactory(createClientConnectionFactory()),
                 this.clientParams);
         this.executor = new HttpAsyncRequester(
                 this.clientHttpProc,

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingClientConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingClientConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingClientConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -26,28 +26,18 @@
  */
 package org.apache.http.testserver;
 
-import org.apache.http.HttpResponseFactory;
-import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
-import org.apache.http.impl.nio.DefaultNHttpClientConnectionFactory;
+import org.apache.http.nio.NHttpConnectionFactory;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.util.ByteBufferAllocator;
-import org.apache.http.nio.util.HeapByteBufferAllocator;
-import org.apache.http.params.HttpParams;
 
-public class LoggingClientConnectionFactory extends DefaultNHttpClientConnectionFactory {
+public class LoggingClientConnectionFactory implements NHttpConnectionFactory<DefaultNHttpClientConnection> {
 
-    public LoggingClientConnectionFactory(final HttpParams params) {
-        super(DefaultHttpResponseFactory.INSTANCE, HeapByteBufferAllocator.INSTANCE, params);
+    public LoggingClientConnectionFactory() {
+        super();
     }
 
-    @Override
-    protected DefaultNHttpClientConnection createConnection(
-            final IOSession session,
-            final HttpResponseFactory responseFactory,
-            final ByteBufferAllocator allocator,
-            final HttpParams params) {
-        return new LoggingNHttpClientConnection(session, responseFactory, allocator, params);
+    public DefaultNHttpClientConnection createConnection(final IOSession session) {
+        return new LoggingNHttpClientConnection(session);
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpClientConnection.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpClientConnection.java Wed Oct  3 13:58:11 2012
@@ -36,12 +36,9 @@ import org.apache.http.Header;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
-import org.apache.http.HttpResponseFactory;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
 import org.apache.http.nio.NHttpClientEventHandler;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.util.ByteBufferAllocator;
-import org.apache.http.params.HttpParams;
 
 public class LoggingNHttpClientConnection extends DefaultNHttpClientConnection {
 
@@ -53,12 +50,8 @@ public class LoggingNHttpClientConnectio
     private final Log wirelog;
     private final String id;
 
-    public LoggingNHttpClientConnection(
-            final IOSession session,
-            final HttpResponseFactory responseFactory,
-            final ByteBufferAllocator allocator,
-            final HttpParams params) {
-        super(session, responseFactory, allocator, params);
+    public LoggingNHttpClientConnection(final IOSession session) {
+        super(session, 8 * 1024);
         this.log = LogFactory.getLog(getClass());
         this.iolog = LogFactory.getLog(session.getClass());
         this.headerlog = LogFactory.getLog("org.apache.http.headers");

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpServerConnection.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingNHttpServerConnection.java Wed Oct  3 13:58:11 2012
@@ -35,13 +35,10 @@ import org.apache.commons.logging.LogFac
 import org.apache.http.Header;
 import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
-import org.apache.http.HttpRequestFactory;
 import org.apache.http.HttpResponse;
 import org.apache.http.impl.nio.DefaultNHttpServerConnection;
 import org.apache.http.nio.NHttpServerEventHandler;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.util.ByteBufferAllocator;
-import org.apache.http.params.HttpParams;
 
 public class LoggingNHttpServerConnection extends DefaultNHttpServerConnection {
 
@@ -53,12 +50,8 @@ public class LoggingNHttpServerConnectio
     private final Log wirelog;
     private final String id;
 
-    public LoggingNHttpServerConnection(
-            final IOSession session,
-            final HttpRequestFactory requestFactory,
-            final ByteBufferAllocator allocator,
-            final HttpParams params) {
-        super(session, requestFactory, allocator, params);
+    public LoggingNHttpServerConnection(final IOSession session) {
+        super(session, 8 * 1024);
         this.log = LogFactory.getLog(getClass());
         this.iolog = LogFactory.getLog(session.getClass());
         this.headerlog = LogFactory.getLog("org.apache.http.headers");

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLClientConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLClientConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLClientConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLClientConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -28,31 +28,26 @@ package org.apache.http.testserver;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.http.HttpResponseFactory;
-import org.apache.http.impl.DefaultHttpResponseFactory;
 import org.apache.http.impl.nio.DefaultNHttpClientConnection;
-import org.apache.http.impl.nio.SSLNHttpClientConnectionFactory;
+import org.apache.http.nio.NHttpConnectionFactory;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.util.ByteBufferAllocator;
-import org.apache.http.nio.util.HeapByteBufferAllocator;
-import org.apache.http.params.HttpParams;
-
-public class LoggingSSLClientConnectionFactory extends SSLNHttpClientConnectionFactory {
-
-    public LoggingSSLClientConnectionFactory(
-            final SSLContext sslcontext,
-            final HttpParams params) {
-        super(sslcontext, null, DefaultHttpResponseFactory.INSTANCE, 
-                HeapByteBufferAllocator.INSTANCE, params);
+import org.apache.http.nio.reactor.ssl.SSLIOSession;
+import org.apache.http.nio.reactor.ssl.SSLMode;
+
+public class LoggingSSLClientConnectionFactory implements NHttpConnectionFactory<DefaultNHttpClientConnection> {
+
+    private final SSLContext sslcontext;
+
+    public LoggingSSLClientConnectionFactory(final SSLContext sslcontext) {
+        super();
+        this.sslcontext = sslcontext;
     }
 
-    @Override
-    protected DefaultNHttpClientConnection createConnection(
-            final IOSession session,
-            final HttpResponseFactory responseFactory,
-            final ByteBufferAllocator allocator,
-            final HttpParams params) {
-        return new LoggingNHttpClientConnection(session, responseFactory, allocator, params);
+    public DefaultNHttpClientConnection createConnection(final IOSession iosession) {
+        SSLIOSession ssliosession = new SSLIOSession(
+                iosession, SSLMode.CLIENT, this.sslcontext, null);
+        iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
+        return new LoggingNHttpClientConnection(ssliosession);
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLServerConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLServerConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLServerConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingSSLServerConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -28,31 +28,26 @@ package org.apache.http.testserver;
 
 import javax.net.ssl.SSLContext;
 
-import org.apache.http.HttpRequestFactory;
-import org.apache.http.impl.DefaultHttpRequestFactory;
 import org.apache.http.impl.nio.DefaultNHttpServerConnection;
-import org.apache.http.impl.nio.SSLNHttpServerConnectionFactory;
+import org.apache.http.nio.NHttpConnectionFactory;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.util.ByteBufferAllocator;
-import org.apache.http.nio.util.HeapByteBufferAllocator;
-import org.apache.http.params.HttpParams;
-
-public class LoggingSSLServerConnectionFactory extends SSLNHttpServerConnectionFactory {
-
-    public LoggingSSLServerConnectionFactory(
-            final SSLContext sslcontext,
-            final HttpParams params) {
-        super(sslcontext, null, DefaultHttpRequestFactory.INSTANCE, 
-                HeapByteBufferAllocator.INSTANCE, params);
+import org.apache.http.nio.reactor.ssl.SSLIOSession;
+import org.apache.http.nio.reactor.ssl.SSLMode;
+
+public class LoggingSSLServerConnectionFactory implements NHttpConnectionFactory<DefaultNHttpServerConnection> {
+
+    private final SSLContext sslcontext;
+
+    public LoggingSSLServerConnectionFactory(final SSLContext sslcontext) {
+        super();
+        this.sslcontext = sslcontext;
     }
 
-    @Override
-    protected DefaultNHttpServerConnection createConnection(
-            final IOSession session,
-            final HttpRequestFactory requestFactory,
-            final ByteBufferAllocator allocator,
-            final HttpParams params) {
-        return new LoggingNHttpServerConnection(session, requestFactory, allocator, params);
+    public DefaultNHttpServerConnection createConnection(final IOSession iosession) {
+        SSLIOSession ssliosession = new SSLIOSession(
+                iosession, SSLMode.SERVER, this.sslcontext, null);
+        iosession.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
+        return new LoggingNHttpServerConnection(ssliosession);
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingServerConnectionFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingServerConnectionFactory.java?rev=1393494&r1=1393493&r2=1393494&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingServerConnectionFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/testserver/LoggingServerConnectionFactory.java Wed Oct  3 13:58:11 2012
@@ -26,28 +26,18 @@
  */
 package org.apache.http.testserver;
 
-import org.apache.http.HttpRequestFactory;
-import org.apache.http.impl.DefaultHttpRequestFactory;
 import org.apache.http.impl.nio.DefaultNHttpServerConnection;
-import org.apache.http.impl.nio.DefaultNHttpServerConnectionFactory;
+import org.apache.http.nio.NHttpConnectionFactory;
 import org.apache.http.nio.reactor.IOSession;
-import org.apache.http.nio.util.ByteBufferAllocator;
-import org.apache.http.nio.util.HeapByteBufferAllocator;
-import org.apache.http.params.HttpParams;
 
-public class LoggingServerConnectionFactory extends DefaultNHttpServerConnectionFactory {
+public class LoggingServerConnectionFactory implements NHttpConnectionFactory<DefaultNHttpServerConnection> {
 
-    public LoggingServerConnectionFactory(final HttpParams params) {
-        super(DefaultHttpRequestFactory.INSTANCE, HeapByteBufferAllocator.INSTANCE, params);
+    public LoggingServerConnectionFactory() {
+        super();
     }
 
-    @Override
-    protected DefaultNHttpServerConnection createConnection(
-            final IOSession session,
-            final HttpRequestFactory requestFactory,
-            final ByteBufferAllocator allocator,
-            final HttpParams params) {
-        return new LoggingNHttpServerConnection(session, requestFactory, allocator, params);
+    public DefaultNHttpServerConnection createConnection(final IOSession session) {
+        return new LoggingNHttpServerConnection(session);
     }
 
 }



Mime
View raw message