hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r756296 - in /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl: client/ conn/
Date Fri, 20 Mar 2009 01:52:14 GMT
Author: sebb
Date: Fri Mar 20 01:52:13 2009
New Revision: 756296

URL: http://svn.apache.org/viewvc?rev=756296&view=rev
Log:
More ThreadSafe and Immutable classes

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java

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=756296&r1=756295&r2=756296&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
Fri Mar 20 01:52:13 2009
@@ -35,6 +35,8 @@
 import java.net.URI;
 import java.lang.reflect.UndeclaredThrowableException;
 
+import net.jcip.annotations.ThreadSafe;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.http.ConnectionReuseStrategy;
@@ -77,6 +79,7 @@
  *
  * @since 4.0
  */
+@ThreadSafe
 public abstract class AbstractHttpClient implements HttpClient {
 
     private final Log log = LogFactory.getLog(getClass());

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=756296&r1=756295&r2=756296&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
Fri Mar 20 01:52:13 2009
@@ -31,6 +31,8 @@
 
 package org.apache.http.impl.client;
 
+import net.jcip.annotations.ThreadSafe;
+
 import org.apache.http.ConnectionReuseStrategy;
 import org.apache.http.HttpVersion;
 import org.apache.http.auth.AuthSchemeRegistry;
@@ -96,6 +98,7 @@
  *
  * @since 4.0
  */
+@ThreadSafe
 public class DefaultHttpClient extends AbstractHttpClient {
 
 

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java?rev=756296&r1=756295&r2=756296&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultHttpRoutePlanner.java
Fri Mar 20 01:52:13 2009
@@ -34,6 +34,8 @@
 
 import java.net.InetAddress;
 
+import net.jcip.annotations.ThreadSafe;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -56,10 +58,11 @@
  *
  * @since 4.0
  */
+@ThreadSafe
 public class DefaultHttpRoutePlanner implements HttpRoutePlanner {
 
     /** The scheme registry. */
-    protected SchemeRegistry schemeRegistry;
+    protected final SchemeRegistry schemeRegistry; // class is @ThreadSafe
 
 
     /**

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java?rev=756296&r1=756295&r2=756296&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/DefaultResponseParser.java
Fri Mar 20 01:52:13 2009
@@ -33,6 +33,8 @@
 
 import java.io.IOException;
 
+import net.jcip.annotations.ThreadSafe;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpMessage;
 import org.apache.http.HttpResponseFactory;
@@ -51,6 +53,7 @@
  *
  * @since 4.0
  */
+@ThreadSafe // no public methods
 public class DefaultResponseParser extends AbstractMessageParser {
     
     private final HttpResponseFactory responseFactory;

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java?rev=756296&r1=756295&r2=756296&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionInputBuffer.java
Fri Mar 20 01:52:13 2009
@@ -32,6 +32,8 @@
 
 import java.io.IOException;
 
+import net.jcip.annotations.Immutable;
+
 import org.apache.http.io.HttpTransportMetrics;
 import org.apache.http.io.SessionInputBuffer;
 import org.apache.http.util.CharArrayBuffer;
@@ -42,6 +44,7 @@
  * 
  * @since 4.0
  */
+@Immutable
 public class LoggingSessionInputBuffer implements SessionInputBuffer {
      
     /** Original session input buffer. */

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java?rev=756296&r1=756295&r2=756296&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/LoggingSessionOutputBuffer.java
Fri Mar 20 01:52:13 2009
@@ -32,6 +32,8 @@
 
 import java.io.IOException;
 
+import net.jcip.annotations.Immutable;
+
 import org.apache.http.io.HttpTransportMetrics;
 import org.apache.http.io.SessionOutputBuffer;
 import org.apache.http.util.CharArrayBuffer;
@@ -42,6 +44,7 @@
  * 
  * @since 4.0
  */
+@Immutable
 public class LoggingSessionOutputBuffer implements SessionOutputBuffer {
 
     /** Original data transmitter. */

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java?rev=756296&r1=756295&r2=756296&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/conn/ProxySelectorRoutePlanner.java
Fri Mar 20 01:52:13 2009
@@ -40,6 +40,9 @@
 import java.net.URISyntaxException;
 import java.util.List;
 
+import net.jcip.annotations.NotThreadSafe;
+import net.jcip.annotations.ThreadSafe;
+
 import org.apache.http.HttpException;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpRequest;
@@ -65,10 +68,11 @@
  *
  * @since 4.0
  */
+@NotThreadSafe // e.g [gs]etProxySelector()
 public class ProxySelectorRoutePlanner implements HttpRoutePlanner {
     
     /** The scheme registry. */
-    protected SchemeRegistry schemeRegistry;
+    protected final SchemeRegistry schemeRegistry; // @ThreadSafe
 
     /** The proxy selector to use, or <code>null</code> for system default. */
     protected ProxySelector proxySelector;



Mime
View raw message