More non-threadsafe classes

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@755807 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-19 01:30:00 +00:00
parent 8402cb6476
commit adb782ce7e
18 changed files with 53 additions and 2 deletions

View File

@ -32,6 +32,9 @@ package org.apache.http.client.entity;
import java.io.UnsupportedEncodingException;
import java.util.List;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.entity.StringEntity;
@ -43,6 +46,7 @@ import org.apache.http.protocol.HTTP;
*
* @since 4.0
*/
@NotThreadSafe // AbstractHttpEntity is not thread-safe
public class UrlEncodedFormEntity extends StringEntity {
/**

View File

@ -33,6 +33,8 @@ package org.apache.http.client.methods;
import java.net.URI;
import net.jcip.annotations.NotThreadSafe;
/**
* HTTP GET method.
* <p>
@ -51,6 +53,7 @@ import java.net.URI;
*
* @since 4.0
*/
@NotThreadSafe
public class HttpGet extends HttpRequestBase {
public final static String METHOD_NAME = "GET";

View File

@ -33,6 +33,8 @@ package org.apache.http.client.methods;
import java.net.URI;
import net.jcip.annotations.NotThreadSafe;
/**
* HTTP HEAD method.
* <p>
@ -54,6 +56,7 @@ import java.net.URI;
*
* @since 4.0
*/
@NotThreadSafe
public class HttpHead extends HttpRequestBase {
public final static String METHOD_NAME = "HEAD";

View File

@ -35,6 +35,8 @@ import java.net.URI;
import java.util.HashSet;
import java.util.Set;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.Header;
import org.apache.http.HeaderElement;
import org.apache.http.HeaderIterator;
@ -59,6 +61,7 @@ import org.apache.http.HttpResponse;
*
* @since 4.0
*/
@NotThreadSafe
public class HttpOptions extends HttpRequestBase {
public final static String METHOD_NAME = "OPTIONS";

View File

@ -33,6 +33,8 @@ package org.apache.http.client.methods;
import java.net.URI;
import net.jcip.annotations.NotThreadSafe;
/**
* HTTP POST method.
* <p>
@ -58,6 +60,7 @@ import java.net.URI;
*
* @since 4.0
*/
@NotThreadSafe
public class HttpPost extends HttpEntityEnclosingRequestBase {
public final static String METHOD_NAME = "POST";

View File

@ -33,6 +33,8 @@ package org.apache.http.client.methods;
import java.net.URI;
import net.jcip.annotations.NotThreadSafe;
/**
* HTTP PUT method.
* <p>
@ -50,6 +52,7 @@ import java.net.URI;
*
* @since 4.0
*/
@NotThreadSafe
public class HttpPut extends HttpEntityEnclosingRequestBase {
public final static String METHOD_NAME = "PUT";

View File

@ -36,6 +36,8 @@ import java.net.URI;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.ProtocolVersion;
import org.apache.http.RequestLine;
import org.apache.http.client.utils.CloneUtils;
@ -55,6 +57,7 @@ import org.apache.http.params.HttpProtocolParams;
*
* @since 4.0
*/
@NotThreadSafe
public abstract class HttpRequestBase extends AbstractHttpMessage
implements HttpUriRequest, AbortableHttpRequest, Cloneable {

View File

@ -33,6 +33,8 @@ package org.apache.http.client.methods;
import java.net.URI;
import net.jcip.annotations.NotThreadSafe;
/**
* HTTP TRACE method.
* <p>
@ -53,6 +55,7 @@ import java.net.URI;
*
* @since 4.0
*/
@NotThreadSafe
public class HttpTrace extends HttpRequestBase {
public final static String METHOD_NAME = "TRACE";

View File

@ -33,6 +33,8 @@ package org.apache.http.client.params;
import java.util.Collection;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.Header;
import org.apache.http.HttpHost;
import org.apache.http.conn.ClientConnectionManagerFactory;
@ -43,6 +45,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@NotThreadSafe
public class ClientParamBean extends HttpAbstractParamBean {
public ClientParamBean (final HttpParams params) {

View File

@ -33,6 +33,8 @@ package org.apache.http.client.protocol;
import java.util.List;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.auth.AuthSchemeRegistry;
import org.apache.http.client.CookieStore;
import org.apache.http.client.CredentialsProvider;
@ -43,6 +45,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@NotThreadSafe
public class ClientContextConfigurer implements ClientContext {
private final HttpContext context;

View File

@ -33,6 +33,7 @@ package org.apache.http.conn;
import java.io.InputStream;
import java.io.IOException;
import net.jcip.annotations.NotThreadSafe;
/**
* Basic implementation of {@link EofSensorWatcher EofSensorWatcher}.
@ -45,6 +46,7 @@ import java.io.IOException;
*
* @since 4.0
*/
@NotThreadSafe
public class BasicEofSensorWatcher implements EofSensorWatcher {

View File

@ -34,6 +34,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.HttpEntity;
import org.apache.http.entity.HttpEntityWrapper;
@ -51,6 +53,7 @@ import org.apache.http.entity.HttpEntityWrapper;
*
* @since 4.0
*/
@NotThreadSafe
public class BasicManagedEntity extends HttpEntityWrapper
implements ConnectionReleaseTrigger, EofSensorWatcher {

View File

@ -33,6 +33,7 @@ package org.apache.http.conn;
import java.io.InputStream;
import java.io.IOException;
import net.jcip.annotations.NotThreadSafe;
/**
* A stream wrapper that triggers actions on {@link #close close()} and EOF.
@ -58,6 +59,7 @@ import java.io.IOException;
*/
// don't use FilterInputStream as the base class, we'd have to
// override markSupported(), mark(), and reset() to disable them
@NotThreadSafe
public class EofSensorInputStream extends InputStream
implements ConnectionReleaseTrigger {

View File

@ -31,6 +31,8 @@
package org.apache.http.conn.ssl;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.conn.scheme.HostNameResolver;
import org.apache.http.conn.scheme.LayeredSocketFactory;
@ -137,7 +139,7 @@ import java.security.UnrecoverableKeyException;
*
* @since 4.0
*/
@NotThreadSafe
public class SSLSocketFactory implements LayeredSocketFactory {
public static final String TLS = "TLS";

View File

@ -33,6 +33,8 @@ package org.apache.http.cookie.params;
import java.util.Collection;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.params.HttpAbstractParamBean;
import org.apache.http.params.HttpParams;
@ -40,6 +42,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@NotThreadSafe
public class CookieSpecParamBean extends HttpAbstractParamBean {
public CookieSpecParamBean (final HttpParams params) {

View File

@ -30,6 +30,8 @@
package org.apache.http.impl.auth;
import net.jcip.annotations.NotThreadSafe;
import org.apache.commons.codec.binary.Base64;
import org.apache.http.Header;
import org.apache.http.HttpRequest;
@ -51,6 +53,7 @@ import org.apache.http.util.EncodingUtils;
* @since 4.0
*/
@NotThreadSafe
public class BasicScheme extends RFC2617Scheme {
/** Whether the basic authentication process is complete */

View File

@ -35,6 +35,8 @@ import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.Header;
import org.apache.http.HttpRequest;
import org.apache.http.auth.AuthenticationException;
@ -70,7 +72,7 @@ import org.apache.http.util.EncodingUtils;
*
* @since 4.0
*/
@NotThreadSafe
public class DigestScheme extends RFC2617Scheme {
/**

View File

@ -30,6 +30,8 @@
package org.apache.http.impl.auth;
import net.jcip.annotations.NotThreadSafe;
import org.apache.http.Header;
import org.apache.http.HttpRequest;
import org.apache.http.auth.AUTH;
@ -46,6 +48,7 @@ import org.apache.http.util.CharArrayBuffer;
*
* @since 4.0
*/
@NotThreadSafe
public class NTLMScheme extends AuthSchemeBase {
enum State {