On 13 December 2010 20:32, Oleg Kalnichevski <[email protected]> wrote: > On Mon, 2010-12-13 at 16:35 +0000, sebb wrote: > >> == >> >> I think there should be a public method which gives access to a >> read-only copy of the parameters. >> This could either be done by: >> * changing BasicHttpParams#copyParams(HttpParams target) to be public, >> in which case we probably need to add a synch. version to the >> subclass. >> * or, provide public access to a read-only iterator (again, might need >> to have synch. version for the subclass). >> >> Note: I have got a work-round for JMeter, but it is a bit messy. >> >> It seems to me that other application code may have similar use cases >> - it would certainly be useful to be able to enumerate HttpParams for >> debugging purposes. >> > > Feel free to introduce an iterator to BasicHttpParams / SyncHttpParams > classes.
I added entrySet() to BasicHttpParams, and added a basic test. However, I now wonder whether it should be also added to the abstract super-class and/or DefaultedHttpParams? > You do not need to do anything special for the synchronized > versions as usually iterators are not thread-safe. It is a common > practice that one must explicitly synchronize of the instance prior to > using it. OK --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
