Document classes which are not thread-safe currently

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@755789 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-18 23:47:46 +00:00
parent cdc4fc628b
commit f3fdcc1a06
11 changed files with 36 additions and 3 deletions

View File

@ -31,6 +31,8 @@
package org.apache.http.conn.params; package org.apache.http.conn.params;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.params.HttpAbstractParamBean; import org.apache.http.params.HttpAbstractParamBean;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe
public class ConnConnectionParamBean extends HttpAbstractParamBean { public class ConnConnectionParamBean extends HttpAbstractParamBean {
public ConnConnectionParamBean (final HttpParams params) { public ConnConnectionParamBean (final HttpParams params) {

View File

@ -31,6 +31,8 @@
package org.apache.http.conn.params; package org.apache.http.conn.params;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.params.HttpAbstractParamBean; import org.apache.http.params.HttpAbstractParamBean;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe
public class ConnManagerParamBean extends HttpAbstractParamBean { public class ConnManagerParamBean extends HttpAbstractParamBean {
public ConnManagerParamBean (final HttpParams params) { public ConnManagerParamBean (final HttpParams params) {

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.params;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.routing.HttpRoute;
/** /**
@ -46,6 +48,7 @@ import org.apache.http.conn.routing.HttpRoute;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe // maxPerHostMap and defaultMax
public final class ConnPerRouteBean implements ConnPerRoute { public final class ConnPerRouteBean implements ConnPerRoute {
/** The default maximum number of connections allowed per host */ /** The default maximum number of connections allowed per host */

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.params;
import java.net.InetAddress; import java.net.InetAddress;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.routing.HttpRoute;
import org.apache.http.params.HttpAbstractParamBean; import org.apache.http.params.HttpAbstractParamBean;
@ -45,6 +47,7 @@ import org.apache.http.params.HttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe
public class ConnRouteParamBean extends HttpAbstractParamBean { public class ConnRouteParamBean extends HttpAbstractParamBean {
public ConnRouteParamBean (final HttpParams params) { public ConnRouteParamBean (final HttpParams params) {

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.routing;
import java.net.InetAddress; import java.net.InetAddress;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
@ -46,6 +48,7 @@ import org.apache.http.HttpHost;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe
public final class RouteTracker implements RouteInfo, Cloneable { public final class RouteTracker implements RouteInfo, Cloneable {
/** The target host to connect to. */ /** The target host to connect to. */

View File

@ -32,6 +32,8 @@
package org.apache.http.impl.client; package org.apache.http.impl.client;
import net.jcip.annotations.NotThreadSafe;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.params.HttpParams; import org.apache.http.params.HttpParams;
@ -76,6 +78,7 @@ import org.apache.http.params.AbstractHttpParams;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe
public class ClientParamsStack extends AbstractHttpParams { public class ClientParamsStack extends AbstractHttpParams {
private final Log log = LogFactory.getLog(getClass()); private final Log log = LogFactory.getLog(getClass());

View File

@ -39,6 +39,8 @@ import java.util.Locale;
import java.util.Map; import java.util.Map;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import net.jcip.annotations.NotThreadSafe;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.http.ConnectionReuseStrategy; import org.apache.http.ConnectionReuseStrategy;
@ -103,6 +105,7 @@ import org.apache.http.protocol.HttpRequestExecutor;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe // e.g. managedConn
public class DefaultRequestDirector implements RequestDirector { public class DefaultRequestDirector implements RequestDirector {
private final Log log = LogFactory.getLog(getClass()); private final Log log = LogFactory.getLog(getClass());
@ -763,7 +766,7 @@ public class DefaultRequestDirector implements RequestDirector {
} }
} }
int status = response.getStatusLine().getStatusCode(); int status = response.getStatusLine().getStatusCode(); // can't be null
if (status > 299) { if (status > 299) {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.client; package org.apache.http.impl.client;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.Header; import org.apache.http.Header;
import org.apache.http.HttpEntity; import org.apache.http.HttpEntity;
import org.apache.http.HttpEntityEnclosingRequest; import org.apache.http.HttpEntityEnclosingRequest;
@ -50,6 +52,7 @@ import org.apache.http.protocol.HTTP;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe // e.g. [gs]etEntity()
public class EntityEnclosingRequestWrapper extends RequestWrapper public class EntityEnclosingRequestWrapper extends RequestWrapper
implements HttpEntityEnclosingRequest { implements HttpEntityEnclosingRequest {

View File

@ -35,11 +35,14 @@ import java.net.URI;
import java.util.HashSet; import java.util.HashSet;
import java.util.Set; import java.util.Set;
import net.jcip.annotations.NotThreadSafe;
/** /**
* A collection of URIs that were used as redirects. * A collection of URIs that were used as redirects.
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe // HashSet is not synch.
public class RedirectLocations { public class RedirectLocations {
private final Set<URI> uris; private final Set<URI> uris;

View File

@ -34,6 +34,8 @@ package org.apache.http.impl.client;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.HttpRequest; import org.apache.http.HttpRequest;
import org.apache.http.ProtocolException; import org.apache.http.ProtocolException;
import org.apache.http.ProtocolVersion; import org.apache.http.ProtocolVersion;
@ -56,6 +58,7 @@ import org.apache.http.params.HttpProtocolParams;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe
public class RequestWrapper extends AbstractHttpMessage implements HttpUriRequest { public class RequestWrapper extends AbstractHttpMessage implements HttpUriRequest {
private final HttpRequest original; private final HttpRequest original;

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.client; package org.apache.http.impl.client;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.routing.HttpRoute;
@ -44,10 +46,11 @@ import org.apache.http.conn.routing.HttpRoute;
* *
* @since 4.0 * @since 4.0
*/ */
@NotThreadSafe // RequestWrapper is @NotThreadSafe
public class RoutedRequest { public class RoutedRequest {
protected final RequestWrapper request; protected final RequestWrapper request; // @NotThreadSafe
protected final HttpRoute route; protected final HttpRoute route; // @Immutable
/** /**
* Creates a new routed request. * Creates a new routed request.