Class ImmediateSchedulingStrategy
- java.lang.Object
-
- org.apache.http.impl.client.cache.ImmediateSchedulingStrategy
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,SchedulingStrategy
@Contract(threading=SAFE) public class ImmediateSchedulingStrategy extends java.lang.Object implements SchedulingStrategy
Immediately schedules any incoming validation request. Relies onCacheConfig
to configure the usedThreadPoolExecutor
.- Since:
- 4.3
-
-
Constructor Summary
Constructors Constructor Description ImmediateSchedulingStrategy(CacheConfig cacheConfig)
Uses aThreadPoolExecutor
which is configured according to the givenCacheConfig
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
schedule(AsynchronousValidationRequest revalidationRequest)
Schedule anAsynchronousValidationRequest
to be executed.
-
-
-
Constructor Detail
-
ImmediateSchedulingStrategy
public ImmediateSchedulingStrategy(CacheConfig cacheConfig)
Uses aThreadPoolExecutor
which is configured according to the givenCacheConfig
.- Parameters:
cacheConfig
- specifies thread pool settings. SeeCacheConfig.getAsynchronousWorkersMax()
,CacheConfig.getAsynchronousWorkersCore()
,CacheConfig.getAsynchronousWorkerIdleLifetimeSecs()
, andCacheConfig.getRevalidationQueueSize()
.
-
-
Method Detail
-
schedule
public void schedule(AsynchronousValidationRequest revalidationRequest)
Description copied from interface:SchedulingStrategy
Schedule anAsynchronousValidationRequest
to be executed.- Specified by:
schedule
in interfaceSchedulingStrategy
- Parameters:
revalidationRequest
- the request to be executed; notnull
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
-