Class CacheRevalidatorBase
java.lang.Object
org.apache.hc.client5.http.impl.cache.CacheRevalidatorBase
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
DefaultAsyncCacheRevalidator,DefaultCacheRevalidator
Abstract cache re-validation class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ConcurrentCountMap<String> private static final org.slf4j.Loggerprivate final CacheRevalidatorBase.ScheduledExecutorprivate final SchedulingStrategy -
Constructor Summary
ConstructorsConstructorDescriptionCacheRevalidatorBase(ScheduledThreadPoolExecutor scheduledThreadPoolExecutor, SchedulingStrategy schedulingStrategy) Create CacheValidator which will make ache revalidation requests using the suppliedSchedulingStrategyandScheduledThreadPoolExecutor.CacheRevalidatorBase(CacheRevalidatorBase.ScheduledExecutor scheduledExecutor, SchedulingStrategy schedulingStrategy) Create CacheValidator which will make ache revalidation requests using the suppliedSchedulingStrategyandCacheRevalidatorBase.ScheduledExecutor. -
Method Summary
Modifier and TypeMethodDescriptionvoidawaitTermination(org.apache.hc.core5.util.Timeout timeout) voidclose()(package private) booleanisStale(org.apache.hc.core5.http.HttpResponse httpResponse) Determines if the given response is generated from a stale cache entry.(package private) void(package private) voidjobSuccessful(String identifier) (package private) voidscheduleRevalidation(String cacheKey, Runnable command) Schedules an asynchronous re-validationwrap(ScheduledExecutorService executorService)
-
Field Details
-
scheduledExecutor
-
schedulingStrategy
-
pendingRequest
-
failureCache
-
LOG
private static final org.slf4j.Logger LOG
-
-
Constructor Details
-
CacheRevalidatorBase
public CacheRevalidatorBase(CacheRevalidatorBase.ScheduledExecutor scheduledExecutor, SchedulingStrategy schedulingStrategy) Create CacheValidator which will make ache revalidation requests using the suppliedSchedulingStrategyandCacheRevalidatorBase.ScheduledExecutor. -
CacheRevalidatorBase
public CacheRevalidatorBase(ScheduledThreadPoolExecutor scheduledThreadPoolExecutor, SchedulingStrategy schedulingStrategy) Create CacheValidator which will make ache revalidation requests using the suppliedSchedulingStrategyandScheduledThreadPoolExecutor.
-
-
Method Details
-
wrap
-
scheduleRevalidation
Schedules an asynchronous re-validation -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
awaitTermination
- Throws:
InterruptedException
-
jobSuccessful
-
jobFailed
-
getScheduledIdentifiers
-
isStale
boolean isStale(org.apache.hc.core5.http.HttpResponse httpResponse) Determines if the given response is generated from a stale cache entry.- Parameters:
httpResponse- the response to be checked- Returns:
- whether the response is stale or not
-