Javadoc 8 fixes.
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1619450 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6d7b82d0b6
commit
224711a6d1
|
@ -81,7 +81,8 @@ import org.apache.http.util.Args;
|
|||
import org.apache.http.util.VersionInfo;
|
||||
|
||||
/**
|
||||
* <p>The {@link CachingHttpClient} is meant to be a drop-in replacement for
|
||||
* <p>
|
||||
* The {@link CachingHttpClient} is meant to be a drop-in replacement for
|
||||
* a {@link DefaultHttpClient} that transparently adds client-side caching.
|
||||
* The current implementation is conditionally compliant with HTTP/1.1
|
||||
* (meaning all the MUST and MUST NOTs are obeyed), although quite a lot,
|
||||
|
@ -93,9 +94,11 @@ import org.apache.http.util.VersionInfo;
|
|||
* passing in a {@link CacheConfig}. Note that all of the usual client
|
||||
* related configuration you want to do vis-a-vis timeouts and connection
|
||||
* pools should be done on this backend client before constructing a {@code
|
||||
* CachingHttpClient} from it.</p>
|
||||
* CachingHttpClient} from it.
|
||||
* </p>
|
||||
*
|
||||
* <p>Generally speaking, the {@code CachingHttpClient} is implemented as a
|
||||
* <p>
|
||||
* Generally speaking, the {@code CachingHttpClient} is implemented as a
|
||||
* <a href="http://en.wikipedia.org/wiki/Decorator_pattern">Decorator</a>
|
||||
* of the backend client; for any incoming request it attempts to satisfy
|
||||
* it from the cache, but if it can't, or if it needs to revalidate a stale
|
||||
|
@ -106,15 +109,17 @@ import org.apache.http.util.VersionInfo;
|
|||
* or the cache may make a conditional request on your behalf to the origin).
|
||||
* This notion of "semantic transparency" means you should be able to drop
|
||||
* a {@link CachingHttpClient} into an existing application without breaking
|
||||
* anything.</p>
|
||||
* anything.
|
||||
* </p>
|
||||
*
|
||||
* <p>Folks that would like to experiment with alternative storage backends
|
||||
* <p>
|
||||
* Folks that would like to experiment with alternative storage backends
|
||||
* should look at the {@link HttpCacheStorage} interface and the related
|
||||
* package documentation there. You may also be interested in the provided
|
||||
* {@link org.apache.http.impl.client.cache.ehcache.EhcacheHttpCacheStorage
|
||||
* EhCache} and {@link
|
||||
* org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage
|
||||
* memcached} storage backends.</p>
|
||||
* memcached} storage backends.
|
||||
* </p>
|
||||
* @since 4.1
|
||||
*
|
||||
|
|
|
@ -98,7 +98,7 @@ import org.apache.http.util.Args;
|
|||
* CacheConfig#getAsynchronousWorkerIdleLifetimeSecs() maximum time they
|
||||
* can be idle before being reclaimed}. You can also control the {@link
|
||||
* CacheConfig#getRevalidationQueueSize() size of the queue} used for
|
||||
* revalidations when there aren't enough workers to keep up with demand.</b>
|
||||
* revalidations when there aren't enough workers to keep up with demand.</p>
|
||||
*/
|
||||
public class CacheConfig implements Cloneable {
|
||||
|
||||
|
|
|
@ -72,12 +72,17 @@ import org.apache.http.util.Args;
|
|||
import org.apache.http.util.VersionInfo;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Request executor in the request execution chain that is responsible for
|
||||
* transparent client-side caching. The current implementation is conditionally
|
||||
* transparent client-side caching.
|
||||
* </p>
|
||||
* <p>
|
||||
* The current implementation is conditionally
|
||||
* compliant with HTTP/1.1 (meaning all the MUST and MUST NOTs are obeyed),
|
||||
* although quite a lot, though not all, of the SHOULDs and SHOULD NOTs
|
||||
* are obeyed too.
|
||||
* <p/>
|
||||
* </p>
|
||||
* <p>
|
||||
* Folks that would like to experiment with alternative storage backends
|
||||
* should look at the {@link HttpCacheStorage} interface and the related
|
||||
* package documentation there. You may also be interested in the provided
|
||||
|
@ -85,10 +90,12 @@ import org.apache.http.util.VersionInfo;
|
|||
* EhCache} and {@link
|
||||
* org.apache.http.impl.client.cache.memcached.MemcachedHttpCacheStorage
|
||||
* memcached} storage backends.
|
||||
* <p/>
|
||||
* </p>
|
||||
* <p>
|
||||
* Further responsibilities such as communication with the opposite
|
||||
* endpoint is delegated to the next executor in the request execution
|
||||
* chain.
|
||||
* </p>
|
||||
*
|
||||
* @since 4.3
|
||||
*/
|
||||
|
|
|
@ -41,25 +41,32 @@ import org.apache.http.client.cache.Resource;
|
|||
import org.apache.http.util.Args;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* {@link HttpCacheStorage} implementation capable of deallocating resources associated with
|
||||
* the cache entries. This cache keeps track of cache entries using
|
||||
* the cache entries.
|
||||
* <p>
|
||||
* This cache keeps track of cache entries using
|
||||
* {@link java.lang.ref.PhantomReference} and maintains a collection of all resources that
|
||||
* are no longer in use. The cache, however, does not automatically deallocates associated
|
||||
* resources by invoking {@link Resource#dispose()} method. The consumer MUST periodically
|
||||
* call {@link #cleanResources()} method to trigger resource deallocation. The cache can be
|
||||
* permanently shut down using {@link #shutdown()} method. All resources associated with
|
||||
* the entries used by the cache will be deallocated.
|
||||
* <p/>
|
||||
* </p>
|
||||
* <p>
|
||||
* This {@link HttpCacheStorage} implementation is intended for use with {@link FileResource}
|
||||
* and similar.
|
||||
* <p/>
|
||||
* </p>
|
||||
* <p>
|
||||
* Compatibility note. Prior to version 4.4 this storage implementation used to dispose of
|
||||
* all resource entries upon {@link #close()}. As of version 4.4 the {@link #close()} method
|
||||
* disposes only of those resources that have been explicitly removed from the cache with
|
||||
* {@link #removeEntry(String)} method.
|
||||
* <p/>
|
||||
* </p>
|
||||
* <p>
|
||||
* The {@link #shutdown()} ()} method can still be used to shut down the storage and dispose of
|
||||
* all resources currently managed by it.
|
||||
* </p>
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
|
|
|
@ -65,8 +65,9 @@ public interface MemcachedCacheEntry {
|
|||
* {@link #getStorageKey()} and {@link #getHttpCacheEntry()}. This
|
||||
* should be viewed as an atomic operation on the
|
||||
* {@code MemcachedCacheEntry}.
|
||||
*
|
||||
* @param bytes serialized representation
|
||||
* @throws {@link MemcachedSerializationException} if deserialization
|
||||
* @throws MemcachedSerializationException if deserialization
|
||||
* fails. In this case, the prior values for {{@link #getStorageKey()}
|
||||
* and {@link #getHttpCacheEntry()} should remain unchanged.
|
||||
*/
|
||||
|
|
|
@ -45,41 +45,49 @@ import org.apache.http.client.cache.HttpCacheUpdateException;
|
|||
import org.apache.http.impl.client.cache.CacheConfig;
|
||||
|
||||
/**
|
||||
* <p>This class is a storage backend that uses an external <i>memcached</i>
|
||||
* <p>
|
||||
* This class is a storage backend that uses an external <i>memcached</i>
|
||||
* for storing cached origin responses. This storage option provides a
|
||||
* couple of interesting advantages over the default in-memory storage
|
||||
* backend:
|
||||
* </p>
|
||||
* <ol>
|
||||
* <li>in-memory cached objects can survive an application restart since
|
||||
* they are held in a separate process</li>
|
||||
* <li>it becomes possible for several cooperating applications to share
|
||||
* a large <i>memcached</i> farm together</li>
|
||||
* </ol>
|
||||
* <p>
|
||||
* Note that in a shared memcached pool setting you may wish to make use
|
||||
* of the Ketama consistent hashing algorithm to reduce the number of
|
||||
* cache misses that might result if one of the memcached cluster members
|
||||
* fails (see the <a href="http://dustin.github.com/java-memcached-client/apidocs/net/spy/memcached/KetamaConnectionFactory.html">
|
||||
* KetamaConnectionFactory</a>).
|
||||
* </p>
|
||||
*
|
||||
* <p>Because memcached places limits on the size of its keys, we need to
|
||||
* <p>
|
||||
* Because memcached places limits on the size of its keys, we need to
|
||||
* introduce a key hashing scheme to map the annotated URLs the higher-level
|
||||
* caching HTTP client wants to use as keys onto ones that are suitable
|
||||
* for use with memcached. Please see {@link KeyHashingScheme} if you would
|
||||
* like to use something other than the provided {@link SHA256KeyHashingScheme}.</p>
|
||||
* like to use something other than the provided {@link SHA256KeyHashingScheme}.
|
||||
* </p>
|
||||
*
|
||||
* <p>Because this hashing scheme can potentially result in key collisions (though
|
||||
* <p>
|
||||
* Because this hashing scheme can potentially result in key collisions (though
|
||||
* highly unlikely), we need to store the higher-level logical storage key along
|
||||
* with the {@link HttpCacheEntry} so that we can re-check it on retrieval. There
|
||||
* is a default serialization scheme provided for this, although you can provide
|
||||
* your own implementations of {@link MemcachedCacheEntry} and
|
||||
* {@link MemcachedCacheEntryFactory} to customize this serialization.</p>
|
||||
* {@link MemcachedCacheEntryFactory} to customize this serialization.
|
||||
* </p>
|
||||
*
|
||||
* <p>Please refer to the <a href="http://code.google.com/p/memcached/wiki/NewStart">
|
||||
* <p>
|
||||
* Please refer to the <a href="http://code.google.com/p/memcached/wiki/NewStart">
|
||||
* memcached documentation</a> and in particular to the documentation for
|
||||
* the <a href="http://code.google.com/p/spymemcached/">spymemcached
|
||||
* documentation</a> for details about how to set up and configure memcached
|
||||
* and the Java client used here, respectively.</p>
|
||||
* and the Java client used here, respectively.
|
||||
* </p>
|
||||
*
|
||||
* @since 4.1
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue