hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1405509 [2/3] - in /httpcomponents/httpclient/trunk: fluent-hc/src/main/java/org/apache/http/client/fluent/ httpclient/src/examples/org/apache/http/examples/client/ httpclient/src/main/java/org/apache/http/client/ httpclient/src/main/java/...
Date Sun, 04 Nov 2012 07:40:03 GMT
Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java Sun Nov  4 07:40:00 2012
@@ -28,10 +28,10 @@
 package org.apache.http.examples.client;
 
 import org.apache.http.client.ResponseHandler;
-import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.impl.client.BasicResponseHandler;
-import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
 
 /**
  * This example demonstrates the use of the {@link ResponseHandler} to simplify
@@ -40,8 +40,7 @@ import org.apache.http.impl.client.Defau
 public class ClientWithResponseHandler {
 
     public final static void main(String[] args) throws Exception {
-
-        HttpClient httpclient = new DefaultHttpClient();
+        CloseableHttpClient httpclient = HttpClients.createDefault();
         try {
             HttpGet httpget = new HttpGet("http://www.google.com/");
 
@@ -55,10 +54,7 @@ public class ClientWithResponseHandler {
             System.out.println("----------------------------------------");
 
         } finally {
-            // When HttpClient instance is no longer needed,
-            // shut down the connection manager to ensure
-            // immediate deallocation of all system resources
-            httpclient.getConnectionManager().shutdown();
+            httpclient.close();
         }
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/QuickStart.java Sun Nov  4 07:40:00 2012
@@ -30,54 +30,57 @@ import java.util.ArrayList;
 import java.util.List;
 
 import org.apache.http.HttpEntity;
-import org.apache.http.HttpResponse;
 import org.apache.http.NameValuePair;
 import org.apache.http.client.entity.UrlEncodedFormEntity;
+import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.client.methods.HttpPost;
-import org.apache.http.impl.client.DefaultHttpClient;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.message.BasicNameValuePair;
 import org.apache.http.util.EntityUtils;
 
 public class QuickStart {
 
     public static void main(String[] args) throws Exception {
-        DefaultHttpClient httpclient = new DefaultHttpClient();
-        HttpGet httpGet = new HttpGet("http://targethost/homepage");
-
-        HttpResponse response1 = httpclient.execute(httpGet);
-
-        // The underlying HTTP connection is still held by the response object 
-        // to allow the response content to be streamed directly from the network socket. 
-        // In order to ensure correct deallocation of system resources 
-        // the user MUST either fully consume the response content  or abort request 
-        // execution by calling HttpGet#releaseConnection().
-
-        try {
-            System.out.println(response1.getStatusLine());
-            HttpEntity entity1 = response1.getEntity();
-            // do something useful with the response body
-            // and ensure it is fully consumed
-            EntityUtils.consume(entity1);
-        } finally {
-            httpGet.releaseConnection();
-        }
-
-        HttpPost httpPost = new HttpPost("http://targethost/login");
-        List <NameValuePair> nvps = new ArrayList <NameValuePair>();
-        nvps.add(new BasicNameValuePair("username", "vip"));
-        nvps.add(new BasicNameValuePair("password", "secret"));
-        httpPost.setEntity(new UrlEncodedFormEntity(nvps));
-        HttpResponse response2 = httpclient.execute(httpPost);
-
+        CloseableHttpClient httpclient = HttpClients.createDefault();
         try {
-            System.out.println(response2.getStatusLine());
-            HttpEntity entity2 = response2.getEntity();
-            // do something useful with the response body
-            // and ensure it is fully consumed
-            EntityUtils.consume(entity2);
+            HttpGet httpGet = new HttpGet("http://targethost/homepage");
+            CloseableHttpResponse response1 = httpclient.execute(httpGet);
+            // The underlying HTTP connection is still held by the response object
+            // to allow the response content to be streamed directly from the network socket.
+            // In order to ensure correct deallocation of system resources
+            // the user MUST either fully consume the response content  or abort request
+            // execution by calling CloseableHttpResponse#close().
+
+            try {
+                System.out.println(response1.getStatusLine());
+                HttpEntity entity1 = response1.getEntity();
+                // do something useful with the response body
+                // and ensure it is fully consumed
+                EntityUtils.consume(entity1);
+            } finally {
+                response1.close();
+            }
+
+            HttpPost httpPost = new HttpPost("http://targethost/login");
+            List <NameValuePair> nvps = new ArrayList <NameValuePair>();
+            nvps.add(new BasicNameValuePair("username", "vip"));
+            nvps.add(new BasicNameValuePair("password", "secret"));
+            httpPost.setEntity(new UrlEncodedFormEntity(nvps));
+            CloseableHttpResponse response2 = httpclient.execute(httpPost);
+
+            try {
+                System.out.println(response2.getStatusLine());
+                HttpEntity entity2 = response2.getEntity();
+                // do something useful with the response body
+                // and ensure it is fully consumed
+                EntityUtils.consume(entity2);
+            } finally {
+                response2.close();
+            }
         } finally {
-            httpPost.releaseConnection();
+            httpclient.close();
         }
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/HttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/HttpClient.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/HttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/HttpClient.java Sun Nov  4 07:40:00 2012
@@ -34,6 +34,7 @@ import org.apache.http.HttpRequest;
 import org.apache.http.HttpResponse;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 
@@ -47,7 +48,7 @@ import org.apache.http.protocol.HttpCont
  * <p/>
  * The usual execution flow can be demonstrated by the code snippet below:
  * <PRE>
- * HttpClient httpclient = new DefaultHttpClient();
+ * MinimalHttpClient httpclient = HttpClientBuilder.buildDefault();
  *
  * // Prepare a request object
  * HttpGet httpget = new HttpGet("http://www.apache.org/");
@@ -93,15 +94,15 @@ import org.apache.http.protocol.HttpCont
  *
  *     }
  *
- *     // When HttpClient instance is no longer needed,
- *     // shut down the connection manager to ensure
- *     // immediate deallocation of all system resources
- *     httpclient.getConnectionManager().shutdown();
+ *     // When HttpClient instance is no longer needed, it can be closed
+ *     // to ensure immediate deallocation of all system resources
+ *     httpclient.close();
  * }
  * </PRE>
  *
  * @since 4.0
  */
+@SuppressWarnings("deprecation")
 public interface HttpClient {
 
 
@@ -119,7 +120,10 @@ public interface HttpClient {
      * Obtains the connection manager used by this client.
      *
      * @return  the connection manager
+     *
+     * @deprecated (4.3) use {@link HttpClientBuilder}.
      */
+    @Deprecated
     ClientConnectionManager getConnectionManager();
 
     /**

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java&p1=httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/methods/CloseableHttpResponse.java Sun Nov  4 07:40:00 2012
@@ -24,24 +24,17 @@
  * <http://www.apache.org/>.
  *
  */
-package org.apache.http.client.utils;
 
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.junit.Test;
-
-public class TestHttpClientUtils {
+package org.apache.http.client.methods;
 
-    @Test
-    public void testCloseQuietlyNullClient() throws Exception {
-        HttpClient httpClient = null;
-        HttpClientUtils.closeQuietly(httpClient);
-    }
+import java.io.Closeable;
 
-    @Test
-    public void testCloseQuietlyResponseNull() throws Exception {
-        HttpResponse response = null;
-        HttpClientUtils.closeQuietly(response);
-    }
+import org.apache.http.HttpResponse;
 
+/**
+ * Extended version of the {@link HttpResponse} interface that also extends {@link Closeable}.
+ * 
+ * @since 4.3
+ */
+public interface CloseableHttpResponse extends HttpResponse, Closeable {
 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/client/utils/HttpClientUtils.java Sun Nov  4 07:40:00 2012
@@ -34,7 +34,7 @@ import org.apache.http.client.HttpClient
 import org.apache.http.util.EntityUtils;
 
 /**
- * Static helpers for dealing with {@link HttpResponse}s and {@link HttpClient}s.
+ * Static helpers for dealing with {@link HttpResponse}s.
  * 
  * @since 4.2
  */
@@ -97,7 +97,10 @@ public class HttpClientUtils {
      * @param httpClient
      *            the HttpClient to close, may be null or already closed.
      * @since 4.2
+     *
+     * @deprecated (4.3) do not use.
      */
+    @Deprecated
     public static void closeQuietly(final HttpClient httpClient) {
         if (httpClient != null) {
             httpClient.getConnectionManager().shutdown();

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java Sun Nov  4 07:40:00 2012
@@ -37,7 +37,6 @@ import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
 import org.apache.http.HttpRequestInterceptor;
-import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.annotation.GuardedBy;
 import org.apache.http.annotation.ThreadSafe;
@@ -55,6 +54,7 @@ import org.apache.http.client.RedirectHa
 import org.apache.http.client.RedirectStrategy;
 import org.apache.http.client.RequestDirector;
 import org.apache.http.client.UserTokenHandler;
+import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.params.AuthPolicy;
 import org.apache.http.client.params.ClientPNames;
 import org.apache.http.client.params.CookiePolicy;
@@ -72,6 +72,7 @@ import org.apache.http.impl.auth.DigestS
 import org.apache.http.impl.auth.KerberosSchemeFactory;
 import org.apache.http.impl.auth.NTLMSchemeFactory;
 import org.apache.http.impl.auth.SPNegoSchemeFactory;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
 import org.apache.http.impl.conn.BasicClientConnectionManager;
 import org.apache.http.impl.conn.DefaultHttpRoutePlanner;
 import org.apache.http.impl.conn.SchemeRegistryFactory;
@@ -178,7 +179,7 @@ import org.apache.http.protocol.Immutabl
  */
 @ThreadSafe
 @Deprecated
-public abstract class AbstractHttpClient extends AbstractBasicHttpClient {
+public abstract class AbstractHttpClient extends CloseableHttpClient {
 
     private final Log log = LogFactory.getLog(getClass());
 
@@ -775,7 +776,7 @@ public abstract class AbstractHttpClient
         protocolProcessor = null;
     }
 
-    public final HttpResponse execute(HttpHost target, HttpRequest request,
+    public final CloseableHttpResponse execute(HttpHost target, HttpRequest request,
                                       HttpContext context)
         throws IOException, ClientProtocolException {
 
@@ -828,9 +829,10 @@ public abstract class AbstractHttpClient
                                 ClientPNames.DEFAULT_HOST);
                 HttpRoute route = routePlanner.determineRoute(targetForRoute, request, execContext);
 
-                HttpResponse out;
+                CloseableHttpResponse out;
                 try {
-                    out = director.execute(target, request, execContext);
+                    out = CloseableHttpResponseProxy.newProxy(
+                            director.execute(target, request, execContext));
                 } catch (RuntimeException re) {
                     if (connectionBackoffStrategy.shouldBackoff(re)) {
                         backoffManager.backOff(route);
@@ -851,7 +853,8 @@ public abstract class AbstractHttpClient
                 }
                 return out;
             } else {
-                return director.execute(target, request, execContext);
+                return CloseableHttpResponseProxy.newProxy(
+                        director.execute(target, request, execContext));
             }
         } catch(HttpException httpException) {
             throw new ClientProtocolException(httpException);
@@ -976,4 +979,9 @@ public abstract class AbstractHttpClient
             (null, getParams(), req.getParams(), null);
     }
 
+
+    public void close() {
+        getConnectionManager().shutdown();
+    }
+
 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AutoRetryHttpClient.java Sun Nov  4 07:40:00 2012
@@ -42,6 +42,7 @@ import org.apache.http.client.ResponseHa
 import org.apache.http.client.ServiceUnavailableRetryStrategy;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.EntityUtils;

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractBasicHttpClient.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractBasicHttpClient.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractBasicHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java Sun Nov  4 07:40:00 2012
@@ -27,6 +27,7 @@
 
 package org.apache.http.impl.client;
 
+import java.io.Closeable;
 import java.io.IOException;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.URI;
@@ -41,20 +42,26 @@ import org.apache.http.annotation.Thread
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.ResponseHandler;
+import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.client.utils.URIUtils;
 import org.apache.http.protocol.HttpContext;
 import org.apache.http.util.EntityUtils;
 
 /**
+ * Minimal implementation of {@link HttpClient} that also implements {@link Closeable}.
+ *
  * @since 4.3
  */
 @ThreadSafe
-public abstract class AbstractBasicHttpClient implements HttpClient {
+public abstract class CloseableHttpClient implements HttpClient, Closeable {
 
     private final Log log = LogFactory.getLog(getClass());
 
-    public HttpResponse execute(
+    public abstract CloseableHttpResponse execute(HttpHost target, HttpRequest request,
+            HttpContext context) throws IOException, ClientProtocolException;
+
+    public CloseableHttpResponse execute(
             final HttpUriRequest request,
             final HttpContext context) throws IOException, ClientProtocolException {
         if (request == null) {
@@ -79,12 +86,12 @@ public abstract class AbstractBasicHttpC
         return target;
     }
 
-    public HttpResponse execute(
+    public CloseableHttpResponse execute(
             final HttpUriRequest request) throws IOException, ClientProtocolException {
         return execute(request, (HttpContext) null);
     }
 
-    public HttpResponse execute(
+    public CloseableHttpResponse execute(
             final HttpHost target,
             final HttpRequest request) throws IOException, ClientProtocolException {
         return execute(target, request, (HttpContext) null);

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpClient.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpResponseProxy.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpResponseProxy.java?rev=1405509&view=auto
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpResponseProxy.java (added)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpResponseProxy.java Sun Nov  4 07:40:00 2012
@@ -0,0 +1,87 @@
+/*
+ * ====================================================================
+ * 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.impl.client;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.apache.http.HttpEntity;
+import org.apache.http.HttpResponse;
+import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.client.methods.CloseableHttpResponse;
+import org.apache.http.util.EntityUtils;
+
+/**
+ * @since 4.3
+ */
+@NotThreadSafe
+class CloseableHttpResponseProxy implements InvocationHandler {
+
+    private final HttpResponse original;
+
+    CloseableHttpResponseProxy(final HttpResponse original) {
+        super();
+        this.original = original;
+    }
+
+    public void close() throws IOException {
+        HttpEntity entity = this.original.getEntity();
+        EntityUtils.consume(entity);
+    }
+
+    public Object invoke(
+            final Object proxy, final Method method, final Object[] args) throws Throwable {
+        String mname = method.getName();
+        if (mname.equals("close")) {
+            close();
+            return null;
+        } else {
+            try {
+                return method.invoke(original, args);
+            } catch (InvocationTargetException ex) {
+                Throwable cause = ex.getCause();
+                if (cause != null) {
+                    throw cause;
+                } else {
+                    throw ex;
+                }
+            }
+        }
+    }
+
+    public static CloseableHttpResponse newProxy(final HttpResponse original) {
+        return (CloseableHttpResponse) Proxy.newProxyInstance(
+                CloseableHttpResponseProxy.class.getClassLoader(),
+                new Class<?>[] { CloseableHttpResponse.class },
+                new CloseableHttpResponseProxy(original));
+    }
+
+}

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpResponseProxy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpResponseProxy.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/CloseableHttpResponseProxy.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/ContentEncodingHttpClient.java Sun Nov  4 07:40:00 2012
@@ -31,6 +31,7 @@ import org.apache.http.client.HttpClient
 import org.apache.http.client.protocol.RequestAcceptEncoding;
 import org.apache.http.client.protocol.ResponseContentEncoding;
 import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpProcessor;
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DecompressingHttpClient.java Sun Nov  4 07:40:00 2012
@@ -44,6 +44,7 @@ import org.apache.http.client.protocol.R
 import org.apache.http.client.protocol.ResponseContentEncoding;
 import org.apache.http.client.utils.URIUtils;
 import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
 import org.apache.http.params.HttpParams;
 import org.apache.http.protocol.BasicHttpContext;
 import org.apache.http.protocol.HttpContext;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java Sun Nov  4 07:40:00 2012
@@ -38,6 +38,7 @@ import org.apache.http.client.protocol.R
 import org.apache.http.client.protocol.RequestTargetAuthentication;
 import org.apache.http.client.protocol.ResponseProcessCookies;
 import org.apache.http.conn.ClientConnectionManager;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
 import org.apache.http.params.CoreConnectionPNames;
 import org.apache.http.params.CoreProtocolPNames;
 import org.apache.http.params.HttpConnectionParams;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/EntityEnclosingRequestWrapper.java Sun Nov  4 07:40:00 2012
@@ -33,7 +33,6 @@ import java.io.OutputStream;
 
 import org.apache.http.annotation.NotThreadSafe;
 import org.apache.http.entity.HttpEntityWrapper;
-import org.apache.http.impl.client.exec.HttpRequestWrapper;
 
 import org.apache.http.Header;
 import org.apache.http.HttpEntity;
@@ -51,7 +50,7 @@ import org.apache.http.protocol.HTTP;
  *
  * @since 4.0
  * 
- * @deprecated (4.3) use {@link HttpRequestWrapper}.
+ * @deprecated (4.3) do not use.
  */
 @Deprecated 
 @NotThreadSafe // e.g. [gs]etEntity()

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClients.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClients.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClients.java&p1=httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClients.java Sun Nov  4 07:40:00 2012
@@ -24,24 +24,28 @@
  * <http://www.apache.org/>.
  *
  */
-package org.apache.http.client.utils;
 
-import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
-import org.junit.Test;
-
-public class TestHttpClientUtils {
-
-    @Test
-    public void testCloseQuietlyNullClient() throws Exception {
-        HttpClient httpClient = null;
-        HttpClientUtils.closeQuietly(httpClient);
+package org.apache.http.impl.client;
+
+import org.apache.http.annotation.Immutable;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
+
+/**
+ * @since 4.3
+ */
+@Immutable
+public class HttpClients {
+
+    private HttpClients() {
+        super();
+    }
+
+    public static HttpClientBuilder custom() {
+        return HttpClientBuilder.create();
     }
 
-    @Test
-    public void testCloseQuietlyResponseNull() throws Exception {
-        HttpResponse response = null;
-        HttpClientUtils.closeQuietly(response);
+    public static CloseableHttpClient createDefault() {
+        return HttpClientBuilder.create().build();
     }
 
 }

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/RequestWrapper.java Sun Nov  4 07:40:00 2012
@@ -37,7 +37,6 @@ import org.apache.http.ProtocolException
 import org.apache.http.ProtocolVersion;
 import org.apache.http.RequestLine;
 import org.apache.http.client.methods.HttpUriRequest;
-import org.apache.http.impl.client.exec.HttpRequestWrapper;
 import org.apache.http.message.AbstractHttpMessage;
 import org.apache.http.message.BasicRequestLine;
 import org.apache.http.params.HttpProtocolParams;
@@ -52,7 +51,7 @@ import org.apache.http.params.HttpProtoc
  *
  * @since 4.0
  * 
- * @deprecated (4.3) use {@link HttpRequestWrapper}.
+ * @deprecated (4.3) do not use.
  */
 @NotThreadSafe
 @Deprecated 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/SystemDefaultHttpClient.java Sun Nov  4 07:40:00 2012
@@ -35,6 +35,7 @@ import org.apache.http.conn.ClientConnec
 import org.apache.http.conn.routing.HttpRoutePlanner;
 import org.apache.http.impl.DefaultConnectionReuseStrategy;
 import org.apache.http.impl.NoConnectionReuseStrategy;
+import org.apache.http.impl.client.builder.HttpClientBuilder;
 import org.apache.http.impl.conn.PoolingClientConnectionManager;
 import org.apache.http.impl.conn.ProxySelectorRoutePlanner;
 import org.apache.http.impl.conn.SchemeRegistryFactory;

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/BackoffStrategyExec.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/BackoffStrategyExec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/BackoffStrategyExec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/BackoffStrategyExec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/BackoffStrategyExec.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/BackoffStrategyExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/BackoffStrategyExec.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.lang.reflect.UndeclaredThrowableException;
@@ -42,7 +42,7 @@ import org.apache.http.protocol.HttpCont
  * @since 4.3
  */
 @ThreadSafe
-public class BackoffStrategyExec implements ClientExecChain {
+class BackoffStrategyExec implements ClientExecChain {
 
     private final ClientExecChain requestExecutor;
     private final ConnectionBackoffStrategy connectionBackoffStrategy;

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/BackoffStrategyExec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/BackoffStrategyExec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/BackoffStrategyExec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ClientExecChain.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ClientExecChain.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ClientExecChain.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ClientExecChain.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ClientExecChain.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ClientExecChain.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ClientExecChain.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 
@@ -47,7 +47,7 @@ import org.apache.http.protocol.HttpCont
  *
  * @since 4.3
  */
-public interface ClientExecChain {
+interface ClientExecChain {
 
     HttpResponseWrapper execute(
             HttpRoute route,

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ClientExecChain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ClientExecChain.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ClientExecChain.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ConnectionReleaseTriggerImpl.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ConnectionReleaseTriggerImpl.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ConnectionReleaseTriggerImpl.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ConnectionReleaseTriggerImpl.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ConnectionReleaseTriggerImpl.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ConnectionReleaseTriggerImpl.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ConnectionReleaseTriggerImpl.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ConnectionReleaseTriggerImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ConnectionReleaseTriggerImpl.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ConnectionReleaseTriggerImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpClientBuilder.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpClientBuilder.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpClientBuilder.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpClientBuilder.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client;
+package org.apache.http.impl.client.builder;
 
 import java.net.ProxySelector;
 import java.util.ArrayList;
@@ -76,13 +76,16 @@ import org.apache.http.impl.auth.DigestS
 import org.apache.http.impl.auth.KerberosSchemeFactory;
 import org.apache.http.impl.auth.NTLMSchemeFactory;
 import org.apache.http.impl.auth.SPNegoSchemeFactory;
-import org.apache.http.impl.client.exec.BackoffStrategyExec;
-import org.apache.http.impl.client.exec.ClientExecChain;
-import org.apache.http.impl.client.exec.MainClientExec;
-import org.apache.http.impl.client.exec.ProtocolExec;
-import org.apache.http.impl.client.exec.RedirectExec;
-import org.apache.http.impl.client.exec.RetryExec;
-import org.apache.http.impl.client.exec.ServiceUnavailableRetryExec;
+import org.apache.http.impl.client.BasicCookieStore;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy;
+import org.apache.http.impl.client.DefaultHttpRequestRetryHandler;
+import org.apache.http.impl.client.DefaultRedirectStrategy;
+import org.apache.http.impl.client.DefaultUserTokenHandler;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.NoopUserTokenHandler;
+import org.apache.http.impl.client.ProxyAuthenticationStrategy;
+import org.apache.http.impl.client.TargetAuthenticationStrategy;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.impl.conn.DefaultHttpRoutePlanner;
 import org.apache.http.impl.conn.ProxySelectorRoutePlanner;
@@ -226,7 +229,11 @@ public class HttpClientBuilder {
     private int maxConnTotal = 0;
     private int maxConnPerRoute = 0;
 
-    public HttpClientBuilder() {
+    public static HttpClientBuilder create() {
+        return new HttpClientBuilder();
+    }
+
+    HttpClientBuilder() {
         super();
     }
 
@@ -432,7 +439,7 @@ public class HttpClientBuilder {
         return protocolExec;
     }
 
-    public HttpClient build() {
+    public CloseableHttpClient build() {
         // Create main request executor
         HttpRequestExecutor requestExec = this.requestExec;
         if (requestExec == null) {

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpClientBuilder.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpClientBuilder.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpClientBuilder.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpRequestWrapper.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/HttpRequestWrapper.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpRequestWrapper.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpRequestWrapper.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/HttpRequestWrapper.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/HttpRequestWrapper.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpRequestWrapper.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -57,7 +57,7 @@ import org.apache.http.protocol.HTTP;
  * @since 4.3
  */
 @NotThreadSafe
-public class HttpRequestWrapper extends AbstractHttpMessage implements HttpRequest {
+class HttpRequestWrapper extends AbstractHttpMessage implements HttpRequest {
 
     private final HttpRequest original;
 

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpRequestWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpRequestWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpRequestWrapper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpResponseWrapper.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/HttpResponseWrapper.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpResponseWrapper.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpResponseWrapper.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/HttpResponseWrapper.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/HttpResponseWrapper.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpResponseWrapper.java Sun Nov  4 07:40:00 2012
@@ -25,9 +25,8 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
-import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
@@ -41,6 +40,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.ProtocolVersion;
 import org.apache.http.StatusLine;
 import org.apache.http.annotation.NotThreadSafe;
+import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.conn.ConnectionReleaseTrigger;
 import org.apache.http.conn.EofSensorInputStream;
 import org.apache.http.conn.EofSensorWatcher;
@@ -55,7 +55,7 @@ import org.apache.http.util.EntityUtils;
  * @since 4.3
  */
 @NotThreadSafe
-public class HttpResponseWrapper implements HttpResponse, ConnectionReleaseTrigger, Closeable {
+class HttpResponseWrapper implements CloseableHttpResponse, ConnectionReleaseTrigger {
 
     private final HttpResponse original;
     private final ConnectionReleaseTriggerImpl connReleaseTrigger;

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpResponseWrapper.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpResponseWrapper.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/HttpResponseWrapper.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/InternalHttpClient.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.util.concurrent.TimeUnit;
@@ -33,13 +33,13 @@ import java.util.concurrent.TimeUnit;
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
-import org.apache.http.HttpResponse;
 import org.apache.http.annotation.ThreadSafe;
 import org.apache.http.auth.AuthSchemeRegistry;
 import org.apache.http.auth.AuthState;
 import org.apache.http.client.ClientProtocolException;
 import org.apache.http.client.CookieStore;
 import org.apache.http.client.CredentialsProvider;
+import org.apache.http.client.methods.CloseableHttpResponse;
 import org.apache.http.client.methods.HttpExecutionAware;
 import org.apache.http.client.params.ClientPNames;
 import org.apache.http.client.protocol.ClientContext;
@@ -51,8 +51,7 @@ import org.apache.http.conn.routing.Http
 import org.apache.http.conn.routing.HttpRoutePlanner;
 import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.cookie.CookieSpecRegistry;
-import org.apache.http.impl.client.exec.ClientExecChain;
-import org.apache.http.impl.client.exec.HttpRequestWrapper;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.params.DefaultedHttpParams;
 import org.apache.http.params.HttpParams;
 import org.apache.http.params.SyncBasicHttpParams;
@@ -62,8 +61,9 @@ import org.apache.http.protocol.HttpCont
 /**
  * @since 4.3
  */
+@SuppressWarnings("deprecation")
 @ThreadSafe
-class InternalHttpClient extends AbstractBasicHttpClient {
+class InternalHttpClient extends CloseableHttpClient {
 
     private final ClientExecChain execChain;
     private final HttpClientConnectionManager connManager;
@@ -143,7 +143,7 @@ class InternalHttpClient extends Abstrac
         return context;
     }
 
-    public HttpResponse execute(
+    public CloseableHttpResponse execute(
             final HttpHost target,
             final HttpRequest request,
             final HttpContext context) throws IOException, ClientProtocolException {
@@ -173,6 +173,10 @@ class InternalHttpClient extends Abstrac
         return this.params;
     }
 
+    public void close() {
+        getConnectionManager().shutdown();
+    }
+
     public ClientConnectionManager getConnectionManager() {
 
         return new ClientConnectionManager() {

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/InternalHttpClient.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/MainClientExec.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/MainClientExec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/MainClientExec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/MainClientExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/MainClientExec.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.io.InterruptedIOException;
@@ -107,7 +107,7 @@ import org.apache.http.util.EntityUtils;
  * @since 4.3
  */
 @ThreadSafe
-public class MainClientExec implements ClientExecChain {
+class MainClientExec implements ClientExecChain {
 
     private final Log log = LogFactory.getLog(getClass());
 

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/MainClientExec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/MainClientExec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/MainClientExec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ProtocolExec.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ProtocolExec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ProtocolExec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ProtocolExec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ProtocolExec.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ProtocolExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ProtocolExec.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.net.URI;
@@ -52,7 +52,7 @@ import org.apache.http.protocol.HttpProc
  * @since 4.3
  */
 @ThreadSafe
-public class ProtocolExec implements ClientExecChain {
+class ProtocolExec implements ClientExecChain {
 
     private final Log log = LogFactory.getLog(getClass());
 

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ProtocolExec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ProtocolExec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ProtocolExec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RedirectExec.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/RedirectExec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RedirectExec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RedirectExec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/RedirectExec.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/RedirectExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RedirectExec.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.net.URI;
@@ -62,7 +62,7 @@ import org.apache.http.protocol.HttpCont
  * @since 4.3
  */
 @ThreadSafe
-public class RedirectExec implements ClientExecChain {
+class RedirectExec implements ClientExecChain {
 
     private final Log log = LogFactory.getLog(getClass());
 

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RedirectExec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RedirectExec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RedirectExec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RetryExec.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/RetryExec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RetryExec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RetryExec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/RetryExec.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/RetryExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RetryExec.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 
@@ -46,7 +46,7 @@ import org.apache.http.protocol.HttpCont
  * @since 4.3
  */
 @NotThreadSafe // e.g. managedConn
-public class RetryExec implements ClientExecChain {
+class RetryExec implements ClientExecChain {
 
     private final Log log = LogFactory.getLog(getClass());
 

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RetryExec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RetryExec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/RetryExec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ServiceUnavailableRetryExec.java (from r1405508, httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ServiceUnavailableRetryExec.java)
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ServiceUnavailableRetryExec.java?p2=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ServiceUnavailableRetryExec.java&p1=httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ServiceUnavailableRetryExec.java&r1=1405508&r2=1405509&rev=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/exec/ServiceUnavailableRetryExec.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ServiceUnavailableRetryExec.java Sun Nov  4 07:40:00 2012
@@ -25,7 +25,7 @@
  *
  */
 
-package org.apache.http.impl.client.exec;
+package org.apache.http.impl.client.builder;
 
 import java.io.IOException;
 import java.io.InterruptedIOException;
@@ -46,7 +46,7 @@ import org.apache.http.protocol.HttpCont
  * @since 4.3
  */
 @ThreadSafe
-public class ServiceUnavailableRetryExec implements ClientExecChain {
+class ServiceUnavailableRetryExec implements ClientExecChain {
 
     private final Log log = LogFactory.getLog(getClass());
 

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ServiceUnavailableRetryExec.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ServiceUnavailableRetryExec.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/builder/ServiceUnavailableRetryExec.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultClientConnection.java Sun Nov  4 07:40:00 2012
@@ -72,6 +72,7 @@ import org.apache.http.conn.OperatedClie
  *
  * @since 4.0
  */
+@SuppressWarnings("deprecation")
 @NotThreadSafe // connSecure, targetHost
 public class DefaultClientConnection extends SocketHttpClientConnection
     implements OperatedClientConnection, HttpSSLConnection, HttpContext {

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/client/utils/TestHttpClientUtils.java Sun Nov  4 07:40:00 2012
@@ -27,18 +27,11 @@
 package org.apache.http.client.utils;
 
 import org.apache.http.HttpResponse;
-import org.apache.http.client.HttpClient;
 import org.junit.Test;
 
 public class TestHttpClientUtils {
 
     @Test
-    public void testCloseQuietlyNullClient() throws Exception {
-        HttpClient httpClient = null;
-        HttpClientUtils.closeQuietly(httpClient);
-    }
-
-    @Test
     public void testCloseQuietlyResponseNull() throws Exception {
         HttpResponse response = null;
         HttpClientUtils.closeQuietly(response);

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestConnectionReuse.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestConnectionReuse.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestConnectionReuse.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/conn/TestConnectionReuse.java Sun Nov  4 07:40:00 2012
@@ -38,7 +38,7 @@ import org.apache.http.HttpResponse;
 import org.apache.http.HttpResponseInterceptor;
 import org.apache.http.client.HttpClient;
 import org.apache.http.client.methods.HttpGet;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.localserver.LocalTestServer;
 import org.apache.http.localserver.RandomHandler;
@@ -83,7 +83,7 @@ public class TestConnectionReuse {
         mgr.setMaxTotal(5);
         mgr.setDefaultMaxPerRoute(5);
 
-        HttpClient client = new HttpClientBuilder().setConnectionManager(mgr).build();
+        HttpClient client = HttpClients.custom().setConnectionManager(mgr).build();
         HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
 
         WorkerThread[] workers = new WorkerThread[10];
@@ -142,7 +142,7 @@ public class TestConnectionReuse {
         mgr.setMaxTotal(5);
         mgr.setDefaultMaxPerRoute(5);
 
-        HttpClient client = new HttpClientBuilder().setConnectionManager(mgr).build();
+        HttpClient client = HttpClients.custom().setConnectionManager(mgr).build();
 
         HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
 
@@ -192,7 +192,7 @@ public class TestConnectionReuse {
         mgr.setMaxTotal(5);
         mgr.setDefaultMaxPerRoute(5);
 
-        HttpClient client = new HttpClientBuilder().setConnectionManager(mgr).build();
+        HttpClient client = HttpClients.custom().setConnectionManager(mgr).build();
 
         HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
 
@@ -243,7 +243,7 @@ public class TestConnectionReuse {
         mgr.setMaxTotal(1);
         mgr.setDefaultMaxPerRoute(1);
 
-        HttpClient client = new HttpClientBuilder().setConnectionManager(mgr).build();
+        HttpClient client = HttpClients.custom().setConnectionManager(mgr).build();
 
         HttpHost target = new HttpHost(saddress.getHostName(), saddress.getPort(), "http");
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestRequestRetryHandler.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestRequestRetryHandler.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestRequestRetryHandler.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/TestRequestRetryHandler.java Sun Nov  4 07:40:00 2012
@@ -57,7 +57,7 @@ public class TestRequestRetryHandler {
         HttpClientConnectionManager connManager = new PoolingHttpClientConnectionManager(schemeRegistry);
         TestHttpRequestRetryHandler testRetryHandler = new TestHttpRequestRetryHandler();
 
-        HttpClient client = new HttpClientBuilder()
+        HttpClient client = HttpClients.custom()
             .setConnectionManager(connManager)
             .setRetryHandler(testRetryHandler).build();
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/IntegrationTestBase.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/IntegrationTestBase.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/IntegrationTestBase.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/IntegrationTestBase.java Sun Nov  4 07:40:00 2012
@@ -25,18 +25,18 @@
  */
 package org.apache.http.impl.client.integration;
 
-import org.apache.http.client.HttpClient;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.localserver.LocalServerTestBase;
 import org.junit.After;
 
 public class IntegrationTestBase extends LocalServerTestBase {
 
-    protected HttpClient httpclient;
+    protected CloseableHttpClient httpclient;
 
     @After
     public void shutDownClient() throws Exception {
         if (this.httpclient != null) {
-            this.httpclient.getConnectionManager().shutdown();
+            this.httpclient.close();
         }
     }
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestAbortHandling.java Sun Nov  4 07:40:00 2012
@@ -50,7 +50,8 @@ import org.apache.http.conn.routing.Http
 import org.apache.http.conn.scheme.Scheme;
 import org.apache.http.conn.scheme.SchemeRegistry;
 import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 import org.apache.http.impl.conn.SchemeRegistryFactory;
 import org.apache.http.message.BasicHeader;
@@ -110,7 +111,7 @@ public class TestAbortHandling extends I
 
         t.start();
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.createDefault();
 
         HttpContext context = new BasicHttpContext();
         try {
@@ -123,11 +124,6 @@ public class TestAbortHandling extends I
         Assert.assertNotNull("Request should exist",reqWrapper);
     }
 
-    /**
-     * Tests that if abort is called on an {@link AbortableHttpRequest} while
-     * {@link DefaultRequestDirector} is allocating a connection, that the
-     * connection is properly aborted.
-     */
     @Test
     public void testAbortInAllocate() throws Exception {
         CountDownLatch connLatch = new CountDownLatch(1);
@@ -135,7 +131,7 @@ public class TestAbortHandling extends I
         final ConMan conMan = new ConMan(connLatch, awaitLatch);
         final AtomicReference<Throwable> throwableRef = new AtomicReference<Throwable>();
         final CountDownLatch getLatch = new CountDownLatch(1);
-        final HttpClient client = new HttpClientBuilder().setConnectionManager(conMan).build();
+        final CloseableHttpClient client = HttpClients.custom().setConnectionManager(conMan).build();
         final HttpContext context = new BasicHttpContext();
         final HttpGet httpget = new HttpGet("http://www.example.com/a");
         this.httpclient = client;
@@ -175,7 +171,7 @@ public class TestAbortHandling extends I
         final PoolingHttpClientConnectionManager conMan = new PoolingHttpClientConnectionManager();
         final AtomicReference<Throwable> throwableRef = new AtomicReference<Throwable>();
         final CountDownLatch getLatch = new CountDownLatch(1);
-        final HttpClient client = new HttpClientBuilder().setConnectionManager(conMan).build();
+        final CloseableHttpClient client = HttpClients.custom().setConnectionManager(conMan).build();
         final HttpContext context = new BasicHttpContext();
         final HttpGet httpget = new CustomGet("a", releaseLatch);
         this.httpclient = client;
@@ -215,7 +211,7 @@ public class TestAbortHandling extends I
         final AtomicReference<Throwable> throwableRef = new AtomicReference<Throwable>();
         final CountDownLatch getLatch = new CountDownLatch(1);
         final CountDownLatch startLatch = new CountDownLatch(1);
-        final HttpClient client = new HttpClientBuilder().setConnectionManager(conMan).build();
+        final CloseableHttpClient client = HttpClients.custom().setConnectionManager(conMan).build();
         final HttpContext context = new BasicHttpContext();
         final HttpGet httpget = new HttpGet("a");
         this.httpclient = client;
@@ -261,7 +257,7 @@ public class TestAbortHandling extends I
         final ConnMan4 conMan = new ConnMan4(connLatch, awaitLatch);
         final AtomicReference<Throwable> throwableRef = new AtomicReference<Throwable>();
         final CountDownLatch getLatch = new CountDownLatch(1);
-        final HttpClient client = new HttpClientBuilder().setConnectionManager(conMan).build();
+        final CloseableHttpClient client = HttpClients.custom().setConnectionManager(conMan).build();
         final HttpContext context = new BasicHttpContext();
         final HttpGet httpget = new HttpGet("a");
         this.httpclient = client;
@@ -315,7 +311,7 @@ public class TestAbortHandling extends I
                 Mockito.any(HttpRoute.class), Mockito.any())).thenReturn(connrequest);
         Mockito.when(connmgr.getSchemeRegistry()).thenReturn(schemeRegistry);
 
-        final HttpClient client = new HttpClientBuilder().setConnectionManager(connmgr).build();
+        final HttpClient client = HttpClients.custom().setConnectionManager(connmgr).build();
         final HttpContext context = new BasicHttpContext();
         final HttpGet httpget = new HttpGet("http://www.example.com/a");
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthentication.java Sun Nov  4 07:40:00 2012
@@ -49,11 +49,11 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.entity.InputStreamEntity;
 import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.auth.BasicScheme;
 import org.apache.http.impl.client.BasicAuthCache;
 import org.apache.http.impl.client.BasicCredentialsProvider;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.client.TargetAuthenticationStrategy;
-import org.apache.http.impl.auth.BasicScheme;
 import org.apache.http.localserver.BasicAuthTokenExtractor;
 import org.apache.http.localserver.LocalTestServer;
 import org.apache.http.localserver.RequestBasicAuth;
@@ -164,7 +164,7 @@ public class TestClientAuthentication ex
         this.localServer.register("*", new AuthHandler());
 
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(null);
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpGet httpget = new HttpGet("/");
 
@@ -185,7 +185,7 @@ public class TestClientAuthentication ex
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "all-wrong"));
 
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpGet httpget = new HttpGet("/");
 
@@ -206,7 +206,7 @@ public class TestClientAuthentication ex
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpGet httpget = new HttpGet("/");
 
@@ -237,7 +237,7 @@ public class TestClientAuthentication ex
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpPut httpput = new HttpPut("/");
         httpput.setEntity(new InputStreamEntity(
@@ -259,7 +259,7 @@ public class TestClientAuthentication ex
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpPut httpput = new HttpPut("/");
         httpput.setEntity(new InputStreamEntity(
@@ -286,7 +286,7 @@ public class TestClientAuthentication ex
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpPost httppost = new HttpPost("/");
         httppost.setEntity(new StringEntity("some important stuff", Consts.ASCII));
@@ -308,7 +308,7 @@ public class TestClientAuthentication ex
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpPost httppost = new HttpPost("/");
         httppost.setEntity(new InputStreamEntity(
@@ -361,7 +361,7 @@ public class TestClientAuthentication ex
                 new UsernamePasswordCredentials("test", "test"));
         TestTargetAuthenticationStrategy authStrategy = new TestTargetAuthenticationStrategy();
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .setCredentialsProvider(credsProvider)
             .setTargetAuthenticationStrategy(authStrategy)
             .build();
@@ -393,7 +393,7 @@ public class TestClientAuthentication ex
         HttpHost target = getServerHttp();
         HttpGet httpget = new HttpGet("http://test:test@" +  target.toHostString() + "/");
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpResponse response = this.httpclient.execute(getServerHttp(), httpget);
         HttpEntity entity = response.getEntity();
@@ -409,7 +409,7 @@ public class TestClientAuthentication ex
         HttpHost target = getServerHttp();
         HttpGet httpget = new HttpGet("http://test:all-wrong@" +  target.toHostString() + "/");
 
-        this.httpclient = new HttpClientBuilder().build();
+        this.httpclient = HttpClients.custom().build();
 
         HttpResponse response = this.httpclient.execute(getServerHttp(), httpget);
         HttpEntity entity = response.getEntity();
@@ -457,7 +457,7 @@ public class TestClientAuthentication ex
         credsProvider.setCredentials(AuthScope.ANY,
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .setCredentialsProvider(credsProvider)
             .build();
 
@@ -488,7 +488,7 @@ public class TestClientAuthentication ex
         credsProvider.setCredentials(AuthScope.ANY,
                 new UsernamePasswordCredentials("test", "stuff"));
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .setCredentialsProvider(credsProvider)
             .build();
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientAuthenticationFallBack.java Sun Nov  4 07:40:00 2012
@@ -41,7 +41,7 @@ import org.apache.http.auth.UsernamePass
 import org.apache.http.client.CredentialsProvider;
 import org.apache.http.client.methods.HttpGet;
 import org.apache.http.entity.StringEntity;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.localserver.LocalTestServer;
 import org.apache.http.localserver.RequestBasicAuth;
 import org.apache.http.protocol.BasicHttpProcessor;
@@ -137,7 +137,7 @@ public class TestClientAuthenticationFal
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder().setCredentialsProvider(credsProvider).build();
+        this.httpclient = HttpClients.custom().setCredentialsProvider(credsProvider).build();
 
         HttpGet httpget = new HttpGet("/");
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java?rev=1405509&r1=1405508&r2=1405509&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java (original)
+++ httpcomponents/httpclient/trunk/httpclient/src/test/java/org/apache/http/impl/client/integration/TestClientReauthentication.java Sun Nov  4 07:40:00 2012
@@ -47,7 +47,7 @@ import org.apache.http.client.methods.Ht
 import org.apache.http.entity.StringEntity;
 import org.apache.http.impl.auth.BasicScheme;
 import org.apache.http.impl.auth.BasicSchemeFactory;
-import org.apache.http.impl.client.HttpClientBuilder;
+import org.apache.http.impl.client.HttpClients;
 import org.apache.http.impl.client.TargetAuthenticationStrategy;
 import org.apache.http.localserver.LocalTestServer;
 import org.apache.http.localserver.RequestBasicAuth;
@@ -177,7 +177,7 @@ public class TestClientReauthentication 
         TestCredentialsProvider credsProvider = new TestCredentialsProvider(
                 new UsernamePasswordCredentials("test", "test"));
 
-        this.httpclient = new HttpClientBuilder()
+        this.httpclient = HttpClients.custom()
             .registerAuthScheme("MyBasic", myBasicAuthSchemeFactory)
             .setTargetAuthenticationStrategy(myAuthStrategy)
             .setCredentialsProvider(credsProvider)



Mime
View raw message