hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1371300 - in /httpcomponents/httpcore/trunk: httpcore-nio/src/main/java/org/apache/http/impl/nio/ httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/ httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/ httpcore-nio/src/main/...
Date Thu, 09 Aug 2012 16:28:43 GMT
Author: olegk
Date: Thu Aug  9 16:28:41 2012
New Revision: 1371300

URL: http://svn.apache.org/viewvc?rev=1371300&view=rev
Log:
Deprecated HTTP parameter beans and static util methods in favor of HttpCoreConfigBuilder (first step toward removal of HttpParams API)

Added:
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java   (with props)
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/NHttpConnectionBase.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/BasicNIOConnPool.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
    httpcomponents/httpcore/trunk/httpcore-nio/src/test/java/org/apache/http/impl/nio/reactor/TestSessionInOutBuffers.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/ElementalPoolingHttpGet.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpAbstractParamBean.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParamBean.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParamBean.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParams.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
    httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestSessionBuffers.java
    httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.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=1371300&r1=1371299&r2=1371300&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 Thu Aug  9 16:28:41 2012
@@ -34,7 +34,7 @@ import org.apache.http.nio.NHttpConnecti
 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.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -87,8 +87,9 @@ public class DefaultNHttpClientConnectio
     }
 
     public DefaultNHttpClientConnection createConnection(final IOSession session) {
-        DefaultNHttpClientConnection conn = createConnection(session, this.responseFactory, this.allocator, this.params);
-        int timeout = HttpConnectionParams.getSoTimeout(this.params);
+        DefaultNHttpClientConnection conn = createConnection(session, this.responseFactory, 
+                this.allocator, this.params);
+        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

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=1371300&r1=1371299&r2=1371300&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 Thu Aug  9 16:28:41 2012
@@ -34,7 +34,7 @@ import org.apache.http.nio.NHttpServerCo
 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.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -89,7 +89,7 @@ public class DefaultNHttpServerConnectio
     public DefaultNHttpServerConnection createConnection(final IOSession session) {
         DefaultNHttpServerConnection conn = createConnection(
                 session, this.requestFactory, this.allocator, this.params);
-        int timeout = HttpConnectionParams.getSoTimeout(this.params);
+        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/NHttpConnectionBase.java Thu Aug  9 16:28:41 2012
@@ -70,7 +70,7 @@ import org.apache.http.nio.reactor.Sessi
 import org.apache.http.nio.reactor.SessionOutputBuffer;
 import org.apache.http.nio.reactor.SocketAccessor;
 import org.apache.http.nio.util.ByteBufferAllocator;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.protocol.HttpContext;
@@ -131,7 +131,7 @@ public class NHttpConnectionBase
         Args.notNull(session, "I/O session");
         Args.notNull(params, "HTTP params");
 
-        int buffersize = HttpConnectionParams.getSocketBufferSize(params);
+        int buffersize = params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
         if (buffersize <= 0) {
             buffersize = 4096;
         }

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=1371300&r1=1371299&r2=1371300&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 Thu Aug  9 16:28:41 2012
@@ -39,7 +39,7 @@ import org.apache.http.nio.reactor.ssl.S
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -122,7 +122,7 @@ public class SSLNHttpClientConnectionFac
         session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
         DefaultNHttpClientConnection conn = createConnection(
                 ssliosession, this.responseFactory, this.allocator, this.params);
-        int timeout = HttpConnectionParams.getSoTimeout(this.params);
+        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

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=1371300&r1=1371299&r2=1371300&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 Thu Aug  9 16:28:41 2012
@@ -39,7 +39,7 @@ import org.apache.http.nio.reactor.ssl.S
 import org.apache.http.nio.reactor.ssl.SSLSetupHandler;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -122,7 +122,7 @@ public class SSLNHttpServerConnectionFac
         session.setAttribute(SSLIOSession.SESSION_KEY, ssliosession);
         DefaultNHttpServerConnection conn =  createConnection(
                 ssliosession, this.requestFactory, this.allocator, this.params);
-        int timeout = HttpConnectionParams.getSoTimeout(this.params);
+        int timeout = this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
         conn.setSocketTimeout(timeout);
         return conn;
     }

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/pool/BasicNIOConnPool.java Thu Aug  9 16:28:41 2012
@@ -39,7 +39,7 @@ import org.apache.http.nio.NHttpClientCo
 import org.apache.http.nio.pool.AbstractNIOConnPool;
 import org.apache.http.nio.pool.NIOConnFactory;
 import org.apache.http.nio.reactor.ConnectingIOReactor;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.pool.ConnPool;
 import org.apache.http.util.Args;
@@ -106,7 +106,7 @@ public class BasicNIOConnPool extends Ab
             final HttpHost route,
             final Object state,
             final FutureCallback<BasicNIOPoolEntry> callback) {
-        int connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
+        int connectTimeout = this.params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
         return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, callback);
     }
 
@@ -114,7 +114,7 @@ public class BasicNIOConnPool extends Ab
     public Future<BasicNIOPoolEntry> lease(
             final HttpHost route,
             final Object state) {
-        int connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
+        int connectTimeout = this.params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
         return super.lease(route, state, connectTimeout, TimeUnit.MILLISECONDS, null);
     }
 

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionInputBufferImpl.java Thu Aug  9 16:28:41 2012
@@ -36,14 +36,16 @@ import java.nio.charset.CharacterCodingE
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CoderResult;
+import java.nio.charset.CodingErrorAction;
 
+import org.apache.http.Consts;
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.nio.reactor.SessionInputBuffer;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.ExpandableBuffer;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
+import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.Args;
 import org.apache.http.util.CharArrayBuffer;
@@ -74,10 +76,15 @@ public class SessionInputBufferImpl exte
             final HttpParams params) {
         super(buffersize, allocator);
         this.charbuffer = CharBuffer.allocate(linebuffersize);
-        this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
+        String charset = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET);
+        this.charset = charset != null ? Charset.forName(charset) : Consts.ASCII;
         this.chardecoder = this.charset.newDecoder();
-        this.chardecoder.onMalformedInput(HttpProtocolParams.getMalformedInputAction(params));
-        this.chardecoder.onUnmappableCharacter(HttpProtocolParams.getUnmappableInputAction(params));
+        CodingErrorAction a1 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION);
+        this.chardecoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT);
+        CodingErrorAction a2 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION);
+        this.chardecoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT);
     }
 
     public SessionInputBufferImpl(

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/impl/nio/reactor/SessionOutputBufferImpl.java Thu Aug  9 16:28:41 2012
@@ -36,14 +36,16 @@ import java.nio.charset.CharacterCodingE
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
+import java.nio.charset.CodingErrorAction;
 
+import org.apache.http.Consts;
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.nio.reactor.SessionOutputBuffer;
 import org.apache.http.nio.util.ByteBufferAllocator;
 import org.apache.http.nio.util.ExpandableBuffer;
 import org.apache.http.nio.util.HeapByteBufferAllocator;
+import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.Args;
 import org.apache.http.util.CharArrayBuffer;
@@ -76,10 +78,15 @@ public class SessionOutputBufferImpl ext
             final HttpParams params) {
         super(buffersize, allocator);
         this.charbuffer = CharBuffer.allocate(linebuffersize);
-        this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
+        String charset = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET);
+        this.charset = charset != null ? Charset.forName(charset) : Consts.ASCII;
         this.charencoder = this.charset.newEncoder();
-        this.charencoder.onMalformedInput(HttpProtocolParams.getMalformedInputAction(params));
-        this.charencoder.onUnmappableCharacter(HttpProtocolParams.getUnmappableInputAction(params));
+        CodingErrorAction a1 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION);
+        this.charencoder.onMalformedInput(a1 != null ? a1 : CodingErrorAction.REPORT);
+        CodingErrorAction a2 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION);
+        this.charencoder.onUnmappableCharacter(a2 != null? a2 : CodingErrorAction.REPORT);
     }
 
     public SessionOutputBufferImpl(

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncRequestExecutor.java Thu Aug  9 16:28:41 2012
@@ -46,8 +46,9 @@ import org.apache.http.nio.ContentEncode
 import org.apache.http.nio.NHttpClientConnection;
 import org.apache.http.nio.NHttpClientEventHandler;
 import org.apache.http.nio.NHttpConnection;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.HttpProcessor;
@@ -145,7 +146,8 @@ public class HttpAsyncRequestExecutor im
         HttpRequest request = handler.generateRequest();
         context.setAttribute(ExecutionContext.HTTP_REQUEST, request);
 
-        conn.setSocketTimeout(HttpConnectionParams.getSoTimeout(request.getParams()));
+        HttpParams params = request.getParams();
+        conn.setSocketTimeout(params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
 
         HttpProcessor httppocessor = handler.getHttpProcessor();
         httppocessor.process(request, context);

Modified: httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java (original)
+++ httpcomponents/httpcore/trunk/httpcore-nio/src/main/java/org/apache/http/nio/protocol/HttpAsyncService.java Thu Aug  9 16:28:41 2012
@@ -54,8 +54,8 @@ import org.apache.http.nio.NHttpConnecti
 import org.apache.http.nio.NHttpServerConnection;
 import org.apache.http.nio.NHttpServerEventHandler;
 import org.apache.http.nio.entity.NStringEntity;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.DefaultedHttpParams;
-import org.apache.http.params.HttpConnectionParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -343,7 +343,7 @@ public class HttpAsyncService implements
             }
             closeHandlers(state);
             state.reset();
-            conn.setSocketTimeout(HttpConnectionParams.getSoTimeout(this.params));
+            conn.setSocketTimeout(this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
         }
     }
 
@@ -548,7 +548,7 @@ public class HttpAsyncService implements
             }
             closeHandlers(state);
             state.reset();
-            conn.setSocketTimeout(HttpConnectionParams.getSoTimeout(this.params));
+            conn.setSocketTimeout(this.params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
         } else {
             state.setResponseState(MessageState.BODY_STREAM);
         }

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=1371300&r1=1371299&r2=1371300&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 Thu Aug  9 16:28:41 2012
@@ -40,8 +40,8 @@ import java.nio.charset.CodingErrorActio
 import org.apache.http.nio.reactor.SessionInputBuffer;
 import org.apache.http.nio.reactor.SessionOutputBuffer;
 import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.util.CharArrayBuffer;
 import org.junit.Assert;
 import org.junit.Test;
@@ -417,8 +417,9 @@ public class TestSessionInOutBuffers {
         String s2 = constructString(RUSSIAN_HELLO);
         String s3 = "Like hello and stuff";
 
-        HttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setHttpElementCharset(params, "UTF-8");
+        HttpParams params = new HttpCoreConfigBuilder()
+            .setHttpElementCharset("UTF-8")
+            .build();
 
         SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16, params);
 
@@ -481,17 +482,17 @@ public class TestSessionInOutBuffers {
 
     @Test
     public void testMalformedInputAction() throws Exception {
-        HttpParams params = new BasicHttpParams();
         String s1 = constructString(SWISS_GERMAN_HELLO);
-
         byte[] tmp = s1.getBytes("ISO-8859-1");
-        ReadableByteChannel channel = newChannel(tmp);
+
+        // Action with report
+        HttpParams params = new HttpCoreConfigBuilder()
+            .setMalformedInputAction(CodingErrorAction.REPORT)
+            .build();
         SessionInputBuffer inbuf = new SessionInputBufferImpl(16, 16, params);
+        ReadableByteChannel channel = newChannel(tmp);
         while (inbuf.fill(channel) > 0) {
         }
-
-        // Action with report
-        HttpProtocolParams.setMalformedInputAction(params, CodingErrorAction.REPORT);
         try {
             String s = inbuf.readLine(true);
             Assert.fail("Expected CharacterCodingException, got '" + s + "'");
@@ -499,35 +500,36 @@ public class TestSessionInOutBuffers {
         }
 
         // Action with ignore
-        HttpProtocolParams.setMalformedInputAction(params, CodingErrorAction.IGNORE);
+        params = new HttpCoreConfigBuilder()
+            .setMalformedInputAction(CodingErrorAction.IGNORE)
+            .build();
         inbuf = new SessionInputBufferImpl(16, 16, params);
-        String s2 = null;
-        try {
-            s2 = inbuf.readLine(true);
-        } catch (CharacterCodingException e) {
-            Assert.fail("Unexpected CharacterCodingException " +
-                    (s2 == null ? "" : ", got '" + s2 + "'"));
+        channel = newChannel(tmp);
+        while (inbuf.fill(channel) > 0) {
         }
+        String s2 = inbuf.readLine(true);
+        Assert.assertEquals("Grezi_zm", s2);
 
         // Action with replace
-        HttpProtocolParams.setMalformedInputAction(params, CodingErrorAction.REPLACE);
+        params = new HttpCoreConfigBuilder()
+            .setMalformedInputAction(CodingErrorAction.REPLACE)
+            .build();
         inbuf = new SessionInputBufferImpl(16, 16, params);
-        String s3 = null;
-        try {
-            s3 = inbuf.readLine(true);
-        } catch (CharacterCodingException e) {
-            Assert.fail("Unexpected CharacterCodingException " +
-                    (s3 == null ? "" : ", got '" + s3 + "'"));
+        channel = newChannel(tmp);
+        while (inbuf.fill(channel) > 0) {
         }
+        String s3 = inbuf.readLine(true);
+        Assert.assertEquals("Gr\ufffdezi_z\ufffdm\ufffd", s3);
     }
 
     @Test
     public void testUnmappableInputAction() throws Exception {
-        HttpParams params = new BasicHttpParams();
         String s1 = constructString(SWISS_GERMAN_HELLO);
 
         // Action with report
-        HttpProtocolParams.setUnmappableInputAction(params, CodingErrorAction.REPORT);
+        HttpParams params = new HttpCoreConfigBuilder()
+            .setUnmappableInputAction(CodingErrorAction.REPORT)
+            .build();
         SessionOutputBuffer outbuf = new SessionOutputBufferImpl(1024, 16, params);
         try {
             outbuf.writeLine(s1);
@@ -536,7 +538,9 @@ public class TestSessionInOutBuffers {
         }
 
         // Action with ignore
-        HttpProtocolParams.setUnmappableInputAction(params, CodingErrorAction.IGNORE);
+        params = new HttpCoreConfigBuilder()
+            .setUnmappableInputAction(CodingErrorAction.IGNORE)
+            .build();
         outbuf = new SessionOutputBufferImpl(1024, 16, params);
         try {
             outbuf.writeLine(s1);
@@ -545,7 +549,9 @@ public class TestSessionInOutBuffers {
         }
 
         // Action with replace
-        HttpProtocolParams.setUnmappableInputAction(params, CodingErrorAction.REPLACE);
+        params = new HttpCoreConfigBuilder()
+            .setUnmappableInputAction(CodingErrorAction.REPLACE)
+            .build();
         outbuf = new SessionOutputBufferImpl(1024, 16, params);
         try {
             outbuf.writeLine(s1);

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpGet.java Thu Aug  9 16:28:41 2012
@@ -37,9 +37,8 @@ import org.apache.http.HttpVersion;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -62,12 +61,11 @@ import org.apache.http.util.EntityUtils;
 public class ElementalHttpGet {
 
     public static void main(String[] args) throws Exception {
-
-        HttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
-        HttpProtocolParams.setContentCharset(params, "UTF-8");
-        HttpProtocolParams.setUserAgent(params, "HttpComponents/1.1");
-        HttpProtocolParams.setUseExpectContinue(params, true);
+        HttpParams params = new HttpCoreConfigBuilder()
+            .setProtocolVersion(HttpVersion.HTTP_1_1)
+            .setContentCharset("UTF-8")
+            .setUserAgent("Test/1.1")
+            .setUseExpectContinue(true).build();
 
         HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
                 // Required protocol interceptors

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalHttpPost.java Thu Aug  9 16:28:41 2012
@@ -42,9 +42,8 @@ import org.apache.http.entity.StringEnti
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.DefaultHttpClientConnection;
 import org.apache.http.message.BasicHttpEntityEnclosingRequest;
-import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
@@ -68,11 +67,11 @@ public class ElementalHttpPost {
 
     public static void main(String[] args) throws Exception {
 
-        HttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
-        HttpProtocolParams.setContentCharset(params, "UTF-8");
-        HttpProtocolParams.setUserAgent(params, "Test/1.1");
-        HttpProtocolParams.setUseExpectContinue(params, true);
+        HttpParams params = new HttpCoreConfigBuilder()
+            .setProtocolVersion(HttpVersion.HTTP_1_1)
+            .setContentCharset("UTF-8")
+            .setUserAgent("Test/1.1")
+            .setUseExpectContinue(true).build();
 
         HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
                 // Required protocol interceptors

Modified: httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/examples/org/apache/http/examples/ElementalPoolingHttpGet.java Thu Aug  9 16:28:41 2012
@@ -42,9 +42,8 @@ import org.apache.http.impl.pool.BasicCo
 import org.apache.http.impl.pool.BasicConnPool;
 import org.apache.http.impl.pool.BasicPoolEntry;
 import org.apache.http.message.BasicHttpRequest;
-import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.ExecutionContext;
 import org.apache.http.protocol.HttpContext;
@@ -69,11 +68,11 @@ public class ElementalPoolingHttpGet {
 
     public static void main(String[] args) throws Exception {
 
-        final HttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setVersion(params, HttpVersion.HTTP_1_1);
-        HttpProtocolParams.setContentCharset(params, "UTF-8");
-        HttpProtocolParams.setUserAgent(params, "Test/1.1");
-        HttpProtocolParams.setUseExpectContinue(params, true);
+        final HttpParams params = new HttpCoreConfigBuilder()
+            .setProtocolVersion(HttpVersion.HTTP_1_1)
+            .setContentCharset("UTF-8")
+            .setUserAgent("Test/1.1")
+            .setUseExpectContinue(true).build();
 
         final HttpProcessor httpproc = new ImmutableHttpProcessor(new HttpRequestInterceptor[] {
                 // Required protocol interceptors

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpClientConnection.java Thu Aug  9 16:28:41 2012
@@ -31,7 +31,7 @@ import java.io.IOException;
 import java.net.Socket;
 
 import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -68,11 +68,10 @@ public class DefaultHttpClientConnection
         Args.notNull(socket, "Socket");
         Args.notNull(params, "HTTP parameters");
         assertNotOpen();
-        socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
-        socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
-        socket.setKeepAlive(HttpConnectionParams.getSoKeepalive(params));
-
-        int linger = HttpConnectionParams.getLinger(params);
+        socket.setTcpNoDelay(params.getBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true));
+        socket.setSoTimeout(params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
+        socket.setKeepAlive(params.getBooleanParameter(CoreConnectionPNames.SO_KEEPALIVE, false));
+        int linger = params.getIntParameter(CoreConnectionPNames.SO_LINGER, -1);
         if (linger >= 0) {
             socket.setSoLinger(linger > 0, linger);
         }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/DefaultHttpServerConnection.java Thu Aug  9 16:28:41 2012
@@ -31,7 +31,7 @@ import java.io.IOException;
 import java.net.Socket;
 
 import org.apache.http.annotation.NotThreadSafe;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -66,11 +66,13 @@ public class DefaultHttpServerConnection
         Args.notNull(socket, "Socket");
         Args.notNull(params, "HTTP parameters");
         assertNotOpen();
-        socket.setTcpNoDelay(HttpConnectionParams.getTcpNoDelay(params));
-        socket.setSoTimeout(HttpConnectionParams.getSoTimeout(params));
-        socket.setKeepAlive(HttpConnectionParams.getSoKeepalive(params));
-
-        int linger = HttpConnectionParams.getLinger(params);
+        socket.setTcpNoDelay(params.getBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true));
+        socket.setSoTimeout(params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0));
+        socket.setKeepAlive(params.getBooleanParameter(CoreConnectionPNames.SO_KEEPALIVE, false));
+        int linger = params.getIntParameter(CoreConnectionPNames.SO_LINGER, -1);
+        if (linger >= 0) {
+            socket.setSoLinger(linger > 0, linger);
+        }
         if (linger >= 0) {
             socket.setSoLinger(linger > 0, linger);
         }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpClientConnection.java Thu Aug  9 16:28:41 2012
@@ -40,7 +40,7 @@ import org.apache.http.impl.io.SocketInp
 import org.apache.http.impl.io.SocketOutputBuffer;
 import org.apache.http.io.SessionInputBuffer;
 import org.apache.http.io.SessionOutputBuffer;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -155,8 +155,7 @@ public class SocketHttpClientConnection
         Args.notNull(params, "HTTP parameters");
         this.socket = socket;
 
-        int buffersize = HttpConnectionParams.getSocketBufferSize(params);
-
+        int buffersize = params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
         init(
                 createSessionInputBuffer(socket, buffersize, params),
                 createSessionOutputBuffer(socket, buffersize, params),

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/SocketHttpServerConnection.java Thu Aug  9 16:28:41 2012
@@ -40,7 +40,7 @@ import org.apache.http.impl.io.SocketInp
 import org.apache.http.impl.io.SocketOutputBuffer;
 import org.apache.http.io.SessionInputBuffer;
 import org.apache.http.io.SessionOutputBuffer;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
@@ -152,8 +152,7 @@ public class SocketHttpServerConnection 
         Args.notNull(params, "HTTP parameters");
         this.socket = socket;
 
-        int buffersize = HttpConnectionParams.getSocketBufferSize(params);
-
+        int buffersize = params.getIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, -1);
         init(
                 createSessionInputBuffer(socket, buffersize, params),
                 createSessionOutputBuffer(socket, buffersize, params),

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionInputBuffer.java Thu Aug  9 16:28:41 2012
@@ -36,13 +36,14 @@ import java.nio.charset.CharsetDecoder;
 import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
 
+import org.apache.http.Consts;
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.io.BufferInfo;
 import org.apache.http.io.HttpTransportMetrics;
 import org.apache.http.io.SessionInputBuffer;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.Args;
 import org.apache.http.util.ByteArrayBuffer;
@@ -107,14 +108,19 @@ public abstract class AbstractSessionInp
         this.bufferpos = 0;
         this.bufferlen = 0;
         this.linebuffer = new ByteArrayBuffer(buffersize);
-        this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
+        String charset = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET);
+        this.charset = charset != null ? Charset.forName(charset) : Consts.ASCII;
         this.ascii = this.charset.equals(ASCII);
         this.decoder = null;
         this.maxLineLen = params.getIntParameter(CoreConnectionPNames.MAX_LINE_LENGTH, -1);
         this.minChunkLimit = params.getIntParameter(CoreConnectionPNames.MIN_CHUNK_LIMIT, 512);
         this.metrics = createTransportMetrics();
-        this.onMalformedInputAction = HttpProtocolParams.getMalformedInputAction(params);
-        this.onUnMappableInputAction = HttpProtocolParams.getUnmappableInputAction(params);
+        CodingErrorAction a1 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION);
+        this.onMalformedInputAction = a1 != null ? a1 : CodingErrorAction.REPORT;
+        CodingErrorAction a2 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION);
+        this.onUnMappableInputAction = a2 != null? a2 : CodingErrorAction.REPORT;
     }
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/io/AbstractSessionOutputBuffer.java Thu Aug  9 16:28:41 2012
@@ -36,13 +36,14 @@ import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
 import java.nio.charset.CodingErrorAction;
 
+import org.apache.http.Consts;
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.io.BufferInfo;
 import org.apache.http.io.HttpTransportMetrics;
 import org.apache.http.io.SessionOutputBuffer;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.protocol.HTTP;
 import org.apache.http.util.Args;
 import org.apache.http.util.ByteArrayBuffer;
@@ -99,13 +100,18 @@ public abstract class AbstractSessionOut
         Args.notNull(params, "HTTP parameters");
         this.outstream = outstream;
         this.buffer = new ByteArrayBuffer(buffersize);
-        this.charset = Charset.forName(HttpProtocolParams.getHttpElementCharset(params));
+        String charset = (String) params.getParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET);
+        this.charset = charset != null ? Charset.forName(charset) : Consts.ASCII;
         this.ascii = this.charset.equals(ASCII);
         this.encoder = null;
         this.minChunkLimit = params.getIntParameter(CoreConnectionPNames.MIN_CHUNK_LIMIT, 512);
         this.metrics = createTransportMetrics();
-        this.onMalformedInputAction = HttpProtocolParams.getMalformedInputAction(params);
-        this.onUnMappableInputAction = HttpProtocolParams.getUnmappableInputAction(params);
+        CodingErrorAction a1 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION);
+        this.onMalformedInputAction = a1 != null ? a1 : CodingErrorAction.REPORT;
+        CodingErrorAction a2 = (CodingErrorAction) params.getParameter(
+                CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION);
+        this.onUnMappableInputAction = a2 != null? a2 : CodingErrorAction.REPORT;
     }
 
     /**

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/impl/pool/BasicConnFactory.java Thu Aug  9 16:28:41 2012
@@ -36,7 +36,7 @@ import org.apache.http.HttpClientConnect
 import org.apache.http.HttpHost;
 import org.apache.http.annotation.Immutable;
 import org.apache.http.impl.DefaultHttpClientConnection;
-import org.apache.http.params.HttpConnectionParams;
+import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.HttpParams;
 import org.apache.http.pool.ConnFactory;
 import org.apache.http.util.Args;
@@ -94,8 +94,8 @@ public class BasicConnFactory implements
         if (socket == null) {
             throw new IOException(scheme + " scheme is not supported");
         }
-        int connectTimeout = HttpConnectionParams.getConnectionTimeout(this.params);
-        int soTimeout = HttpConnectionParams.getSoTimeout(this.params);
+        int connectTimeout = params.getIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 0);
+        int soTimeout = params.getIntParameter(CoreConnectionPNames.SO_TIMEOUT, 0);
 
         socket.setSoTimeout(soTimeout);
         socket.connect(new InetSocketAddress(host.getHostName(), host.getPort()), connectTimeout);

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/message/BasicHttpRequest.java Thu Aug  9 16:28:41 2012
@@ -28,11 +28,12 @@
 package org.apache.http.message;
 
 import org.apache.http.HttpRequest;
+import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.RequestLine;
 import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.util.Args;
 
 /**
@@ -115,8 +116,10 @@ public class BasicHttpRequest extends Ab
      */
     public RequestLine getRequestLine() {
         if (this.requestline == null) {
-            ProtocolVersion ver = HttpProtocolParams.getVersion(getParams());
-            this.requestline = new BasicRequestLine(this.method, this.uri, ver);
+            ProtocolVersion ver = (ProtocolVersion) getParams().getParameter
+                    (CoreProtocolPNames.PROTOCOL_VERSION);
+            this.requestline = new BasicRequestLine(this.method, this.uri, 
+                    ver != null ? ver : HttpVersion.HTTP_1_1);
         }
         return this.requestline;
     }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpAbstractParamBean.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpAbstractParamBean.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpAbstractParamBean.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpAbstractParamBean.java Thu Aug  9 16:28:41 2012
@@ -31,7 +31,10 @@ import org.apache.http.util.Args;
 
 /**
  * @since 4.0
+ * 
+ * @deprecated (4.3) do not use
  */
+@Deprecated
 public abstract class HttpAbstractParamBean {
 
     protected final HttpParams params;

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParamBean.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParamBean.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParamBean.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParamBean.java Thu Aug  9 16:28:41 2012
@@ -33,7 +33,10 @@ package org.apache.http.params;
  * conventions.
  *
  * @since 4.0
+ * 
+ * @deprecated (4.3) use {@link HttpCoreConfigBuilder}
  */
+@Deprecated
 public class HttpConnectionParamBean extends HttpAbstractParamBean {
 
     public HttpConnectionParamBean (final HttpParams params) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParams.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpConnectionParams.java Thu Aug  9 16:28:41 2012
@@ -33,7 +33,10 @@ import org.apache.http.util.Args;
  * Utility class for accessing connection parameters in {@link HttpParams}.
  *
  * @since 4.0
+ * 
+ * @deprecated (4.3)
  */
+@Deprecated
 public final class HttpConnectionParams implements CoreConnectionPNames {
 
     private HttpConnectionParams() {

Added: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java?rev=1371300&view=auto
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java (added)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java Thu Aug  9 16:28:41 2012
@@ -0,0 +1,320 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation.  For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.http.params;
+
+import java.nio.charset.CodingErrorAction;
+
+import org.apache.http.HttpVersion;
+import org.apache.http.util.Args;
+
+/**
+ * HTTP core configuration builder.
+ * 
+ * @since 4.3
+ * 
+ * @see CoreConnectionPNames
+ * @see CoreProtocolPNames
+ */
+public class HttpCoreConfigBuilder {
+
+    private Integer maxHeaderCount;
+    private Integer maxLineLength;
+    private Integer minChunkLimit;
+    private Boolean socketKeepAlive;
+    private Integer socketLinger;
+    private Integer socketReuseAddress;
+    private Integer socketTimeout;
+    private Integer socketBufferSize;
+    private Boolean tcpNoDelay;
+    private Integer connectTimeout;
+    private String contentCharset;
+    private String httpElementCharset;
+    private CodingErrorAction malformedInputAction;
+    private CodingErrorAction unmappableInputAction;
+    private String originServer;
+    private HttpVersion protocolVersion;
+    private Boolean strictTransferEncoding;
+    private Boolean useExpectContinue;
+    private String userAgent;
+    private Integer waitForContinue;
+
+    public HttpCoreConfigBuilder() {
+        super();
+    }
+
+    public Integer getConnectTimeout() {
+        return connectTimeout;
+    }
+
+    public HttpCoreConfigBuilder setConnectTimeout(final Integer connectTimeout) {
+        this.connectTimeout = connectTimeout;
+        return this;
+    }
+
+    public Integer getMaxHeaderCount() {
+        return maxHeaderCount;
+    }
+
+    public HttpCoreConfigBuilder setMaxHeaderCount(final Integer maxHeaderCount) {
+        this.maxHeaderCount = maxHeaderCount;
+        return this;
+    }
+
+    public Integer getMaxLineLength() {
+        return maxLineLength;
+    }
+
+    public HttpCoreConfigBuilder setMaxLineLength(final Integer maxLineLength) {
+        this.maxLineLength = maxLineLength;
+        return this;
+    }
+
+    public Integer getMinChunkLimit() {
+        return minChunkLimit;
+    }
+
+    public HttpCoreConfigBuilder setMinChunkLimit(final Integer minChunkLimit) {
+        this.minChunkLimit = minChunkLimit;
+        return this;
+    }
+
+    public Boolean getSocketKeepAlive() {
+        return socketKeepAlive;
+    }
+
+    public HttpCoreConfigBuilder setSocketKeepAlive(final Boolean socketKeepAlive) {
+        this.socketKeepAlive = socketKeepAlive;
+        return this;
+    }
+
+    public Integer getSocketReuseAddress() {
+        return socketReuseAddress;
+    }
+
+    public HttpCoreConfigBuilder setSocketReuseAddress(final Integer socketReuseAddress) {
+        this.socketReuseAddress = socketReuseAddress;
+        return this;
+    }
+
+    public Integer getSocketLinger() {
+        return socketLinger;
+    }
+
+    public HttpCoreConfigBuilder setSocketLinger(final Integer socketLinger) {
+        this.socketLinger = socketLinger;
+        return this;
+    }
+
+    public Integer getSocketTimeout() {
+        return socketTimeout;
+    }
+
+    public HttpCoreConfigBuilder setSocketTimeout(final Integer socketTimeout) {
+        this.socketTimeout = socketTimeout;
+        return this;
+    }
+
+    public Integer getSocketBufferSize() {
+        return socketBufferSize;
+    }
+
+    public HttpCoreConfigBuilder setSocketBufferSize(final Integer socketBufferSize) {
+        this.socketBufferSize = socketBufferSize;
+        return this;
+    }
+
+    public Boolean getTcpNoDelay() {
+        return tcpNoDelay;
+    }
+
+    public HttpCoreConfigBuilder setTcpNoDelay(final Boolean tcpNoDelay) {
+        this.tcpNoDelay = tcpNoDelay;
+        return this;
+    }
+
+    public String getContentCharset() {
+        return contentCharset;
+    }
+
+    public HttpCoreConfigBuilder setContentCharset(final String contentCharset) {
+        this.contentCharset = contentCharset;
+        return this;
+    }
+
+    public String getHttpElementCharset() {
+        return httpElementCharset;
+    }
+
+    public HttpCoreConfigBuilder setHttpElementCharset(final String httpElementCharset) {
+        this.httpElementCharset = httpElementCharset;
+        return this;
+    }
+
+    public CodingErrorAction getMalformedInputAction() {
+        return malformedInputAction;
+    }
+
+    public HttpCoreConfigBuilder setMalformedInputAction(final CodingErrorAction malformedInputAction) {
+        this.malformedInputAction = malformedInputAction;
+        return this;
+    }
+
+    public CodingErrorAction getUnmappableInputAction() {
+        return unmappableInputAction;
+    }
+
+    public HttpCoreConfigBuilder setUnmappableInputAction(final CodingErrorAction unmappableInputAction) {
+        this.unmappableInputAction = unmappableInputAction;
+        return this;
+    }
+
+    public String getOriginServer() {
+        return originServer;
+    }
+
+    public HttpCoreConfigBuilder setOriginServer(final String originServer) {
+        this.originServer = originServer;
+        return this;
+    }
+
+    public HttpVersion getProtocolVersion() {
+        return protocolVersion;
+    }
+
+    public HttpCoreConfigBuilder setProtocolVersion(final HttpVersion protocolVersion) {
+        this.protocolVersion = protocolVersion;
+        return this;
+    }
+
+    public Boolean getStrictTransferEncoding() {
+        return strictTransferEncoding;
+    }
+
+    public HttpCoreConfigBuilder setStrictTransferEncoding(final Boolean strictTransferEncoding) {
+        this.strictTransferEncoding = strictTransferEncoding;
+        return this;
+    }
+
+    public String getUserAgent() {
+        return userAgent;
+    }
+
+    public HttpCoreConfigBuilder setUserAgent(final String userAgent) {
+        this.userAgent = userAgent;
+        return this;
+    }
+
+    public Boolean getUseExpectContinue() {
+        return useExpectContinue;
+    }
+
+    public HttpCoreConfigBuilder setUseExpectContinue(final Boolean useExpectContinue) {
+        this.useExpectContinue = useExpectContinue;
+        return this;
+    }
+    
+    public Integer getWaitForContinue() {
+        return waitForContinue;
+    }
+
+    public HttpCoreConfigBuilder setWaitForContinue(final Integer waitForContinue) {
+        this.waitForContinue = waitForContinue;
+        return this;
+    }
+
+    public void populate(final HttpParams params) {
+        Args.notNull(params, "HTTP parameters");
+        if (connectTimeout != null) {
+            params.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, connectTimeout);
+        }
+        if (maxHeaderCount != null) {
+            params.setParameter(CoreConnectionPNames.MAX_HEADER_COUNT, maxHeaderCount);
+        }
+        if (maxLineLength != null) {
+            params.setParameter(CoreConnectionPNames.MAX_LINE_LENGTH, maxLineLength);
+        }
+        if (minChunkLimit != null) {
+            params.setParameter(CoreConnectionPNames.MIN_CHUNK_LIMIT, minChunkLimit);
+        }
+        if (socketKeepAlive != null) {
+            params.setParameter(CoreConnectionPNames.SO_KEEPALIVE, socketKeepAlive);
+        }
+        if (socketLinger != null) {
+            params.setParameter(CoreConnectionPNames.SO_LINGER, socketLinger);
+        }
+        if (socketReuseAddress != null) {
+            params.setParameter(CoreConnectionPNames.SO_REUSEADDR, socketReuseAddress);
+        }
+        if (socketTimeout != null) {
+            params.setParameter(CoreConnectionPNames.SO_TIMEOUT, socketTimeout);
+        }
+        if (socketBufferSize != null) {
+            params.setParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, socketBufferSize);
+        }
+        if (tcpNoDelay != null) {
+            params.setParameter(CoreConnectionPNames.TCP_NODELAY, tcpNoDelay);
+        }
+        if (contentCharset != null) {
+            params.setParameter(CoreProtocolPNames.HTTP_CONTENT_CHARSET, contentCharset);
+        }
+        if (httpElementCharset != null) {
+            params.setParameter(CoreProtocolPNames.HTTP_ELEMENT_CHARSET, httpElementCharset);
+        }
+        if (malformedInputAction != null) {
+            params.setParameter(CoreProtocolPNames.HTTP_MALFORMED_INPUT_ACTION, malformedInputAction);
+        }
+        if (unmappableInputAction != null) {
+            params.setParameter(CoreProtocolPNames.HTTP_UNMAPPABLE_INPUT_ACTION, unmappableInputAction);
+        }
+        if (originServer != null) {
+            params.setParameter(CoreProtocolPNames.ORIGIN_SERVER, originServer);
+        }
+        if (protocolVersion != null) {
+            params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, protocolVersion);
+        }
+        if (strictTransferEncoding != null) {
+            params.setParameter(CoreProtocolPNames.STRICT_TRANSFER_ENCODING, strictTransferEncoding);
+        }
+        if (useExpectContinue != null) {
+            params.setParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, useExpectContinue);
+        }
+        if (userAgent != null) {
+            params.setParameter(CoreProtocolPNames.USER_AGENT, userAgent);
+        }
+        if (waitForContinue != null) {
+            params.setParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE, waitForContinue);
+        }
+    }
+
+    public HttpParams build() {
+        HttpParams params = new BasicHttpParams();
+        populate(params);
+        return params;
+    }
+    
+}

Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpCoreConfigBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParamBean.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParamBean.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParamBean.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParamBean.java Thu Aug  9 16:28:41 2012
@@ -35,7 +35,10 @@ import org.apache.http.HttpVersion;
  * conventions.
  *
  * @since 4.0
+ * 
+ * @deprecated (4.3) use {@link HttpCoreConfigBuilder}
  */
+@Deprecated
 public class HttpProtocolParamBean extends HttpAbstractParamBean {
 
     public HttpProtocolParamBean (final HttpParams params) {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParams.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParams.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParams.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/params/HttpProtocolParams.java Thu Aug  9 16:28:41 2012
@@ -39,8 +39,9 @@ import org.apache.http.util.Args;
  *
  * @since 4.0
  *
- * @see CoreProtocolPNames
+ * @deprecated (4.3) use {@link HttpCoreConfigBuilder}
  */
+@Deprecated
 public final class HttpProtocolParams implements CoreProtocolPNames {
 
     private HttpProtocolParams() {

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestExpectContinue.java Thu Aug  9 16:28:41 2012
@@ -37,7 +37,8 @@ import org.apache.http.HttpRequestInterc
 import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.annotation.Immutable;
-import org.apache.http.params.HttpProtocolParams;
+import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
 /**
@@ -68,7 +69,8 @@ public class RequestExpectContinue imple
             // Do not send the expect header if request body is known to be empty
             if (entity != null && entity.getContentLength() != 0) {
                 ProtocolVersion ver = request.getRequestLine().getProtocolVersion();
-                if (HttpProtocolParams.useExpectContinue(request.getParams())
+                HttpParams params = request.getParams();
+                if (params.getBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE, false)
                         && !ver.lessEquals(HttpVersion.HTTP_1_0)) {
                     request.addHeader(HTTP.EXPECT_DIRECTIVE, HTTP.EXPECT_CONTINUE);
                 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/main/java/org/apache/http/protocol/RequestUserAgent.java Thu Aug  9 16:28:41 2012
@@ -33,7 +33,8 @@ import org.apache.http.HttpException;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
 import org.apache.http.annotation.Immutable;
-import org.apache.http.params.HttpProtocolParams;
+import org.apache.http.params.CoreProtocolPNames;
+import org.apache.http.params.HttpParams;
 import org.apache.http.util.Args;
 
 /**
@@ -59,7 +60,8 @@ public class RequestUserAgent implements
         throws HttpException, IOException {
         Args.notNull(request, "HTTP request");
         if (!request.containsHeader(HTTP.USER_AGENT)) {
-            String useragent = HttpProtocolParams.getUserAgent(request.getParams());
+            HttpParams params = request.getParams();
+            String useragent = (String) params.getParameter(CoreProtocolPNames.USER_AGENT);
             if (useragent != null) {
                 request.addHeader(HTTP.USER_AGENT, useragent);
             }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/entity/DummyHttpMessage.java Thu Aug  9 16:28:41 2012
@@ -27,9 +27,10 @@
 
 package org.apache.http.impl.entity;
 
+import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.message.AbstractHttpMessage;
-import org.apache.http.params.HttpProtocolParams;
+import org.apache.http.params.CoreProtocolPNames;
 
 class DummyHttpMessage extends AbstractHttpMessage {
 
@@ -38,7 +39,9 @@ class DummyHttpMessage extends AbstractH
     }
 
     public ProtocolVersion getProtocolVersion() {
-        return HttpProtocolParams.getVersion(this.getParams());
+        ProtocolVersion ver = (ProtocolVersion) getParams().getParameter(
+                CoreProtocolPNames.PROTOCOL_VERSION);
+        return ver != null ? ver : HttpVersion.HTTP_1_1;
     }
 
 }

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestSessionBuffers.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestSessionBuffers.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestSessionBuffers.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/impl/io/TestSessionBuffers.java Thu Aug  9 16:28:41 2012
@@ -40,8 +40,8 @@ import org.apache.http.impl.SessionOutpu
 import org.apache.http.io.HttpTransportMetrics;
 import org.apache.http.params.BasicHttpParams;
 import org.apache.http.params.CoreConnectionPNames;
+import org.apache.http.params.HttpCoreConfigBuilder;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.apache.http.util.CharArrayBuffer;
 import org.junit.Assert;
 import org.junit.Test;
@@ -438,8 +438,7 @@ public class TestSessionBuffers {
         String s2 = constructString(RUSSIAN_HELLO);
         String s3 = "Like hello and stuff";
 
-        HttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setHttpElementCharset(params, "UTF-8");
+        HttpParams params = new HttpCoreConfigBuilder().setHttpElementCharset("UTF-8").build();
 
         SessionOutputBufferMock outbuffer = new SessionOutputBufferMock(params);
 
@@ -487,8 +486,7 @@ public class TestSessionBuffers {
         }
         String s = buf.toString();
 
-        HttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setHttpElementCharset(params, "UTF-8");
+        HttpParams params = new HttpCoreConfigBuilder().setHttpElementCharset("UTF-8").build();
 
         SessionOutputBufferMock outbuffer = new SessionOutputBufferMock(params);
 
@@ -507,8 +505,7 @@ public class TestSessionBuffers {
     public void testNonAsciiReadWriteLine() throws Exception {
         String s1 = constructString(SWISS_GERMAN_HELLO);
 
-        HttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setHttpElementCharset(params, Consts.ISO_8859_1.name());
+        HttpParams params = new HttpCoreConfigBuilder().setHttpElementCharset("ISO-8859-1").build();
 
         SessionOutputBufferMock outbuffer = new SessionOutputBufferMock(params);
 
@@ -531,7 +528,6 @@ public class TestSessionBuffers {
         SessionInputBufferMock inbuffer = new SessionInputBufferMock(
                 outbuffer.getData(),
                 params);
-        HttpProtocolParams.setHttpElementCharset(params, Consts.ISO_8859_1.name());
 
         CharArrayBuffer buf = new CharArrayBuffer(64);
         for (int i = 0; i < 10; i++) {
@@ -550,12 +546,14 @@ public class TestSessionBuffers {
 
     @Test
     public void testUnmappableInputAction() throws Exception {
-        BasicHttpParams params = new BasicHttpParams();
         String s = "In valid ISO-8859-1 character string because  of Ŵ and ŵ";
-        HttpProtocolParams.setHttpElementCharset(params, Consts.ISO_8859_1.name());
-
+        
         // Action with report
-        HttpProtocolParams.setUnmappableInputAction(params, CodingErrorAction.REPORT);
+        HttpParams params = new HttpCoreConfigBuilder()
+            .setHttpElementCharset("ISO-8859-1")
+            .setUnmappableInputAction(CodingErrorAction.REPORT)
+            .build();
+
         SessionOutputBufferMock outbuf = new SessionOutputBufferMock(params);
         try {
             outbuf.writeLine(s);
@@ -564,7 +562,10 @@ public class TestSessionBuffers {
         }
 
         // Action with ignore
-        HttpProtocolParams.setUnmappableInputAction(params, CodingErrorAction.IGNORE);
+        params = new HttpCoreConfigBuilder()
+            .setHttpElementCharset("ISO-8859-1")
+            .setUnmappableInputAction(CodingErrorAction.IGNORE)
+            .build();
         outbuf = new SessionOutputBufferMock(params);
         try {
             outbuf.writeLine(s);
@@ -573,7 +574,10 @@ public class TestSessionBuffers {
         }
 
         // Action with replace
-        HttpProtocolParams.setUnmappableInputAction(params, CodingErrorAction.REPLACE);
+        params = new HttpCoreConfigBuilder()
+            .setHttpElementCharset("ISO-8859-1")
+            .setUnmappableInputAction(CodingErrorAction.REPLACE)
+            .build();
         outbuf = new SessionOutputBufferMock(params);
         try {
             outbuf.writeLine(s);
@@ -587,11 +591,11 @@ public class TestSessionBuffers {
         byte[] tmp = constructString(SWISS_GERMAN_HELLO).getBytes("UTF-16");
         CharArrayBuffer buf = new CharArrayBuffer(1);
 
-        BasicHttpParams params = new BasicHttpParams();
-        HttpProtocolParams.setHttpElementCharset(params, "UTF-8");
-
         // Action with report
-        HttpProtocolParams.setMalformedInputAction(params, CodingErrorAction.REPORT);
+        HttpParams params = new HttpCoreConfigBuilder()
+            .setHttpElementCharset("UTF-8")
+            .setMalformedInputAction(CodingErrorAction.REPORT)
+            .build();
         SessionInputBufferMock inbuffer = new SessionInputBufferMock(tmp, params);
         try {
             inbuffer.readLine(buf);
@@ -600,7 +604,10 @@ public class TestSessionBuffers {
         }
 
         // Action with replace
-        HttpProtocolParams.setMalformedInputAction(params, CodingErrorAction.REPLACE);
+        params = new HttpCoreConfigBuilder()
+            .setHttpElementCharset("UTF-8")
+            .setMalformedInputAction(CodingErrorAction.REPLACE)
+            .build();
         inbuffer = new SessionInputBufferMock(tmp, params);
         try {
             inbuffer.readLine(buf);
@@ -609,7 +616,10 @@ public class TestSessionBuffers {
         }
 
         // Action with ignore
-        HttpProtocolParams.setMalformedInputAction(params, CodingErrorAction.IGNORE);
+        params = new HttpCoreConfigBuilder()
+            .setHttpElementCharset("UTF-8")
+            .setMalformedInputAction(CodingErrorAction.IGNORE)
+            .build();
         inbuffer = new SessionInputBufferMock(tmp, params);
         try {
             inbuffer.readLine();

Modified: httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java?rev=1371300&r1=1371299&r2=1371300&view=diff
==============================================================================
--- httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java (original)
+++ httpcomponents/httpcore/trunk/httpcore/src/test/java/org/apache/http/message/TestAbstractMessage.java Thu Aug  9 16:28:41 2012
@@ -29,10 +29,11 @@ package org.apache.http.message;
 
 import org.apache.http.Header;
 import org.apache.http.HttpMessage;
+import org.apache.http.HttpVersion;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.params.BasicHttpParams;
+import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpParams;
-import org.apache.http.params.HttpProtocolParams;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -49,7 +50,9 @@ public class TestAbstractMessage {
         }
 
         public ProtocolVersion getProtocolVersion() {
-            return HttpProtocolParams.getVersion(this.getParams());
+            ProtocolVersion ver = (ProtocolVersion) getParams().getParameter(
+                    CoreProtocolPNames.PROTOCOL_VERSION);
+            return ver != null ? ver : HttpVersion.HTTP_1_1;
         }
 
     }



Mime
View raw message