[ 
https://issues.apache.org/jira/browse/HTTPCLIENT-979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jonathan Moore updated HTTPCLIENT-979:
--------------------------------------

    Attachment: separate-cache-and-storage.patch

The attached patch makes a number of significant cleanup steps.
* What was previously the HttpCache interface and implementations is now the 
HttpCacheStorage interface.
* A new class (BasicHttpCache) and higher-level interface (HttpCache) were 
introduced to encapsulate both resource management and cache entry storage.
* As a result, a lot of dependencies could be removed from CachingHttpClient, 
making it much easier to understand.
* In turn, many of the mock-driven unit tests previously in 
TestCachingHttpClient were able to be turned into non-mock unit tests when they 
moved.
* Finally, added the MAX_CACHE_ENTRIES notion into CacheConfig, which can be 
passed as a constructor to all existing HttpCache and HttpCacheStorage 
implementations in addition to the CachingHttpClient itself.

One follow up is that there is a Javadoc cleanup/addition pass that will be 
needed, which I would be happy to do as a subsequent patch (because this was a 
largish change I wanted to try to get the code changes into trunk first).

This patch is contributed to the ASF with the permission of my employer.

> cache entry resource management should be extracted from CachingHttpClient
> --------------------------------------------------------------------------
>
>                 Key: HTTPCLIENT-979
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-979
>             Project: HttpComponents HttpClient
>          Issue Type: Improvement
>          Components: Cache
>    Affects Versions: 4.1 Alpha2
>            Reporter: Jonathan Moore
>         Attachments: separate-cache-and-storage.patch
>
>
> As we have built in support for stream-based management of cached response 
> bodies, the CachingHttpClient class has its fingers in too many pies and is 
> involved in resource management but not storage of the actual 
> HttpCacheEntries.
> I have a patch forthcoming. :)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to