You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2008/04/15 19:57:57 UTC

svn commit: r648356 - in /httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http: auth/AuthSchemeRegistry.java conn/scheme/SchemeRegistry.java cookie/CookieSpecRegistry.java

Author: olegk
Date: Tue Apr 15 10:57:53 2008
New Revision: 648356

URL: http://svn.apache.org/viewvc?rev=648356&view=rev
Log:
HTTPCLIENT-748: Made AuthSchemeRegistry, SchemeRegistry, CookieSpecRegistry friendlier for DI frameworks 

Modified:
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/AuthSchemeRegistry.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java
    httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieSpecRegistry.java

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/AuthSchemeRegistry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/AuthSchemeRegistry.java?rev=648356&r1=648355&r2=648356&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/AuthSchemeRegistry.java (original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/auth/AuthSchemeRegistry.java Tue Apr 15 10:57:53 2008
@@ -130,5 +130,19 @@
     public synchronized List<String> getSchemeNames() {
         return new ArrayList<String>(registeredSchemes.keySet()); 
     } 
+ 
+    /**
+     * Populates the internal collection of registered {@link AuthScheme authentication schemes} 
+     * with the content of the map passed as a parameter.
+     * 
+     * @param map authentication schemes
+     */
+    public synchronized void setItems(final Map<String, AuthSchemeFactory> map) {
+        if (map == null) {
+            return;
+        }
+        registeredSchemes.clear();
+        registeredSchemes.putAll(map);
+    }
     
 }

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java?rev=648356&r1=648355&r2=648356&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java (original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/conn/scheme/SchemeRegistry.java Tue Apr 15 10:57:53 2008
@@ -37,7 +37,6 @@
 
 import org.apache.http.HttpHost;
 
-
 /**
  * A set of supported protocol {@link Scheme schemes}.
  * Schemes are identified by lowercase names.
@@ -170,6 +169,19 @@
         return new ArrayList<String>(registeredSchemes.keySet());
     }
 
+    /**
+     * Populates the internal collection of registered {@link Scheme protocol schemes} 
+     * with the content of the map passed as a parameter.
+     * 
+     * @param map protocol schemes
+     */
+    public synchronized void setItems(final Map<String, Scheme> map) {
+        if (map == null) {
+            return;
+        }
+        registeredSchemes.clear();
+        registeredSchemes.putAll(map);
+    }
 
 } // class SchemeRegistry
 

Modified: httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieSpecRegistry.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieSpecRegistry.java?rev=648356&r1=648355&r2=648356&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieSpecRegistry.java (original)
+++ httpcomponents/httpclient/trunk/module-client/src/main/java/org/apache/http/cookie/CookieSpecRegistry.java Tue Apr 15 10:57:53 2008
@@ -142,4 +142,18 @@
         return new ArrayList<String>(registeredSpecs.keySet()); 
     }
     
+    /**
+     * Populates the internal collection of registered {@link CookieSpec cookie 
+     * specs} with the content of the map passed as a parameter.
+     * 
+     * @param map cookie specs
+     */
+    public synchronized void setItems(final Map<String, CookieSpecFactory> map) {
+        if (map == null) {
+            return;
+        }
+        registeredSpecs.clear();
+        registeredSpecs.putAll(map);
+    }
+
 }