Add JCIP annotations

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@755466 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2009-03-18 03:37:07 +00:00
parent 12545d7a13
commit fe0e5e9654
72 changed files with 234 additions and 4 deletions

View File

@ -30,12 +30,15 @@
package org.apache.http.client;
import net.jcip.annotations.Immutable;
/**
* Signals a circular redirect
*
*
* @since 4.0
*/
@Immutable
public class CircularRedirectException extends RedirectException {
private static final long serialVersionUID = 6830063487001091803L;

View File

@ -32,11 +32,14 @@ package org.apache.http.client;
import java.io.IOException;
import net.jcip.annotations.Immutable;
/**
* Signals an error in the HTTP protocol.
*
* @since 4.0
*/
@Immutable
public class ClientProtocolException extends IOException {
private static final long serialVersionUID = -5596590843227115865L;

View File

@ -30,11 +30,14 @@
package org.apache.http.client;
import net.jcip.annotations.Immutable;
/**
* Signals a non 2xx HTTP response.
*
* @since 4.0
*/
@Immutable
public class HttpResponseException extends ClientProtocolException {
private static final long serialVersionUID = -7186627969477257933L;

View File

@ -30,6 +30,8 @@
package org.apache.http.client;
import net.jcip.annotations.Immutable;
import org.apache.http.ProtocolException;
/**
@ -39,6 +41,7 @@ import org.apache.http.ProtocolException;
*
* @since 4.0
*/
@Immutable
public class NonRepeatableRequestException extends ProtocolException {
private static final long serialVersionUID = 82685265288806048L;

View File

@ -30,6 +30,8 @@
package org.apache.http.client;
import net.jcip.annotations.Immutable;
import org.apache.http.ProtocolException;
/**
@ -38,6 +40,7 @@ import org.apache.http.ProtocolException;
*
* @since 4.0
*/
@Immutable
public class RedirectException extends ProtocolException {
private static final long serialVersionUID = 4418824536372559326L;

View File

@ -31,10 +31,13 @@
package org.apache.http.client.params;
import net.jcip.annotations.Immutable;
/**
*
* @since 4.0
*/
@Immutable
public final class AuthPolicy {
private AuthPolicy() {

View File

@ -31,10 +31,13 @@
package org.apache.http.client.params;
import net.jcip.annotations.Immutable;
/**
*
* @since 4.0
*/
@Immutable
public final class CookiePolicy {
/**

View File

@ -30,6 +30,8 @@
package org.apache.http.client.params;
import net.jcip.annotations.Immutable;
import org.apache.http.params.HttpParams;
/**
@ -40,6 +42,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class HttpClientParams {
private HttpClientParams() {

View File

@ -37,6 +37,8 @@ import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.Header;
@ -67,6 +69,7 @@ import org.apache.http.protocol.ExecutionContext;
*
* @since 4.0
*/
@Immutable
public class RequestAddCookies implements HttpRequestInterceptor {
private final Log log = LogFactory.getLog(getClass());

View File

@ -34,6 +34,8 @@ package org.apache.http.client.protocol;
import java.io.IOException;
import java.util.Collection;
import net.jcip.annotations.Immutable;
import org.apache.http.Header;
import org.apache.http.HttpException;
import org.apache.http.HttpRequest;
@ -49,6 +51,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class RequestDefaultHeaders implements HttpRequestInterceptor {
public RequestDefaultHeaders() {

View File

@ -33,6 +33,8 @@ package org.apache.http.client.protocol;
import java.io.IOException;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpException;
@ -51,6 +53,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class RequestProxyAuthentication implements HttpRequestInterceptor {
private final Log log = LogFactory.getLog(getClass());

View File

@ -33,6 +33,8 @@ package org.apache.http.client.protocol;
import java.io.IOException;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpException;
@ -51,6 +53,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class RequestTargetAuthentication implements HttpRequestInterceptor {
private final Log log = LogFactory.getLog(getClass());

View File

@ -34,6 +34,8 @@ package org.apache.http.client.protocol;
import java.io.IOException;
import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.Header;
@ -58,6 +60,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class ResponseProcessCookies implements HttpResponseInterceptor {
private final Log log = LogFactory.getLog(getClass());

View File

@ -32,12 +32,14 @@ package org.apache.http.client.utils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import net.jcip.annotations.Immutable;
/**
* A collection of utilities to workaround limitations of Java clone framework.
*
* @since 4.0
*/
@Immutable
public class CloneUtils {
public static Object clone(final Object obj) throws CloneNotSupportedException {

View File

@ -33,13 +33,16 @@ package org.apache.http.client.utils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import net.jcip.annotations.Immutable;
/**
* Uses the java.net.IDN class through reflection.
*
* @since 4.0
*/
@Immutable
public class JdkIdn implements Idn {
private Method toUnicode;
private final Method toUnicode;
/**
*

View File

@ -32,11 +32,14 @@ package org.apache.http.client.utils;
import java.util.StringTokenizer;
import net.jcip.annotations.Immutable;
/**
* Implementation from pseudo code in RFC 3492.
*
* @since 4.0
*/
@Immutable
public class Rfc3492Idn implements Idn {
private static final int base = 36;
private static final int tmin = 1;

View File

@ -33,6 +33,8 @@ package org.apache.http.client.utils;
import java.net.URI;
import java.net.URISyntaxException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpHost;
/**
@ -41,6 +43,7 @@ import org.apache.http.HttpHost;
*
* @since 4.0
*/
@Immutable
public class URIUtils {
/**

View File

@ -39,6 +39,9 @@ import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
import net.jcip.annotations.Immutable;
import org.apache.http.Header;
import org.apache.http.HttpEntity;
import org.apache.http.NameValuePair;
@ -51,6 +54,7 @@ import org.apache.http.util.EntityUtils;
*
* @since 4.0
*/
@Immutable
public class URLEncodedUtils {
public static final String CONTENT_TYPE = "application/x-www-form-urlencoded";

View File

@ -33,6 +33,8 @@ package org.apache.http.conn;
import java.io.InterruptedIOException;
import net.jcip.annotations.Immutable;
/**
* A timeout while connecting to an HTTP server or waiting for an
* available connection from an HttpConnectionManager.
@ -40,6 +42,7 @@ import java.io.InterruptedIOException;
*
* @since 4.0
*/
@Immutable
public class ConnectTimeoutException extends InterruptedIOException {
private static final long serialVersionUID = -4816682903149535989L;

View File

@ -31,6 +31,8 @@
package org.apache.http.conn;
import net.jcip.annotations.Immutable;
/**
* A timeout while waiting for an available connection
* from a connection manager.
@ -38,6 +40,7 @@ package org.apache.http.conn;
*
* @since 4.0
*/
@Immutable
public class ConnectionPoolTimeoutException extends ConnectTimeoutException {
private static final long serialVersionUID = -7898874842020245128L;

View File

@ -32,6 +32,8 @@ package org.apache.http.conn;
import java.net.ConnectException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpHost;
/**
@ -40,6 +42,7 @@ import org.apache.http.HttpHost;
*
* @since 4.0
*/
@Immutable
public class HttpHostConnectException extends ConnectException {
private static final long serialVersionUID = -3194482710275220224L;

View File

@ -41,6 +41,8 @@ import java.util.Collections;
import java.util.List;
import java.util.Arrays;
import net.jcip.annotations.Immutable;
import org.apache.http.conn.scheme.SocketFactory;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
@ -54,6 +56,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public final class MultihomePlainSocketFactory implements SocketFactory {
/**

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.routing;
import java.net.InetAddress;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpHost;
/**
@ -47,6 +49,7 @@ import org.apache.http.HttpHost;
*
* @since 4.0
*/
@Immutable
public final class HttpRoute implements RouteInfo, Cloneable {
private static final HttpHost[] EMPTY_HTTP_HOST_ARRAY = new HttpHost[]{};

View File

@ -37,6 +37,8 @@ import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketTimeoutException;
import net.jcip.annotations.Immutable;
import org.apache.http.conn.ConnectTimeoutException;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
@ -47,6 +49,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public final class PlainSocketFactory implements SocketFactory {
/**

View File

@ -32,6 +32,8 @@ package org.apache.http.conn.scheme;
import java.util.Locale;
import net.jcip.annotations.Immutable;
import org.apache.http.util.LangUtils;
/**
@ -52,6 +54,7 @@ import org.apache.http.util.LangUtils;
*
* @since 4.0
*/
@Immutable
public final class Scheme {
/** The name of this scheme, in lowercase. (e.g. http, https) */
@ -69,6 +72,11 @@ public final class Scheme {
/** A string representation, for {@link #toString toString}. */
private String stringRep;
/*
* This is used to cache the result of the toString() method
* Since the method always generates the same value, there's no
* need to synchronize.
*/
/**

View File

@ -35,6 +35,9 @@ import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.HttpHost;
/**
@ -48,9 +51,11 @@ import org.apache.http.HttpHost;
*
* @since 4.0
*/
@ThreadSafe
public final class SchemeRegistry {
/** The available schemes in this registry. */
@GuardedBy("this")
private final Map<String,Scheme> registeredSchemes;

View File

@ -31,6 +31,8 @@
package org.apache.http.conn.ssl;
import net.jcip.annotations.Immutable;
import org.apache.http.conn.util.InetAddressUtils;
import java.io.IOException;
@ -59,6 +61,7 @@ import javax.net.ssl.SSLSocket;
*
* @since 4.0
*/
@Immutable
public abstract class AbstractVerifier implements X509HostnameVerifier {
/**

View File

@ -31,6 +31,8 @@
package org.apache.http.conn.ssl;
import net.jcip.annotations.Immutable;
/**
* The ALLOW_ALL HostnameVerifier essentially turns hostname verification
* off. This implementation is a no-op, and never throws the SSLException.
@ -38,6 +40,7 @@ package org.apache.http.conn.ssl;
*
* @since 4.0
*/
@Immutable
public class AllowAllHostnameVerifier extends AbstractVerifier {
public final void verify(

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.ssl;
import javax.net.ssl.SSLException;
import net.jcip.annotations.Immutable;
/**
* The HostnameVerifier that works the same way as Curl and Firefox.
* <p/>
@ -46,6 +48,7 @@ import javax.net.ssl.SSLException;
*
* @since 4.0
*/
@Immutable
public class BrowserCompatHostnameVerifier extends AbstractVerifier {
public final void verify(

View File

@ -33,6 +33,8 @@ package org.apache.http.conn.ssl;
import javax.net.ssl.SSLException;
import net.jcip.annotations.Immutable;
/**
* The Strict HostnameVerifier works the same way as Sun Java 1.4, Sun
* Java 5, Sun Java 6-rc. It's also pretty close to IE6. This
@ -53,6 +55,7 @@ import javax.net.ssl.SSLException;
*
* @since 4.0
*/
@Immutable
public class StrictHostnameVerifier extends AbstractVerifier {
public final void verify(

View File

@ -33,11 +33,14 @@ package org.apache.http.conn.util;
import java.util.regex.Pattern;
import net.jcip.annotations.Immutable;
/**
* A collection of utilities relating to InetAddresses.
*
* @since 4.0
*/
@Immutable
public class InetAddressUtils {
private InetAddressUtils() {

View File

@ -34,6 +34,8 @@ package org.apache.http.cookie;
import java.io.Serializable;
import java.util.Comparator;
import net.jcip.annotations.Immutable;
/**
* This cookie comparator can be used to compare identity of cookies.
*
@ -45,6 +47,7 @@ import java.util.Comparator;
*
* @since 4.0
*/
@Immutable
public class CookieIdentityComparator implements Serializable, Comparator<Cookie> {
private static final long serialVersionUID = 4466565437490631532L;

View File

@ -32,6 +32,8 @@ package org.apache.http.cookie;
import java.util.Locale;
import net.jcip.annotations.Immutable;
/**
* CookieOrigin class incapsulates details of an origin server that
* are relevant when parsing, validating or matching HTTP cookies.
@ -39,6 +41,7 @@ import java.util.Locale;
*
* @since 4.0
*/
@Immutable
public final class CookieOrigin {
private final String host;

View File

@ -34,6 +34,8 @@ package org.apache.http.cookie;
import java.io.Serializable;
import java.util.Comparator;
import net.jcip.annotations.Immutable;
/**
* This cookie comparator ensures that multiple cookies satisfying
* a common criteria are ordered in the <tt>Cookie</tt> header such
@ -49,6 +51,7 @@ import java.util.Comparator;
*
* @since 4.0
*/
@Immutable
public class CookiePathComparator implements Serializable, Comparator<Cookie> {
private static final long serialVersionUID = 7523645369616405818L;

View File

@ -37,6 +37,9 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.params.HttpParams;
/**
@ -47,8 +50,10 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@ThreadSafe
public final class CookieSpecRegistry {
@GuardedBy("this")
private final Map<String,CookieSpecFactory> registeredSpecs;
public CookieSpecRegistry() {

View File

@ -31,6 +31,8 @@
package org.apache.http.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.ProtocolException;
/**
@ -40,6 +42,7 @@ import org.apache.http.ProtocolException;
*
* @since 4.0
*/
@Immutable
public class MalformedCookieException extends ProtocolException {
private static final long serialVersionUID = -6695462944287282185L;

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthSchemeFactory;
import org.apache.http.params.HttpParams;
@ -40,6 +42,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class BasicSchemeFactory implements AuthSchemeFactory {
public AuthScheme newInstance(final HttpParams params) {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthSchemeFactory;
import org.apache.http.params.HttpParams;
@ -40,6 +42,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class DigestSchemeFactory implements AuthSchemeFactory {
public AuthScheme newInstance(final HttpParams params) {

View File

@ -30,6 +30,8 @@
package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthenticationException;
/**
@ -38,6 +40,7 @@ import org.apache.http.auth.AuthenticationException;
*
* @since 4.0
*/
@Immutable
public class NTLMEngineException extends AuthenticationException {
private static final long serialVersionUID = 6027981323731768824L;

View File

@ -30,6 +30,8 @@
package org.apache.http.impl.auth;
import net.jcip.annotations.Immutable;
/**
* Authentication credentials required to respond to a authentication
* challenge are invalid
@ -37,6 +39,7 @@ package org.apache.http.impl.auth;
*
* @since 4.0
*/
@Immutable
public class UnsupportedDigestAlgorithmException extends RuntimeException {
private static final long serialVersionUID = 319558534317118022L;

View File

@ -37,6 +37,9 @@ import java.util.Date;
import java.util.Iterator;
import java.util.List;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.client.CookieStore;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieIdentityComparator;
@ -47,10 +50,13 @@ import org.apache.http.cookie.CookieIdentityComparator;
*
* @since 4.0
*/
@ThreadSafe
public class BasicCookieStore implements CookieStore {
@GuardedBy("this")
private final ArrayList<Cookie> cookies;
@GuardedBy("this")
private final Comparator<Cookie> cookieComparator;
// -------------------------------------------------------- Class Variables

View File

@ -32,6 +32,9 @@ package org.apache.http.impl.client;
import java.util.HashMap;
import net.jcip.annotations.GuardedBy;
import net.jcip.annotations.ThreadSafe;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials;
import org.apache.http.client.CredentialsProvider;
@ -42,8 +45,10 @@ import org.apache.http.client.CredentialsProvider;
*
* @since 4.0
*/
@ThreadSafe
public class BasicCredentialsProvider implements CredentialsProvider {
@GuardedBy("this")
private final HashMap<AuthScope, Credentials> credMap;
/**

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.client;
import java.io.IOException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.StatusLine;
@ -55,6 +57,7 @@ import org.apache.http.util.EntityUtils;
*
* @since 4.0
*/
@Immutable
public class BasicResponseHandler implements ResponseHandler<String> {
/**

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.client;
import net.jcip.annotations.Immutable;
import org.apache.http.HeaderElement;
import org.apache.http.HeaderElementIterator;
import org.apache.http.HttpResponse;
@ -50,6 +52,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class DefaultConnectionKeepAliveStrategy implements ConnectionKeepAliveStrategy {
public long getKeepAliveDuration(HttpResponse response, HttpContext context) {

View File

@ -38,6 +38,8 @@ import java.net.UnknownHostException;
import javax.net.ssl.SSLHandshakeException;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpEntityEnclosingRequest;
import org.apache.http.HttpRequest;
import org.apache.http.NoHttpResponseException;
@ -51,6 +53,7 @@ import org.apache.http.protocol.ExecutionContext;
*
* @since 4.0
*/
@Immutable
public class DefaultHttpRequestRetryHandler implements HttpRequestRetryHandler {
/** the number of times a method will be retried */

View File

@ -34,6 +34,8 @@ package org.apache.http.impl.client;
import java.net.URI;
import java.net.URISyntaxException;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.Header;
@ -61,6 +63,7 @@ import org.apache.http.protocol.ExecutionContext;
*
* @since 4.0
*/
@Immutable
public class DefaultRedirectHandler implements RedirectHandler {
private final Log log = LogFactory.getLog(getClass());

View File

@ -34,6 +34,8 @@ import java.security.Principal;
import javax.net.ssl.SSLSession;
import net.jcip.annotations.Immutable;
import org.apache.http.auth.AuthScheme;
import org.apache.http.auth.AuthState;
import org.apache.http.auth.Credentials;
@ -47,6 +49,7 @@ import org.apache.http.protocol.HttpContext;
*
* @since 4.0
*/
@Immutable
public class DefaultUserTokenHandler implements UserTokenHandler {
public Object getUserToken(final HttpContext context) {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.client;
import net.jcip.annotations.Immutable;
import org.apache.http.HttpException;
import org.apache.http.HttpResponse;
@ -38,6 +40,7 @@ import org.apache.http.HttpResponse;
*
* @since 4.0
*/
@Immutable
public class TunnelRefusedException extends HttpException {
private static final long serialVersionUID = -8646722842745617323L;

View File

@ -33,6 +33,9 @@ package org.apache.http.impl.conn;
import java.io.IOException;
import java.io.InputStream;
import java.io.ByteArrayInputStream;
import net.jcip.annotations.Immutable;
import org.apache.commons.logging.Log;
/**
@ -41,6 +44,7 @@ import org.apache.commons.logging.Log;
*
* @since 4.0
*/
@Immutable
public class Wire {
private final Log log;

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin;
@ -39,6 +41,7 @@ import org.apache.http.cookie.MalformedCookieException;
*
* @since 4.0
*/
@Immutable
public abstract class AbstractCookieAttributeHandler implements CookieAttributeHandler {
public void validate(final Cookie cookie, final CookieOrigin origin)

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.SetCookie;
@ -37,6 +39,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class BasicCommentHandler extends AbstractCookieAttributeHandler {
public BasicCommentHandler() {

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin;
@ -40,6 +42,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class BasicDomainHandler implements CookieAttributeHandler {
public BasicDomainHandler() {

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.SetCookie;
@ -38,6 +40,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class BasicExpiresHandler extends AbstractCookieAttributeHandler {
/** Valid date patterns */

View File

@ -32,6 +32,8 @@ package org.apache.http.impl.cookie;
import java.util.Date;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.MalformedCookieException;
import org.apache.http.cookie.SetCookie;
@ -39,6 +41,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class BasicMaxAgeHandler extends AbstractCookieAttributeHandler {
public BasicMaxAgeHandler() {

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin;
@ -40,6 +42,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class BasicPathHandler implements CookieAttributeHandler {
public BasicPathHandler() {

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.MalformedCookieException;
@ -39,6 +41,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class BasicSecureHandler extends AbstractCookieAttributeHandler {
public BasicSecureHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class BestMatchSpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class BrowserCompatSpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) {

View File

@ -31,6 +31,7 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
/**
* An exception to indicate an error parsing a date string.
@ -40,6 +41,7 @@ package org.apache.http.impl.cookie;
*
* @since 4.0
*/
@Immutable
public class DateParseException extends Exception {
private static final long serialVersionUID = 4417696455000643370L;

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.cookie;
import java.util.Locale;
import java.util.StringTokenizer;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.MalformedCookieException;
@ -41,6 +43,7 @@ import org.apache.http.cookie.MalformedCookieException;
*
* @since 4.0
*/
@Immutable
public class NetscapeDomainHandler extends BasicDomainHandler {
public NetscapeDomainHandler() {

View File

@ -34,6 +34,8 @@ package org.apache.http.impl.cookie;
import java.util.ArrayList;
import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.http.HeaderElement;
import org.apache.http.NameValuePair;
import org.apache.http.ParseException;
@ -46,6 +48,7 @@ import org.apache.http.util.CharArrayBuffer;
*
* @since 4.0
*/
@Immutable
public class NetscapeDraftHeaderParser {
public final static NetscapeDraftHeaderParser DEFAULT = new NetscapeDraftHeaderParser();

View File

@ -34,6 +34,8 @@ package org.apache.http.impl.cookie;
import java.util.ArrayList;
import java.util.List;
import net.jcip.annotations.Immutable;
import org.apache.http.FormattedHeader;
import org.apache.http.Header;
import org.apache.http.HeaderElement;
@ -52,6 +54,7 @@ import org.apache.http.util.CharArrayBuffer;
*
* @since 4.0
*/
@Immutable
public class NetscapeDraftSpec extends CookieSpecBase {
protected static final String EXPIRES_PATTERN = "EEE, dd-MMM-yyyy HH:mm:ss z";

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class NetscapeDraftSpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) {

View File

@ -37,15 +37,18 @@ import java.io.Reader;
import java.util.ArrayList;
import java.util.Collection;
import net.jcip.annotations.Immutable;
/**
* Parses the list from <a href="http://publicsuffix.org/">publicsuffix.org</a>
* and configures a PublicSuffixFilter.
*
* @since 4.0
*/
@Immutable
public class PublicSuffixListParser {
private static final int MAX_LINE_LEN = 256;
private PublicSuffixFilter filter;
private final PublicSuffixFilter filter;
PublicSuffixListParser(PublicSuffixFilter filter) {
this.filter = filter;

View File

@ -32,6 +32,8 @@ package org.apache.http.impl.cookie;
import java.util.Locale;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin;
@ -42,6 +44,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class RFC2109DomainHandler implements CookieAttributeHandler {
public RFC2109DomainHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class RFC2109SpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) {

View File

@ -30,6 +30,8 @@
*/
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieOrigin;
import org.apache.http.cookie.MalformedCookieException;
@ -39,6 +41,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 4.0
*/
@Immutable
public class RFC2109VersionHandler extends AbstractCookieAttributeHandler {
public RFC2109VersionHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin;
@ -43,7 +45,8 @@ import org.apache.http.cookie.SetCookie2;
*
* @since 4.0
*/
public class RFC2965CommentUrlAttributeHandler implements CookieAttributeHandler {
@Immutable
public class RFC2965CommentUrlAttributeHandler implements CookieAttributeHandler {
public RFC2965CommentUrlAttributeHandler() {
super();

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
import org.apache.http.cookie.CookieOrigin;
@ -43,7 +45,8 @@ import org.apache.http.cookie.SetCookie2;
*
* @since 4.0
*/
public class RFC2965DiscardAttributeHandler implements CookieAttributeHandler {
@Immutable
public class RFC2965DiscardAttributeHandler implements CookieAttributeHandler {
public RFC2965DiscardAttributeHandler() {
super();

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.cookie;
import java.util.Locale;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.ClientCookie;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
@ -46,6 +48,7 @@ import org.apache.http.cookie.SetCookie;
*
* @since 3.1
*/
@Immutable
public class RFC2965DomainAttributeHandler implements CookieAttributeHandler {
public RFC2965DomainAttributeHandler() {

View File

@ -33,6 +33,8 @@ package org.apache.http.impl.cookie;
import java.util.StringTokenizer;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.ClientCookie;
import org.apache.http.cookie.Cookie;
import org.apache.http.cookie.CookieAttributeHandler;
@ -46,6 +48,7 @@ import org.apache.http.cookie.SetCookie2;
*
* @since 4.0
*/
@Immutable
public class RFC2965PortAttributeHandler implements CookieAttributeHandler {
public RFC2965PortAttributeHandler() {

View File

@ -31,6 +31,8 @@
package org.apache.http.impl.cookie;
import net.jcip.annotations.Immutable;
import org.apache.http.cookie.CookieSpec;
import org.apache.http.cookie.CookieSpecFactory;
import org.apache.http.cookie.params.CookieSpecPNames;
@ -41,6 +43,7 @@ import org.apache.http.params.HttpParams;
*
* @since 4.0
*/
@Immutable
public class RFC2965SpecFactory implements CookieSpecFactory {
public CookieSpec newInstance(final HttpParams params) {