jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/3] jena git commit: Expose the setup of the pooling HttpClientBuilder.
Date Fri, 28 Jul 2017 13:48:49 GMT
Repository: jena
Updated Branches:
  refs/heads/master 68ee61098 -> d3fe87be0


Expose the setup of the pooling HttpClientBuilder.

For use by RDFParserBuilder.


Project: http://git-wip-us.apache.org/repos/asf/jena/repo
Commit: http://git-wip-us.apache.org/repos/asf/jena/commit/a89605c1
Tree: http://git-wip-us.apache.org/repos/asf/jena/tree/a89605c1
Diff: http://git-wip-us.apache.org/repos/asf/jena/diff/a89605c1

Branch: refs/heads/master
Commit: a89605c150560b42e7d7a46f7d2660678b347ba3
Parents: 68ee610
Author: Andy Seaborne <andy@apache.org>
Authored: Thu Jul 27 10:10:18 2017 +0100
Committer: Andy Seaborne <andy@apache.org>
Committed: Thu Jul 27 10:10:18 2017 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/jena/riot/web/HttpOp.java | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/jena/blob/a89605c1/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java
----------------------------------------------------------------------
diff --git a/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java b/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java
index 72357a6..e65a350 100644
--- a/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java
+++ b/jena-arq/src/main/java/org/apache/jena/riot/web/HttpOp.java
@@ -210,19 +210,26 @@ public class HttpOp {
      * with {@link #setDefaultHttpClient} or provided in the HttpOp calls.
      */
     public static CloseableHttpClient createPoolingHttpClient() {
+        return createPoolingHttpClientBuilder().build() ;
+    }
+    
+    /**
+     * Create an HttpClientBuilder that performs connection pooling.
+     */
+    public static HttpClientBuilder createPoolingHttpClientBuilder() {
         String s = System.getProperty("http.maxConnections", "5");
         int max = Integer.parseInt(s);
         return HttpClientBuilder.create()
             .useSystemProperties()
             .setRedirectStrategy(laxRedirectStrategy)
             .setMaxConnPerRoute(max)
-            .setMaxConnTotal(2*max)
-            .build() ;
+            .setMaxConnTotal(2*max);
     }
-    
+
     /**
-     * Create an HttpClient that performs client-side caching and conection pooling. This
can be used
-     * with {@link #setDefaultHttpClient} or provided in the HttpOp calls.
+     * Create an HttpClient that performs client-side caching and connection pooling. 
+     * This can be used with {@link #setDefaultHttpClient} or provided in the HttpOp calls.
+     * Beware that content is cached in this process, including across remote server restart.

      */
     public static CloseableHttpClient createCachingHttpClient() {
         String s = System.getProperty("http.maxConnections", "5");


Mime
View raw message