List of usage examples for org.apache.http.impl.client.cache CachingHttpAsyncClient CachingHttpAsyncClient
public CachingHttpAsyncClient(final HttpAsyncClient client, final ResourceFactory resourceFactory, final HttpCacheStorage storage, final CacheConfig config)
From source file:org.callimachusproject.server.chain.CacheHandler.java
private synchronized HttpAsyncClient getClient(HttpHost target) { if (clients.containsKey(target)) return clients.get(target); logger.debug("Initializing server side cache for {}", target); ManagedHttpCacheStorage storage = new ManagedHttpCacheStorage(config); CachingHttpAsyncClient cachingClient = new CachingHttpAsyncClient(new DelegatingClient(delegate), resourceFactory, storage, config); HttpAsyncClient client = new AutoClosingAsyncClient(cachingClient, storage); clients.put(target, client);/*w w w .j a v a 2 s .c om*/ return client; }