class AsynchronousAsyncValidator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private org.apache.http.impl.client.cache.CacheKeyGenerator |
cacheKeyGenerator |
private CachingHttpAsyncClient |
cachingAsyncClient |
private java.util.concurrent.ExecutorService |
executor |
private org.apache.commons.logging.Log |
log |
private java.util.Set<java.lang.String> |
queued |
Constructor and Description |
---|
AsynchronousAsyncValidator(CachingHttpAsyncClient cachingClient,
org.apache.http.impl.client.cache.CacheConfig config)
Create AsynchronousValidator which will make revalidation requests using
the supplied
CachingHttpAsyncClient , and a ThreadPoolExecutor
generated according to the thread pool settings provided in the given
CacheConfig . |
AsynchronousAsyncValidator(CachingHttpAsyncClient cachingClient,
java.util.concurrent.ExecutorService executor)
Create AsynchronousValidator which will make revalidation requests using
the supplied
CachingHttpAsyncClient and ExecutorService . |
Modifier and Type | Method and Description |
---|---|
(package private) java.util.concurrent.ExecutorService |
getExecutor() |
(package private) java.util.Set<java.lang.String> |
getScheduledIdentifiers() |
(package private) void |
markComplete(java.lang.String identifier)
Removes an identifier from the internal list of revalidation jobs in
progress.
|
void |
revalidateCacheEntry(org.apache.http.HttpHost target,
org.apache.http.client.methods.HttpRequestWrapper request,
org.apache.http.client.cache.HttpCacheContext clientContext,
org.apache.http.client.cache.HttpCacheEntry entry)
Schedules an asynchronous revalidation
|
private final CachingHttpAsyncClient cachingAsyncClient
private final java.util.concurrent.ExecutorService executor
private final java.util.Set<java.lang.String> queued
private final org.apache.http.impl.client.cache.CacheKeyGenerator cacheKeyGenerator
private final org.apache.commons.logging.Log log
public AsynchronousAsyncValidator(CachingHttpAsyncClient cachingClient, org.apache.http.impl.client.cache.CacheConfig config)
CachingHttpAsyncClient
, and a ThreadPoolExecutor
generated according to the thread pool settings provided in the given
CacheConfig
.cachingClient
- used to execute asynchronous requestsconfig
- specifies thread pool settings. See
CacheConfig.getAsynchronousWorkersMax()
,
CacheConfig.getAsynchronousWorkersCore()
,
CacheConfig.getAsynchronousWorkerIdleLifetimeSecs()
,
and CacheConfig.getRevalidationQueueSize()
.AsynchronousAsyncValidator(CachingHttpAsyncClient cachingClient, java.util.concurrent.ExecutorService executor)
CachingHttpAsyncClient
and ExecutorService
.cachingClient
- used to execute asynchronous requestsexecutor
- used to manage a thread pool of revalidation workerspublic void revalidateCacheEntry(org.apache.http.HttpHost target, org.apache.http.client.methods.HttpRequestWrapper request, org.apache.http.client.cache.HttpCacheContext clientContext, org.apache.http.client.cache.HttpCacheEntry entry)
void markComplete(java.lang.String identifier)
AsynchronousValidationRequest.run()
once the revalidation is
complete, using the identifier passed in during constructions.java.util.Set<java.lang.String> getScheduledIdentifiers()
java.util.concurrent.ExecutorService getExecutor()