maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1161070 - /maven/wagon/trunk/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
Date Wed, 24 Aug 2011 12:29:59 GMT
Author: olamy
Date: Wed Aug 24 12:29:59 2011
New Revision: 1161070

URL: http://svn.apache.org/viewvc?rev=1161070&view=rev
Log:
[WAGON-348] reuse http connection for ASF httpclient provider
add programmatic access to the feature : no only tru sys props

Modified:
    maven/wagon/trunk/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java

Modified: maven/wagon/trunk/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
URL: http://svn.apache.org/viewvc/maven/wagon/trunk/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java?rev=1161070&r1=1161069&r2=1161070&view=diff
==============================================================================
--- maven/wagon/trunk/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
(original)
+++ maven/wagon/trunk/wagon-providers/wagon-http-shared4/src/main/java/org/apache/maven/wagon/shared/http/AbstractHttpClientWagon.java
Wed Aug 24 12:29:59 2011
@@ -217,11 +217,11 @@ public abstract class AbstractHttpClient
     protected ClientConnectionManager clientConnectionManager = new SingleClientConnManager();
 
     // olamy make pool option disable by default remove ! to enable this by default
-    protected static boolean clientManagerSingle = !Boolean.getBoolean( "maven.wagon.httpconnectionManager.pool"
);
+    protected static boolean useClientManagerSingle = !Boolean.getBoolean( "maven.wagon.httpconnectionManager.pool"
);
 
     static
     {
-        if ( clientManagerSingle )
+        if ( useClientManagerSingle )
         {
             System.out.println( "http connection pool disabled in wagon http" );
         }
@@ -246,13 +246,23 @@ public abstract class AbstractHttpClient
 
     protected ClientConnectionManager getConnectionManager()
     {
-        if (clientManagerSingle )
+        if ( useClientManagerSingle )
         {
            return clientConnectionManager;
         }
         return connectionManagerPooled;
     }
 
+    public static void setConnectionManagerPooled( ClientConnectionManager clientConnectionManager
)
+    {
+        connectionManagerPooled = clientConnectionManager;
+    }
+
+    public static void setUseNonPooledConnectionManager( boolean useNonPooledConnectionManager
)
+    {
+        useClientManagerSingle = useNonPooledConnectionManager;
+    }
+
     /**
      * @since 1.0-beta-6
      */
@@ -326,7 +336,7 @@ public abstract class AbstractHttpClient
 
     public void closeConnection()
     {
-        if ( clientManagerSingle )
+        if ( useClientManagerSingle )
         {
             getConnectionManager().shutdown();
         }



Mime
View raw message