hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1441402 - in /httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio: ./ pool/
Date Fri, 01 Feb 2013 11:54:38 GMT
Author: olegk
Date: Fri Feb  1 11:54:38 2013
New Revision: 1441402

URL: http://svn.apache.org/viewvc?rev=1441402&view=rev
Log:
Made default connection factory constructors more flexible

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/main/java/org/apache/http/impl/nio/pool/BasicNIOConnFactory.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=1441402&r1=1441401&r2=1441402&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
Fri Feb  1 11:54:38 2013
@@ -64,7 +64,7 @@ public class DefaultNHttpClientConnectio
     /**
      * @deprecated (4.3) use {@link
      *   DefaultNHttpClientConnectionFactory#DefaultNHttpClientConnectionFactory(
-     *     HttpResponseFactory, ByteBufferAllocator, ConnectionConfig)}
+     *      NHttpMessageParserFactory, ByteBufferAllocator, ConnectionConfig)}
      */
     @Deprecated
     public DefaultNHttpClientConnectionFactory(
@@ -93,12 +93,13 @@ public class DefaultNHttpClientConnectio
      * @since 4.3
      */
     public DefaultNHttpClientConnectionFactory(
-            final HttpResponseFactory responseFactory,
+            final NHttpMessageParserFactory<HttpResponse> responseParserFactory,
             final ByteBufferAllocator allocator,
             final ConnectionConfig config) {
         super();
         this.allocator = allocator != null ? allocator : HeapByteBufferAllocator.INSTANCE;
-        this.responseParserFactory = new DefaultHttpResponseParserFactory(null, responseFactory);
+        this.responseParserFactory = responseParserFactory != null ? responseParserFactory
:
+            DefaultHttpResponseParserFactory.INSTANCE;
         this.config = config != null ? config : ConnectionConfig.DEFAULT;
     }
 

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=1441402&r1=1441401&r2=1441402&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
Fri Feb  1 11:54:38 2013
@@ -64,7 +64,7 @@ public class DefaultNHttpServerConnectio
     /**
      * @deprecated (4.3) use {@link
      *   DefaultNHttpServerConnectionFactory#DefaultNHttpServerConnectionFactory(
-     *     ByteBufferAllocator, HttpRequestFactory, ConnectionConfig)}
+     *      ByteBufferAllocator, NHttpMessageParserFactory, ConnectionConfig)}
      */
     @Deprecated
     public DefaultNHttpServerConnectionFactory(
@@ -106,11 +106,12 @@ public class DefaultNHttpServerConnectio
      */
     public DefaultNHttpServerConnectionFactory(
             final ByteBufferAllocator allocator,
-            final HttpRequestFactory requestFactory,
+            final NHttpMessageParserFactory<HttpRequest> requestParserFactory,
             final ConnectionConfig config) {
         super();
         this.allocator = allocator != null ? allocator : HeapByteBufferAllocator.INSTANCE;
-        this.requestParserFactory = new DefaultHttpRequestParserFactory(null, requestFactory);
+        this.requestParserFactory = requestParserFactory != null ? requestParserFactory :
+            DefaultHttpRequestParserFactory.INSTANCE;
         this.config = config != null ? config : ConnectionConfig.DEFAULT;
     }
 

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=1441402&r1=1441401&r2=1441402&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
Fri Feb  1 11:54:38 2013
@@ -71,7 +71,7 @@ public class SSLNHttpClientConnectionFac
     /**
      * @deprecated (4.3) use {@link
      *   SSLNHttpClientConnectionFactory#SSLNHttpClientConnectionFactory(SSLContext,
-     *     SSLSetupHandler, HttpResponseFactory, ByteBufferAllocator, ConnectionConfig)}
+     *      SSLSetupHandler, NHttpMessageParserFactory, ByteBufferAllocator, ConnectionConfig)}
      */
     @Deprecated
     public SSLNHttpClientConnectionFactory(
@@ -120,14 +120,15 @@ public class SSLNHttpClientConnectionFac
     public SSLNHttpClientConnectionFactory(
             final SSLContext sslcontext,
             final SSLSetupHandler sslHandler,
-            final HttpResponseFactory responseFactory,
+            final NHttpMessageParserFactory<HttpResponse> responseParserFactory,
             final ByteBufferAllocator allocator,
             final ConnectionConfig config) {
         super();
         this.sslcontext = sslcontext;
         this.sslHandler = sslHandler;
         this.allocator = allocator != null ? allocator : HeapByteBufferAllocator.INSTANCE;
-        this.responseParserFactory = new DefaultHttpResponseParserFactory(null, responseFactory);
+        this.responseParserFactory = responseParserFactory != null ? responseParserFactory
:
+            DefaultHttpResponseParserFactory.INSTANCE;
         this.config = config != null ? config : ConnectionConfig.DEFAULT;
     }
 

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=1441402&r1=1441401&r2=1441402&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
Fri Feb  1 11:54:38 2013
@@ -71,7 +71,7 @@ public class SSLNHttpServerConnectionFac
     /**
      * @deprecated (4.3) use {@link
      *   SSLNHttpServerConnectionFactory#SSLNHttpServerConnectionFactory(SSLContext,
-     *     SSLSetupHandler, HttpRequestFactory, ByteBufferAllocator, ConnectionConfig)}
+     *      SSLSetupHandler, NHttpMessageParserFactory, ByteBufferAllocator, ConnectionConfig)}
      */
     @Deprecated
     public SSLNHttpServerConnectionFactory(
@@ -120,14 +120,15 @@ public class SSLNHttpServerConnectionFac
     public SSLNHttpServerConnectionFactory(
             final SSLContext sslcontext,
             final SSLSetupHandler sslHandler,
-            final HttpRequestFactory requestFactory,
+            final NHttpMessageParserFactory<HttpRequest> requestParserFactory,
             final ByteBufferAllocator allocator,
             final ConnectionConfig config) {
         super();
         this.sslcontext = sslcontext;
         this.sslHandler = sslHandler;
         this.allocator = allocator != null ? allocator : HeapByteBufferAllocator.INSTANCE;
-        this.requestParserFactory = new DefaultHttpRequestParserFactory(null, requestFactory);
+        this.requestParserFactory = requestParserFactory != null ? requestParserFactory :
+            DefaultHttpRequestParserFactory.INSTANCE;
         this.config = config != null ? config : ConnectionConfig.DEFAULT;
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnFactory.java?rev=1441402&r1=1441401&r2=1441402&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnFactory.java
(original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnFactory.java
Fri Feb  1 11:54:38 2013
@@ -31,6 +31,7 @@ import java.io.IOException;
 import javax.net.ssl.SSLContext;
 
 import org.apache.http.HttpHost;
+import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseFactory;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.config.ConnectionConfig;
@@ -39,6 +40,7 @@ import org.apache.http.impl.nio.DefaultN
 import org.apache.http.impl.nio.SSLNHttpClientConnectionFactory;
 import org.apache.http.nio.NHttpClientConnection;
 import org.apache.http.nio.NHttpConnectionFactory;
+import org.apache.http.nio.NHttpMessageParserFactory;
 import org.apache.http.nio.pool.NIOConnFactory;
 import org.apache.http.nio.reactor.IOEventDispatch;
 import org.apache.http.nio.reactor.IOSession;
@@ -119,11 +121,11 @@ public class BasicNIOConnFactory impleme
     public BasicNIOConnFactory(
             final SSLContext sslcontext,
             final SSLSetupHandler sslHandler,
-            final HttpResponseFactory responseFactory,
+            final NHttpMessageParserFactory<HttpResponse> responseParserFactory,
             final ByteBufferAllocator allocator,
             final ConnectionConfig config) {
-        this(new DefaultNHttpClientConnectionFactory(responseFactory, allocator, config),
-                new SSLNHttpClientConnectionFactory(sslcontext, sslHandler, responseFactory,
+        this(new DefaultNHttpClientConnectionFactory(responseParserFactory, allocator, config),
+                new SSLNHttpClientConnectionFactory(sslcontext, sslHandler, responseParserFactory,
                         allocator, config));
     }
 



Mime
View raw message