hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <o.kalnichev...@dplanet.ch>
Subject Re: [PATCH] HttpClient/HttpMultiClient merge
Date Thu, 28 Nov 2002 20:42:25 GMT
Oops. My hands seem to be shaky. Sorry about my previous post

Ortwin,
I have already proposed similar kind of protocol registry a while ago. I
have already whipped up a few classes. If you decide to do it yourself,
I think it should also include a default port and a socket factory. I do
agree that Mike's design would look even cooler if we did away with that
awkward isSecure flag in HttpClient and HttpConnection methods and all
ugly code around it 

Cheers

Oleg



On Thu, 2002-11-28 at 20:45, Ortwin Gl├╝ck wrote:
> I finally reviewed your patch: Woah, GREAT WORK!
> 
> Architecture looks clean. Tests run smoothly (except of 4 offline tests, 
> but this could be a config or a temporary problem).
> 
> There are a number of FIXME's. But this could easily cleaned up after 
> the commit.
> 
> I have some further enhancements but they do not block a commit:
> 
> - in MultiThreadedHttpConnectionManager (what a class name!), have you 
> considered using a WeakHashMap instead of building this whole weak ref 
> stuff yourself? This JDK 1.2 compatible. I did not look at the details 
> so maybe it is not possible.
> 
> - There are a lot of 'if (protocol.equalsIgnoreCase("HTTP")' statements. 
> We could make a Protocol class like:
> 
> public class Protocol {
>    private static Map protocols = new HashMap();
>    private String name;
>    private boolean secure;
> 
>    static {
>       protocols.put("HTTP", new Protocol("http", false));
>       protocols.put("HTTPS", new Protocol("https", true));
>    }
> 
>    private Protocol(String name, boolean secure) {
>      this.name = name;
>      this.secure = secure;
>    }
> 
>    public static Protocol getProtocol(String name) {
>      return (Protocol) protocols.get(name);
>    }
> }
> 
> 
> In my opinion we can commit this.
> 
> (A patch that works with the current CVS HEAD would be nice...)
> 
> 
> Odi
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:commons-httpclient-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:commons-httpclient-dev-help@jakarta.apache.org>
-- 
Oleg Kalnichevski <o.kalnichevski@dplanet.ch>


Mime
View raw message