List of usage examples for org.apache.http.impl.client.cache BasicHttpCacheStorage BasicHttpCacheStorage
public BasicHttpCacheStorage(CacheConfig config)
From source file:org.esigate.cache.BasicCacheStorage.java
@Override public void init(Properties properties) { CacheConfig cacheConfig = CacheConfigHelper.createCacheConfig(properties); setImpl(new BasicHttpCacheStorage(cacheConfig)); }
From source file:de.otto.jsonhome.client.HttpJsonHomeClient.java
/** * Constructs a default HttpJsonHomeClient build on top of a CachingHttpClient with in-memory storage. */// www . ja v a2 s . com public HttpJsonHomeClient() { final CacheConfig cacheConfig = new CacheConfig(); cacheConfig.setMaxCacheEntries(100); cacheConfig.setMaxObjectSize(50000); this.cacheStorage = new BasicHttpCacheStorage(cacheConfig); this.httpClient = new CachingHttpClient(new DefaultHttpClient(), cacheStorage, cacheConfig); }
From source file:de.otto.jsonhome.client.HttpJsonHomeClient.java
/** * Constructs a HttpJsonHomeClient using a HttpClient and a CacheConfig. * <p/>/*w w w.j a v a 2s . c o m*/ * Internally, these two are used to build a CachingHttpClient using a BasicHttpCacheStorage. * * @param httpClient non-caching HttpClient used to get resources. * @param cacheConfig configuration of the HttpCacheStorage */ public HttpJsonHomeClient(final HttpClient httpClient, final CacheConfig cacheConfig) { this.cacheStorage = new BasicHttpCacheStorage(cacheConfig); this.httpClient = new CachingHttpClient(httpClient, cacheStorage, cacheConfig); }
From source file:org.apache.http.impl.client.cache.BasicHttpCache.java
public BasicHttpCache(CacheConfig config) { this(new HeapResourceFactory(), new BasicHttpCacheStorage(config), config); }